[R-sig-ME] Extracting p-values from an lme object (any help would be appreciated)

Adam D. I. Kramer adik at ilovebacon.org
Wed Nov 25 19:43:10 CET 2009


On Wed, 25 Nov 2009, Ben Bolker wrote:

> Ben Zuckerberg wrote:
>> I know that p-value estimation in mixed models are somewhat
>> controversial at the moment, but I am simply curious how one extracts
>> p-values for the fixed factors from an lme object (using nlme)? The
>> summary() gives the desired p-values; all I want to do is access them.
>> The names() command shows the returned values (e.g., fitted, residuals)
>> for many components of the model, but I can't seem to access the
>> p-values.  Thank you in advance!
>>
>
> library(nlme)
> example(lme)
> summary(fm1)$tTable[,"p-value"]

Or perhaps more simply,

pt(t, df, lower.tail)

gives you the p-value associated with a given t-value and its degrees of
freedom. lower.tail is whether you want the p below the t-value (usually you
want this when p is negative), or above. Multiply by 2 for a 2-tailed test.

summary() is almost certainly just calling pt().

--Adam




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