Description Usage Arguments Details References Examples
View source: R/analysis_functions.R
Creates a generalized fitted object.
1 |
formula |
A formula which may contain random effects according to the lme4 package's specification. |
data |
Either a mids object from the mice package, or a data frame. |
family |
Any family accepted by glm or lmer. Do not use quotation marks. |
The procedure works like this...
Douglas Bates and Martin Maechler (2010). lme4: Linear mixed-effects models using S4 classes. R package version 0.999375-37. http://CRAN.R-project.org/package=lme4
Stef van Buuren, Karin Groothuis-Oudshoorn (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3), 1-67. URL http://www.jstatsoft.org/v45/i03/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(testdata)
# A sample data set with testdata values
head(testdata)
# creating a Muliply Imputed Data Set (mids) object
mids <- ImputeData(testdata, m = 5, maxit = 5)
# a single imputation
complete <- complete(mids)
# Backwards elimination for fixed effect models
FitModel(y ~ x + w + z, data = complete)
FitModel(y ~ x + w + z, data = mids)
# Backwards elimination for mixed (fixed and random) models
FitModel(y ~ (1 | factor.1) + x + w + z, data = complete)
FitModel(y ~ (1 | factor.1) + x + w + z, data = mids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.