[R-sig-ME] parsimonious mixed models
Wing Yee Chow
wingyeechow.zoey at gmail.com
Wed Nov 9 11:44:55 CET 2016
Hi there,
I'm trying to follow Bates et al.'s guidelines for parsimonious mixed models
and have two questions:
1. In reducing (near-zero) variance components from the random effects
structure, is the criterion simply the size of the variance? Or do I need to
keep a simple effect as long as I'm keeping a higher order effect that
involves that factor? That is, with the following random effects structure,
do I take out (i) just cSenttype:cCongruity for item, or (ii) both
cSenttype:cCongruity for item AND cCongruity for subj?
Random effects:
Groups Name Variance Std.Dev.
item cSenttype:cCongruity 0 0.0
item.1 cCongruity 205437 453.3
item.2 cSenttype 100765 317.4
item.3 (Intercept) 124422 352.7
subj cSenttype:cCongruity 134752 367.1
subj.1 cCongruity 0 0.0
subj.2 cSenttype 87161 295.2
subj.3 (Intercept) 2434746 1560.4
Residual 4891977 2211.8
Number of obs: 1082, groups: item, 48; subj, 24
2. In another dataset, I have a 3 x 2 within-participant and
within-item design. I specified the contrasts for the two factors in this
way:
contrasts(tempdata$congruity) <- contr.sum(2)/2
contrasts(tempdata$sentencetype)=cbind("AvsBC" = c(-2/3, 1/3, 1/3), "BvsC" =
c(0, -1/2, 1/2))
I got the model matrix (mmatrix) from the maximal model (m0) to construct
the zero-correlation parameter model (m1). I think I know how to do this for
a factor with two levels (i.e., only one contrast), but I'm not sure about
the current case since I have both cSenttypeAvsBC and cSenttypeBvsC for the
3-level factor sentencetype. Is this the right syntax?
cSenttypeAvsBC <- mmatrix [,2] # columns 2 and 3 encode different contrasts
of sentencetype
cSenttypeBvsC <- mmatrix[,3]
cCongruity <- mmatrix[,4]
m1<- lmer(value ~ sentencetype * congruity + ((cSenttypeAvsBC +
cSenttypeBvsC) * cCongruity||subj) + ((cSenttypeAvsBC + cSenttypeBvsC) *
cCongruity||item), REML=FALSE,
data=tempdata)
Many thanks!!
Wing-Yee Chow
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list