1

I am new to R and am trying to reproduce results from my SPSS analyses, but seem to be missing something.

I am trying to run a linear mixed effects model using gls in the nlme package. The SPSS syntax I am trying to reproduce is:

MIXED Satisfaction_A BY Role
  /FIXED=Role | NOINT SSTYPE(3)
  /METHOD=ML
  /PRINT=SOLUTION TESTCOV
  /RANDOM=Role | SUBJECT(focalid) COVTYPE(UNR)
  /REPEATED=Role | SUBJECT(dyadid*focalid) COVTYPE(UNR).

Essentially, it is a two-intercept model with nested data where Focal ID is the level-2/nesting variable which contains 2 responses for Satisfaction, distinguished by Role.

The R code I have so far is:

gls(Satisfaction_A ~ Role -1, #Two-intercept approach
       data = chlpairwise,
       correlation = corSymm(form = ~1|focalid/dyadid),
       weights = varIdent(form = ~1|Role),
       method = "ML",
       na.action = na.omit)

The regression coefficients are very similar to those from SPSS. But what am I missing in the code so that I can view the Covariance Parameters like in SPSS? SPSS Covariance Parameters

Many thanks! I hope to keep learning so that I can eventually give back to this community for all of the help I have received. :)

1 Answers1

0

Probably you need to use the function getVarCov() that returns the marginal covariance matrix from a fitted marginal model. It will also work if you fit a linear mixed effects model using function lme().