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

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)


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)


Now i am checking the outlier via boxplot.

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


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.



Views: 475

Reply to This

© 2021   TechTarget, Inc.   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service