FitModel: Forward Selection for Generalized (Mixed) Linear Models with...

Description Usage Arguments Details References Examples

View source: R/analysis_functions.R

Description

Creates a generalized fitted object.

Usage

1

Arguments

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.

Details

The procedure works like this...

References

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/.

Examples

 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)

google/glmmplus documentation built on May 17, 2019, 7:47 a.m.