Skip to content

extractor function for coefficient table from summary.mer ?

7 messages · Douglas Bates, David Duffy, Ben Bolker

#
Request for comment: would it be reasonable to have the
"coef" method for "summary.mer" objects return the table
of parameter values, standard errors etc.?  This is parallel
to what (e.g.) coef does for summary.lm objects (in that
case by extracting the $coefficients element of the list) ...
I feel I should minimize my using of direct slot extraction
via @ ...

library(lme4)

setMethod("coef", signature(object = "summary.mer"), function(object)
object at coefs)

example(lmer)
ss <- summary(gm1)
coef(ss)

              Estimate Std. Error   z value     Pr(>|z|)
(Intercept) -1.3985351  0.2278906 -6.136871 8.416284e-10
period2     -0.9923347  0.3053852 -3.249452 1.156274e-03
period3     -1.1286754  0.3260491 -3.461673 5.368286e-04
period4     -1.5803739  0.4288037 -3.685542 2.282169e-04
#
On Tue, 2 Jun 2009, Ben Bolker wrote:

            
Yes please, oh and a profile likelihood based confint.lmer() too,
thanks ;).

David Duffy.

--
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v
#
On Tue, Jun 2, 2009 at 8:23 PM, Ben Bolker <bolker at ufl.edu> wrote:

            
Very good idea thanks.  I will add it to the next release.
14 days later
#
On Tue, Jun 2, 2009 at 10:05 PM, David Duffy<David.Duffy at qimr.edu.au> wrote:
I have been thinking about this recently and I have a way of
constructing a profile likelihood for the variance component
parameters.  Are those the parameters that are of interest or are you
more interested in the fixed-effects parameters?

The enclosed plots are from the simple random-effects model fit to the
Dyestuff data in the lme4 package.

Part of my purpose in producing such plots is to show why quoting an
estimate of a variance and a standard error for the estimate is not a
very reasonable summary.  In introductory courses we teach that a
confidence interval on the population variance based on the mythical
i.i.d. sample from a Gaussian population would be constructed from the
chi-squared distribution and would be quite asymmetric in most cases.
Yet somehow the variability in estimates of variance components in
much more complicated models can be expressed by quoting a standard
error.  As shown here, the variability is not at all symmetric.  For
the residual variance term the profiled likelihood is approximately
symmetric when considering the logarithm of the variance (or,
equivalently, the logarithm of the standard error) but even that is
inadequate for other variance components that could feasibly be zero.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro-devcontoursfm1.pdf
Type: application/pdf
Size: 48517 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090617/e28a3867/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro-profileddevfm1.pdf
Type: application/pdf
Size: 8096 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090617/e28a3867/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro-profileddevsqfm1.pdf
Type: application/pdf
Size: 8002 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090617/e28a3867/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro-profzfm1.pdf
Type: application/pdf
Size: 8217 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20090617/e28a3867/attachment-0003.pdf>
#
On Wed, 17 Jun 2009, Douglas Bates wrote:

            
Yes, the variance components are of direct interest.
Yes, we usually try and produce appropriate confidence intervals and/or 
interpretable likelihood based test statistics.  The latter, of course, 
are tricky mixtures for multivariate hypotheses -- a typical one for us is 
a variance components linkage analysis test that the common component due 
a particular genome region is zero for three measures (repeated at 3 
occasions, but with differing contributions by occasion).  People still 
want a P-value, so they can carry out adjustment for genome-wide testing 
(linkage is supposed to be roughly equivalent to 50-60 tests for a human 
length genome, but the genome-wide corrected 5% P-value is usually quoted 
as 2e-5).

Cheers, David Duffy.
#
David Duffy wrote:
Fixed effect profiles are interesting too (to me) ... I have written
some of my own code to do this (happy to make it available), but it's
not very general/robust at the moment.
#
On Wed, Jun 17, 2009 at 4:59 PM, Ben Bolker<bolker at ufl.edu> wrote:
I think there is a general way of creating the profiles including with
respect to the fixed-effects parameters but, as always, the devil is
in the details.  I have already tripped up on the simplest case of
models like

lmer(Yield ~ 1 + (1|Batch), Dyestuff)

When you condition on the value of the one and only fixed-effects
parameter the code for the penalized least squares solution becomes
confused because the reduced model matrix for the fixed effects has
zero columns.