Hi everyone,
I am trying to replicate a multilevel model with repeated measures that I ran in SPSS using R's nlme
package (the example and the data are in chapter 4 of : Bolger, N., & Laurenceau, J.P. (2013). Intensive longitudinal methods. The Guilford Press., the data are publicly accessible, in Intensive Longitudinal Methods: An Introduction to Diary and Experience Sampling Research ). However, I am consistently getting different results, specifically for the random effects estimates and AIC values. The SPSS syntax:
"MIXED intimacy WITH time01 treatment
/FIXED = time01 treatment time01*treatment | SSTYPE(3)
/METHOD = REML
/PRINT = G SOLUTION TESTCOV
/RANDOM = INTERCEPT time01 | SUBJECT(id) COVTYPE(UN) SOLUTION
/REPEATED = time | SUBJECT(id) COVTYPE(AR1)."
I have tried the 'nlme R' syntax:
"library(nlme)
model <- lme(intimacy ~ time01 * treatment,
random = list(id = pdSymm(~ time01)),
correlation = corAR1(form = ~ time | id),
method = "REML",
data = data)
summary(model)"
I do not see on the nlme manual any instruction equivalent to "/REPEATED = time" in the last line of the R syntax. Possibily this is my error.
Questions:
- How can I correctly specify the 'repeated measures' with an AR(1) structure in
lme()
to match the SPSS results? - Is there an alternative way to replicate this model in R that captures both the random effects, the 'repeated measures' and AR(1) residual correlation?
Any guidance or suggestions would be greatly appreciated!
The results must be the same as those of Bolger & Laurenceau , Tables 4.1 and 4.2 (pg 53-54).
Thank you in advance for your help,
Jesús Rosel