buildmer | R Documentation |
buildmer
to fit mixed-effects models using lmer
/glmer
from lme4
Use buildmer
to fit mixed-effects models using lmer
/glmer
from lme4
buildmer(
formula,
data = NULL,
family = gaussian(),
buildmerControl = buildmerControl()
)
formula |
See the general documentation under |
data |
See the general documentation under |
family |
See the general documentation under |
buildmerControl |
Control arguments for buildmer — see the general documentation under |
library(buildmer)
model <- buildmer(Reaction ~ Days + (Days|Subject),lme4::sleepstudy)
# Tests from github issue #2, that also show the use of the 'direction' and 'crit' parameters:
bm.test <- buildmer(cbind(incidence,size - incidence) ~ period + (1 | herd),
family=binomial,data=lme4::cbpp)
bm.test <- buildmer(cbind(incidence,size - incidence) ~ period + (1 | herd),
family=binomial,data=lme4::cbpp,buildmerControl=buildmerControl(direction='forward'))
bm.test <- buildmer(cbind(incidence,size - incidence) ~ period + (1 | herd),
family=binomial,data=lme4::cbpp,buildmerControl=buildmerControl(crit='AIC'))
bm.test <- buildmer(cbind(incidence,size - incidence) ~ period + (1 | herd),
family=binomial,data=lme4::cbpp,
buildmerControl=buildmerControl(direction='forward',crit='AIC'))
# Example showing use of the 'include' parameter to force a particular term into the model
m1 <- buildmer(Reaction ~ Days,data=lme4::sleepstudy,buildmerControl=list(include=~(1|Subject)))
# the below are equivalent
m2 <- buildmer(Reaction ~ Days,data=lme4::sleepstudy,buildmerControl=list(include='(1|Subject)'))
m3 <- buildmer(Reaction ~ Days + (1|Subject),data=lme4::sleepstudy,buildmerControl=list(
include=~(1|Subject)))
m4 <- buildmer(Reaction ~ Days + (1|Subject),data=lme4::sleepstudy,buildmerControl=list(
include='(1|Subject)'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.