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

João C P Santiago joao.santiago at uni-tuebingen.de
Fri Feb 10 16:17:40 CET 2017


d'oh.. thank you Russel! now it works. I guess then the lmerTest  
simply does not do pairwise comparisons and I'm not doing anything  
wrong?


Thanks
Santiago

Quoting "Lenth, Russell V" <russell-lenth at uiowa.edu>:

> The interface style you mention is for the 'lsmeans' function in the  
> *lsmeans* package. The developers of the *lmerTest* package renamed  
> their 'lsmeans' function 'lsmeansLT' to help avoid confusion.
>
> Russ
>
> Russell V. Lenth  -  Professor Emeritus
> Department of Statistics and Actuarial Science  
> The University of Iowa  -  Iowa City, IA 52242  USA  
> Voice (319)335-0712 (Dept. office)  -  FAX (319)335-3017
>
>
>
> Message: 1
> Date: Thu, 09 Feb 2017 13:46:31 +0100
> From: Jo?o C P Santiago <joao.santiago at uni-tuebingen.de>
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] How to pairwise comparisons with lsmeansLT
> Message-ID:
> 	<20170209134631.Horde.DnanEC4xDkyQa7A8g5pMG6F at webmail.uni-tuebingen.de>
>
> Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
>
> 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



-- 
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