I was asked to make boxplot of variable SAW for the 2 surgical intervention types defined by HSW and dataset name is mydata, Then i was asked to check if there any outliers in the boxplot and i found outliers but i can't remove them and i tried multiple ways but all goes with failure. could you please help me with that issue?
and that is my boxplot
boxplot(mydata$SAW~mydata$HSW,main="SAW for two surgical")
no_outliers <- subset(mydata, mydata$SAW > (Q1 - 1.5*IQR) & mydata$HSW < (Q3 + 1.5*IQR))
This was my last trial but it gave me error says
Error in surgery$SAW : $ operator is invalid for atomic vectors
On way would be to use the boxplot object itself-