On Jan 2, 2015, at 4:58 AM, Methekar, Pushpa (GE Transportation, Non-GE) wrote:
> Hi ,
> I am working on a function .
>
> rm.outliers = function(dataset,model){
> dataset$predicted = predict(model)
>dataset$stdres = rstudent(model)
> m = 1
> for(i in 1:length(dataset$stdres)){
>
Your problem is that you are subsetting the dataset on line 13 of the
function, but then on the following line you attempt to add predicted
values from the complete data used to fit the model. You'll have to subset
that as well (and the same would be true for the following line where you
attempt to
Hi ,
I am working on a function .
rm.outliers = function(dataset,model){
dataset$predicted = predict(model)
dataset$stdres = rstudent(model)
m = 1
for(i in 1:length(dataset$stdres)){
dataset$outlier_counter[i] = if(dataset$stdres[i] >= 3 |
3 matches
Mail list logo