Description Usage Arguments Details Value Author(s) References See Also Examples
Imputes univariate missing data using linear regression.
1 2 |
formula |
an object of class '"formula"' (or one that can be coerced to that class): a symbolic description of the model to be fitted. See bayesglm 'formula' for details. |
data |
A data frame containing the incomplete data and the matrix of the complete predictors. |
start |
Starting value for bayesglm. |
maxit |
Maximum number of iteration for bayesglm. The default is 100. |
draw.from.beta |
Draws from posterior distribution of the betas to add randomness. |
missing.index |
The index of missing units of the outcome variable |
... |
Currently not used. |
see bayesglm
model |
A summary of the fitted model. |
expected |
The expected values estimated by the model. |
random |
Vector of length n.mis of random predicted values predicted by using the normal distribution. |
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
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, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2006.
1 2 3 4 5 6 7 8 | # 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(1,100,10)]<-NA
dat.xy <- data.frame(x,y)
# imputation
mi.continuous(y~x, data = dat.xy)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.