Description Usage Arguments Value Note Author(s) References See Also Examples
A function for plotting the histogram of each variable and of its observed and imputed values.
1 2 3 4 5 6 7 8 9 10 11 | mi.hist( object, Yobs, ...)
## S4 method for signature 'mi.method,ANY'
mi.hist( object, Yobs, ...)
## S4 method for signature 'mi.categorical,ANY'
mi.hist( object, Yobs, ...)
## S4 method for signature 'mi.binary,ANY'
mi.hist( object, Yobs,...)
## S4 method for signature 'mi.polr,ANY'
mi.hist( object, Yobs, ...)
## S4 method for signature 'mi.pmm,ANY'
mi.hist( object, Yobs, ...)
|
Yobs |
observed values. |
object |
imputed values or member object of mi.method object family. |
... |
Other options for plot function. |
The histogram (in black) of the complete variable, the histogram (in blue) of the observed values and the histogram (in red) of the imputed values.
The histogram of the completed values (observed plus imputed) is in black, the histogram of the imputed values in red, while the one of the observed values in blue.
Masanao Yajima yajima@stat.columbia.edu, Yu-Sung Su suyusung@tsinghua.edu.cn, M.Grazia Pittau grazia@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu
Kobi Abayomi, Andrew Gelman and Marc Levy. (2008). “Diagnostics for multivariate imputations”. Applied Statistics 57, Part 3: 273–291.
Yu-Sung Su, Andrew Gelman, Jennifer Hill, Masanao Yajima. (2011). “Multiple Imputation with Diagnostics (mi) in R: Opening Windows into the Black Box”. Journal of Statistical Software 45(2).
Andrew Gelman and Jennifer Hill. (2007). Data Analysis Using Regression and Multilevel/Hierarchical Models. Cambridge University Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # true data
x<-rnorm(100,0,1) # N(0,1)
y<-rnorm(100,(1+2*x),1.2) # y ~ 1 + 2*x + N(0,1.2)
# create artificial missingness on y
y[seq(2,100,10)]<-NA
dat.xy <- data.frame(x,y)
# imputation
dat.cont.mi <- mi.continuous(y~x, data = dat.xy)
mi.hist( dat.cont.mi, y)
# imputation
#dat.mi <- mi(dat.xy)
#mi.hist( imp(dat.mi,1)[["y"]], y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.