IOANNA IOANNOU
2015-Jun-18 11:01 UTC
[R] Completing Unordered Categorical missing variables using package mi
Hello all, A perhaps simple question. I am trying to complete unordered categorical missing data using mi package. There are two variables with missing data: Mat and Use. The problem is that the Use has several categories and somehow this means I can't plot the results as I get this error. Any idea how to fix the problem? Any help much appreciated, Best, Ioanna new<-read(Sample.csv) new$Use<-factor(new$Use) MissingData <- missing_data.frame(new) MissingData <- change(MissingData, y = "DS", what = "type", to "ordered-categorical") # STEP 3: look deeper summary(MissingData) summary(MissingData at patterns) show(MissingData) hist(MissingData) # STEP 4: impute ## Not run: IMPsample <- mi(MissingData) #STEP5: diagnostics Plot(IMPsample) Error in `rownames<-`(`*tmp*`, value = c("Oc11", "Oc12", "Oc13", "Oc14", : length of 'dimnames' [1] not equal to array extent