[R] extracting p-values from lmer outputs

Martin Maechler maechler at stat.math.ethz.ch
Sat Mar 4 21:50:19 CET 2006


>>>>> "Lngmyers" == Lngmyers  <lngmyers at ccu.edu.tw>
>>>>>     on Sat, 04 Mar 2006 10:45:55 +0800 writes:

    Lngmyers> Thanks to Martin Maechler for the helpful
    Lngmyers> information below.

    Lngmyers> I guess I didn't make myself clear enough. I had
    Lngmyers> already discovered all them slots in lmer objects,
    Lngmyers> but these are apparently mostly input things or
    Lngmyers> things created in the course of the analysis, not
    Lngmyers> the output itself -- that is, it still takes work
    Lngmyers> to derive from them the text printed on the screen
    Lngmyers> when lmer is used. I am a mere mortal, not a
    Lngmyers> statistician.

    Lngmyers> The output of anova(lmerout) (where "lmerout" is a
    Lngmyers> lmer object) is an ordinary list, so the lines it
    Lngmyers> prints are easy to access, but this is not true of
    Lngmyers> lmerout itself. I didn't want anova(lmerout)
    Lngmyers> because, as MM said, certain key values have been
    Lngmyers> suppressed to avoid controversial.

    Lngmyers> However, the version of lmer currently available
    Lngmyers> on CRAN (lme4 0.995-2 2006-01-17 and Matrix
    Lngmyers> 0.995-5 2006-02-07) still gives p-values for GLMM.
    Lngmyers> I assumed that they weren't banned there because
    Lngmyers> they're calculated using z values, making DF
    Lngmyers> irrelevant. The datasets I'll be using always have
    Lngmyers> over 600 observations, so z values should work
    Lngmyers> fine.

that makes a lot of sense to me

    Lngmyers> So two questions:

    Lngmyers> (1) Are the fixed-effects p-values produced by
    Lngmyers> lmer for GLMM still considered to be valid, or
    Lngmyers> were they left in the last revision by mistake?
    Lngmyers> Should I give up on these p-values and test for
    Lngmyers> significance of each fixed effect by using
    Lngmyers> anova(full-model, model-minus-one-of-the-fixed-effects)?

I'd think the P-values are all fine 
but you (James) could try anyway and confirm that the anova()
results give +/- the same

    Lngmyers> (2) Assuming the p-values given by lmer for GLMM
    Lngmyers> are valid, is there any easy way to derive them
    Lngmyers> from a lmer object? Thanks to MM's tip, I looked
    Lngmyers> more closely and found the estimates for the fixed
    Lngmyers> effects, but I don't see standard errors or z
    Lngmyers> values. They must be readily calculable 

"readily calculable" indeed:  If you type
   
   selectMethod("show", "lmer")

you see the function which is called when a "lmer" object is printed
{since S4 objects are printed by show(), not print() }.
When you start looking at it, you may reconsider the word "readily"  :-)

    Lngmyers> from what's in the lmer object, but I'm too ignorant to
    Lngmyers> figure it out myself.

The current setup will be improved soon (within 2 weeks).
Doug Bates and I are currently improving the documentation of
lmer objects and the methods you can apply and also plan to make
summary(<lmer>) return a new object which contains many more
useful parts, typically those that you now see when the <lmer>
object is printed. 

Martin Maechler, ETH Zurich




More information about the R-help mailing list