Getting problem on outlier treatment after imputing the Missing value By HMISC package

r
data_science

#1

Hi all,

I am using Hmisc package for imputing the missing value. At first, I have converted all my dummy variables into factor. Then I am using aregimpute function from the HMisc package. I have written following code:

    impute_miss <- aregImpute(~ MarketID + MarketSize + LocationID + AgeOfStore + Promotion+ week+SalesInThousands , data =table.miss, n.impute = 5)

impute_miss

Then, I have completed the datasets by impute.transcan function. I have written following code for that

completetable <- impute.transcan(impute_miss, imputation=1, data=table.miss,list.out=TRUE,pr=FALSE, check=FALSE)

head(completetable)

Now i am checking the outlier via boxplot.

    bp <- boxplot(as.numeric(completetable$SalesInThousands))

   bp$out

still ow, It works fine.

But, after that, when i am going to remove the outlier by filtering, It shows me error.

i am using following code for that :

completetable1<-completetable[as.numeric(completetable$SalesInThousands)<99.65,]

It is showing me the below error,

Error in completetable[as.numeric(completetable$SalesInThousands) < 99.65, : incorrect number of dimensions

I have tried a lot to solve this problem, but failed to recover. Can you please identify what wrong i have done?

Please help me to solve this problem.

Any suggestion is really appreciable.

Thanks,
snandy2011


#2

Try using a which to specific exact condition for that cell.See if that works