I have within-subject physiological data from participants (part
), who have all looked at stimuli (reading newspapers) on three rounds (round
), which each have five papers (paper
), and within each there are variable number of visits (visit
) in the newspaper. I have two fixed factors (CONDhier
and CONDabund
) plus interaction to predict the physiological state (e.g., EDA
), which is usually autoregressive. I try to take into account individual differences in physiology with random effects (let's settle for intercept only for now), and perhaps fatigue over rounds with another random effect.
Thus, my model that I would like to run in R would be, in SPSS:
MIXED EDA BY CONDhier CONDabund
/FIXED=CONDhier CONDabund CONDhier*CONDabund | SSTYPE(3)
/RANDOM=INTERCEPT | SUBJECT(part) COVTYPE(VC)
/RANDOM=INTERCEPT | SUBJECT(part*round) COVTYPE(VC)
/PRINT=SOLUTION
/METHOD=REML
/REPEATED=visit | SUBJECT(part*round*paper) COVTYPE(AR1).
Now, I have understood that while lme
does not do crossed terms well, lmer
(that handles crossed terms with no problem) cannot use different covariance structures. I can run simple lme models such as
lme(EDA ~ factor(CONDhier) * factor(CONDabund), random= ~1
|part, na.action=na.exclude, data=phys2)
but a more complicated model is beyond me. I have read that crossed terms in lme can be done with random definitions like
random=pdBlocked(list(pdCompSymm(~part), pdCompSymm(~round-1), pdCompSymm(~paper-1),
pdCompSymm(~visit-1)))
but that seems to block the AR1 structure, and the second random intercept for part*round, from me. And I'm not so sure it's the same as my SPSS syntax anyway.
So, any advice? Although there are lots of different writings on lme and lmer, I couldn't find one that would have both crossed terms and AR1.
(Also, the syntax on lme seems quite obscure: from several different sources I have understood that | groups what is on the left under what's on the right, that / makes nested terms, that ~1 is random intercept, ~x is random slope, and ~1+x is both, but there seems to be at least : and -1 definitions that I couldn't find anywhere. Is there a tutorial that would explain all the different definitions?)
question from:
https://stackoverflow.com/questions/20124109/linear-mixed-model-with-crossed-repeated-effects-and-ar1-covariance-structure-i