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)
still now, It works fine.. No error.
But, after that, when i am going to check the outlier, it shows me the error.
i am using following code for checking outlier.
boxplot(completetable$SalesInThousands)
it is showing me the below error,
Error in k[...] : incorrect number of dimensions
i cant understand why i am getting this error? Please help me to solve this problem.
Any suggestion is really appreciable.
The full code
library(boot)
library(car)
library(QuantPsyc)
library(lmtest)
library(sandwich)
library(vars)
library(nortest)
library(MASS)
setwd("D:\\R\\New folder")
table <- read.csv("Fn-UseC_-Marketing-Campaign-Eff-UseC_-FastF.csv")
View(table)
str(table)
## Creating Missing Value
library(missForest)
table.miss <- prodNA(table, noNA = 0.1)
summary(table.miss)
##missing value Checking
sapply(table.miss,function(x)sum(is.na(x)))
## Load the Package
library(Hmisc)
impute_miss <- aregImpute(~ MarketID + MarketSize + LocationID + AgeOfStore +
Promotion+ week+SalesInThousands , data = table.miss, n.impute = 5)
impute_miss
impute_miss$imputed$week
## Combined The data sets
completetable <- impute.transcan(impute_miss, imputation=1, data=table.miss, list.out=TRUE,pr=FALSE, check=FALSE)
head(completetable)
str(completetable)
##outlier treatement
names(completetable)
summary(completetable)
boxplot(completetable$SalesInThousands)
I am getting the below error during the outlier treatment
boxplot(completetable$SalesInThousands)
Error in k[...] : incorrect number of dimensions
Thanks,
snandy2011Preformatted text