imp <- mice(boys, maxit = 1)
### stripplot, all numerical variables
if (FALSE) {
stripplot(imp)
}
### same, but with improved display
if (FALSE) {
stripplot(imp, col = c("grey", mdc(2)), pch = c(1, 20))
}
### distribution per imputation of height, weight and bmi
### labeled by their own missingness
if (FALSE) {
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)
if (FALSE) {
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
if (FALSE) {
stripplot(imp, age + hgt ~ .imp | reg, hgt,
col = c(grDevices::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
if (FALSE) {
stripplot(imp, gen ~ phb, factor = 2, cex = c(8, 1), hor = TRUE)
}
### circle fun
stripplot(imp, gen ~ .imp,
na = wgt, factor = 2, cex = c(8.6),
hor = FALSE, outer = TRUE, scales = "free", pch = c(1, 19)
)
Run the code above in your browser using DataLab