I conducted 2-level mixed effects analysis both in SPSS and in R for a same model (random intercepts and slopes model). Results have been generally similar. However, I have one dataset where degree of freedoms differ greatly. According to manuals for R/SPSS, both packages seem to use the same method (Satterthwaite) to approximate degree of freedom. As Satterthwaite method use variance to approximate degree of freedom, I am thinking that the way variance is calculated differs between SPSS and R, but I have not learned enough about this.
One concern is, when I run SPSS, I received a following error message: "Final Hessian matrix not positive definite" (No error message from R for the same dataset).
Here is my code. I used a same dataset.Number of samples in my data is 23.Five samples each for 5 subgroups (specified as “exp” in the code), with two missing data. Sample size is rather small, and this might have caused a problem. Estimated values for intercept and slope were very similar between R and SPSS, while DF differed largely. For example, for the slope for the lower-level, DFs were 123.9 in SPSS and 2.4 in R.
If you notice any problem, it would be a great help. Thank you.
R (I used lmerTest)
AmyMed.model = lmer(Amy ~ pleas_wc+ pleas_gc + (pleas_wc|exp), data= AmyMed)
summary(AmyMed.model)
SPSS v21
MIXED Amy WITH pleas_wc pleas_gc
/CRITERIA=CIN(95) MXITER(1000) MXSTEP(100) SCORING(1) SINGULAR(0.000000000001) HCONVERGE(0,ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
/FIXED=pleas_wc pleas_gc | SSTYPE(3)
/RANDOM=INTERCEPT pleas_wc | SUBJECT(exp) COVTYPE(UN).
/METHOD=REML
I also tried SSTYPE(1) for SPSS, but the large differences in the degree of freedom between SPSS and R remained.