[R-sig-ME] How to pairwise comparisons with lsmeansLT

João C P Santiago joao.santiago at uni-tuebingen.de
Thu Feb 9 13:46:31 CET 2017


Hello everyone,

Last I used lsmeans from the lmerTest package one could simply

lsmeans(mod, pairwise ~ a | b)

and get a nice output with pairwise comparisons and adjusted p-values.

now it seems lsmeans is deprecated, replaced by lsmeansLT.

lsmeansLT(mod, test.effs = "a:b")

does not have the same output. Here my own output

> lsmeansLT(fit_linN, test.effs = "stageGroup:treatment")
Least Squares Means table:
                                         stageGroup treatment Estimate  
Standard Error   DF t-value Lower CI Upper CI p-value
stageGroup:treatment  Awake Control            1.0       1.0    44.75   
         10.00 27.7    4.48     24.3     65.2   1e-04 ***
stageGroup:treatment  REM Control              2.0       1.0    90.92   
          6.25 72.1   14.56     78.5    103.4  <2e-16 ***
stageGroup:treatment  S1/S2 Control            3.0       1.0   272.32   
          8.79 31.5   30.97    254.4    290.2  <2e-16 ***
stageGroup:treatment  SWS Control              4.0       1.0    86.62   
          8.44 33.2   10.27     69.5    103.8  <2e-16 ***
stageGroup:treatment  Awake Stimulation        1.0       2.0    52.15   
         10.00 27.7    5.22     31.7     72.6  <2e-16 ***
stageGroup:treatment  REM Stimulation          2.0       2.0    89.85   
          6.25 72.1   14.39     77.4    102.3  <2e-16 ***
stageGroup:treatment  S1/S2 Stimulation        3.0       2.0   265.82   
          8.79 31.5   30.24    247.9    283.7  <2e-16 ***
stageGroup:treatment  SWS Stimulation          4.0       2.0    86.40   
          8.44 33.2   10.24     69.2    103.6  <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

the interaction stageGroup:treatment is NOT significant, the plots  
show no signs of interaction. I think what is being tested here is  
wrong anyway. what I want is to test the differences in means between  
treatments in each stageGroup.
the former version of lsmeans would do this. for example lsmeans(mod,  
"treatment") would only tests the difference between treatments after  
adjusting for the other covariates.

Am I doing something wrong here?

Additionally: if this is not the way to go to obtain p-values from  
multiple comparisons (my peers want those values), is it "allowed" to  
perform multiple t-tests on the normal means? It's not the same  
though, no adjusment for the other covariates.

Best,
Santiago

-- 
João C. P. Santiago
Institute for Medical Psychology & Behavioral Neurobiology
Center of Integrative Neuroscience
University of Tuebingen
Otfried-Mueller-Str. 25
72076 Tuebingen, Germany

Phone: +49 7071 29 88981
Fax: +49 7071 29 25016



More information about the R-sig-mixed-models mailing list