1
$\begingroup$

I am trying to run an equivalent Linear Mixed Model test in R that I have run in SPSS but can't seem to get the same results.

There are three variables in the design: The DV, Cond (fixed factor, 2 levels), Status (fixed factor, 3 levels, repeated within subject 'id'). The random factor is subject with an intercept.

The SPSS code looks like this:

MIXED DV BY Cond Status /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE) /FIXED=Cond Status Cond*Status | SSTYPE(3) /METHOD=REML /PRINT=SOLUTION TESTCOV /RANDOM=INTERCEPT | SUBJECT(id) COVTYPE(ID) /REPEATED=Status | SUBJECT(id) COVTYPE(CS).

In R, using the nlme package, I can't figure out how to set the random effect 'id' to have the covariance type be "Scaled Identity" and the repeated factor 'Status|id' to have the repeated covariance type of "Compound Symmetry" like it is specified in SPSS.

My R code thus far looks something like below but I can't get the same results from SPSS.

model3 <- lme(DV ~ Status + Cond + Status:Cond, random=~Status|id, data=RLMM.csv)

I've tried messing around with the "cor=corCompSymm" and "weight=" functions and can't figure out what I'm doing wrong.

Any help with what the R code would look like to mimic the SPSS model exactly would be most appreciated. Thank you.

$\endgroup$

closed as off-topic by Tim Jan 26 at 21:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Tim
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.