View source: R/regressionImp.R
| regressionImp | R Documentation |
Impute missing values based on a regression model.
regressionImp(
formula,
data,
family = "AUTO",
robust = FALSE,
imp_var = TRUE,
imp_suffix = "imp",
mod_cat = FALSE
)
formula |
model formula to impute one variable |
data |
A data.frame containing the data |
family |
family argument for |
robust |
|
imp_var |
|
imp_suffix |
suffix used for TF imputation variables |
mod_cat |
|
lm() is used for family "normal" and glm() for all other families.
If robust = TRUE, lmrob() is used for family "normal"
and glmrob() for all other families.
the imputed data set.
Alexander Kowarik
A. Kowarik, M. Templ (2016) Imputation with R package VIM. Journal of Statistical Software, 74(7), 1-16.
Other imputation methods:
hotdeck(),
impPCA(),
irmi(),
kNN(),
matchImpute(),
medianSamp(),
rangerImpute(),
sampleCat(),
vimpute(),
xgboostImpute()
data(sleep)
sleepImp1 <- regressionImp(Dream+NonD~BodyWgt+BrainWgt,data=sleep)
sleepImp2 <- regressionImp(Sleep+Gest+Span+Dream+NonD~BodyWgt+BrainWgt,data=sleep)
data(testdata)
imp_testdata1 <- regressionImp(b1+b2~x1+x2,data=testdata$wna)
imp_testdata3 <- regressionImp(x1~x2,data=testdata$wna,robust=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.