imp <- mice(boys, maxit=2)
### box-and-whisker plot per imputation of all numerical variables
bwplot(imp)
### tv (testicular volume), conditional on region
bwplot(imp, tv~.imp|reg)
### same data, organized in a different way
bwplot(imp, tv~reg|.imp, theme=list())
### stripplot, all numerical variables
stripplot(imp)
### same, but with improved display
stripplot(imp, col=c("grey",mdc(2)),pch=c(1,20))
### distribution per imputation of height, weight and bmi
### labeled by their own missingness
stripplot(imp, hgt+wgt+bmi~.imp, cex=c(2,4), pch=c(1,20),jitter=FALSE,
layout=c(3,1))
### same, but labeled with the missingness of wgt (just four cases)
stripplot(imp, hgt+wgt+bmi~.imp, na=wgt, cex=c(2,4), pch=c(1,20),jitter=FALSE,
layout=c(3,1))
### distribution of age and height, labeled by missingness in height
### most height values are missing for those around
### the age of two years
### some additional missings occur in region WEST
stripplot(imp, age+hgt~.imp|reg, hgt, col=c(hcl(0,0,40,0.2), mdc(2)),pch=c(1,20))
### heavily jitted relation between two categorical variables
### labeled by missingness of gen
### aggregated over all imputed data sets
stripplot(imp, gen~phb, factor=2, cex=c(8,1), hor=TRUE)
### circle fun
stripplot(imp, gen~.imp, factor=2, cex=c(8,6), hor=FALSE, na=wgt,outer=TRUE,scales="free",pch=c(1,19))
### density plot of head circumference per imputation
### blue is observed, red is imputed
densityplot(imp, ~hc|.imp)
### All combined in one panel.
densityplot(imp, ~hc)
### The more powerful density plot of all
### numerical variables with at least
### two missing values.
densityplot(imp)
### xyplot: scatterplot by imputation number
### observe the erroneous outlying imputed values
### (caused by imputing hgt from bmi)
xyplot(imp, hgt~age|.imp, pch=c(1,20),cex=c(1,1.5))
### same, but label with missingness of wgt (four cases)
xyplot(imp, hgt~age|.imp, na.group=wgt, pch=c(1,20),cex=c(1,1.5))
Run the code above in your browser using DataLab