[R] Completing Unordered Categorical missing variables using package mi

IOANNA IOANNOU ii54250 at msn.com
Thu Jun 18 13:01:53 CEST 2015


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

 



More information about the R-help mailing list