I am doing a linear mixed model in R (lmer) to investigate the difference in activity levels (AL) between two disease groups and two kinds of therapy. Additionally, it is repeated measures data, each subject is measured up to 4 times and each patient receives both kinds of therapy.

My model looks like this (in R syntax):

lmer(AL ~ time + group + therapy + (therapy|subj_ID), data = data_model)

All factors are significant, which is why I want to do post-hoc comparisons. I am doing this using lsmeans.

My question, does lsmeans take into account, whether I have repeated measured data (paired comparison) versus no repeated measures (unpaired comparison)? E.g., the time comparison should be paired, because I have data of one patient for different times. Same for therapy. Disease group however should not be paired, because a patient is either in group A or in group B.

  • $\begingroup$ If lsmeans has a procedure for the lmer object then it should. $\endgroup$ – user2974951 Dec 7 '18 at 8:46

Lsmeans is a summary of the MODEL, not the data. If the model is good, lsmeans does the right thing. If it is a bad model, lsmeans does the wrong thing


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.