[R-sig-ME] lme and lmer degrees of freedom (and hence p values) from don't agree . . . Why?????????

Jake Westfall jake987722 at hotmail.com
Tue Jul 7 18:34:12 CEST 2015


Hi John,

lmer does not use or report degrees of freedom on its own. It appears that you are getting degrees of freedom from the lmerTest package. Just for future reference.

The degrees of freedom from lme are based on an inner-outer rule that is described here: https://books.google.com/books?id=3TVDAAAAQBAJ&lpg=PR1&dq=pinheiro%20bates&pg=PA91#v=onepage&q&f=false

The degrees of freedom from lmerTest are based on Satterthwaite's approximation, described here: https://en.wikipedia.org/wiki/Welch%E2%80%93Satterthwaite_equation

It looks like the "Amp" predictor is being treated by the models as a numeric, but you said it represents 5 experimental conditions? Should it not be a factor then?

Jake

> Date: Tue, 7 Jul 2015 12:08:13 -0400
> From: JSorkin at grecc.umaryland.edu
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] lme and lmer degrees of freedom (and hence p values) from don't agree . . . Why?????????
> 
> I am posting this message to this list (after posting to R help) at the
> suggestion of Bert Gunter.
>  
> I am trying to fit data from 23 subjects using random effects
> regression, and am comparing the results of lme and lmer. The point
> estimates and the SEs are the same in both models, however the degrees
> of freedom are widely different. lme reports 88 DF, lmer approximately
> 22. Can someone help me understand why the DFs are not the same? I have
> 23 subjects, each of whom is studied in up to five different
> experimental conditions (i.e. Amp). For each condition multiple
> measurements are made for each subject (i.e. X).
> Thank you,
> John
>  
>  
> 
> # lme: Random intercept, random slope.
> cat("********This analysis has 88 degrees of freedom\n")
> fit0X.new <- groupedData(X~Amp|SS,data=data,order.groups=FALSE)
> xx <- lme(fit0X.new,random=~1+Amp)
> summary(xx)
> cat("\n\n")
>  
>  
> # lmer: Random intercept, random slope.
> cat("*********This analysis has ~22 degrees of freedom\n")
> fit0X <- lmer(X~Amp+(1+Amp|SS),data=data)
> print(summary(fit0X))
> fit0XSum<-summary(fit0X)$coefficients
>  
>  
>  
> ********This analysis has 88 degrees of freedom
> Linear mixed-effects model fit by REML
>  Data: fit0X.new 
>        AIC      BIC    logLik
>   331.7688 347.9717 -159.8844
> Random effects:
>  Formula: ~1 + Amp | SS
>  Structure: General positive-definite, Log-Cholesky parametrization
>             StdDev    Corr  
> (Intercept) 1.3515911 (Intr)
> Amp         2.5619953 -0.366
> Residual    0.6139429       
> Fixed effects: X ~ Amp 
>                Value Std.Error DF   t-value p-value
> (Intercept) 1.718376 0.3609133 88  4.761188       0
> Amp         6.890429 0.5978236 88 11.525856       0
>  Correlation: 
>     (Intr)
> Amp -0.526
> Standardized Within-Group Residuals:
>        Min         Q1        Med         Q3        Max 
> -2.2177007 -0.5770388 -0.1249565  0.5247444  4.1150164 
> Number of Observations: 112
> Number of Groups: 23 
> 
> *********This analysis has ~22 degrees of freedom
> Linear mixed model fit by REML t-tests use Satterthwaite approximations
> to degrees of freedom [merModLmerTest]
> Formula: X ~ Amp + (1 + Amp | SS)
>    Data: data
> REML criterion at convergence: 319.8
> Scaled residuals: 
>     Min      1Q  Median      3Q     Max 
> -2.2177 -0.5770 -0.1250  0.5247  4.1150 
> Random effects:
>  Groups   Name        Variance Std.Dev. Corr 
>  SS       (Intercept) 1.8268   1.3516        
>           Amp         6.5638   2.5620   -0.37
>  Residual             0.3769   0.6139        
> Number of obs: 112, groups:  SS, 23
> Fixed effects:
>             Estimate Std. Error      df t value Pr(>|t|)    
> (Intercept)   1.7184     0.3609 21.1150   4.761 0.000104 ***
> Amp           6.8904     0.5978 22.0460  11.526 8.37e-11 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> Correlation of Fixed Effects:
>     (Intr)
> Amp -0.526
> 
> 
> 
> 
> 
> 
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing) 
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing) 
> 
> Confidentiality Statement:
> This email message, including any attachments, is for ...{{dropped:12}}



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