Problem. I'd like to do a marginal model analysis in R--I think it is sometimes called population averaged model, marginal multilevel model or marginal linear regression model. However, I can't find any information on stackoverflow, Google, or Youtube about how to do this specifically in R.
Background. I'm talking about marginal models as described by The Analysis Factor here and here and as described on these PowerPoint slides. There's one person on CrossValidated who mentions this analysis in SPSS and R but he doesn't show his actual code, and his question hasn't been answered. Not sure if should be done in nlme
package or not.
SPSS Code. I've described the nature of this data elsewhere on CrossValidated, but basically, we're interested in predicting participants emotion (measured twice in 2 different conditions) via personality (measured once). Here's the code I used in SPSS.
MIXED emotion BY condition WITH centeredPersonality
/FIXED=condition centeredPersonality condition*centeredPersonality
/METHOD = REML
/REPEATED= condition | SUBJECT (ID) COVTYPE(UN)
/PRINT=SOLUTION.
Question. How to do this in R?