Hi, this is my function to find rstudent of model which will give me outlier
But I wonder if I could find out the exact no. of outlier in data set.
Like outlierTest() does from car package .


rm.outliers = function(dataset,model){
dataset$rstudent = rstudent(model)
for(i in 1:length(dataset$rstudent)){
       if(dataset$rstudent[i]>=-3 & dataset$rstudent[i]<=3)
             {print(dataset$rstudent[i])}
else { print("this is an outlier")
            library(car)
       print(outlierTest(model,n.max=1, order=TRUE) )  }
i<-i+1
}
}


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to