s-news
[Top] [All Lists]

Re: lme coefficients question

To: "Douglas Bates" <bates@stat.wisc.edu>, "Fletcher, Thomas" <fletchert@umsl.edu>
Subject: Re: lme coefficients question
From: "Roberts, J. Kyle" <jkrobert@bcm.tmc.edu>
Date: Fri, 21 Jul 2006 12:37:28 -0500
Cc: <s-news@lists.biostat.wustl.edu>
In-reply-to: <40e66e0b0607211000q32e2ff56i4fa0a697eb095a6b@mail.gmail.com>
Thread-index: Acas5z9IPMHQxUx9SVG9ezEN81zxWwAAnShg
Thread-topic: [S] lme coefficients question
Thanks, Doug.  For some strange reason, I had initially read the documentation 
wrong and couldn't make sense of what I had.  When I checked the documentation 
again, I saw that coef.lme are "obtained by adding together the fixed effects 
estimates and the corresponding random effects estimates."  This
has the net effect of producing the fitted estimates of intercept and slope for 
each "group".  What the lme$coef produces are the random effects for each group 
when the fixed effects have been removed (or the effects are centered around 
zero).

Thanks for the help,
Kyle


***************************************
J. Kyle Roberts, Ph.D.
Baylor College of Medicine
Center for Educational Outreach
One Baylor Plaza, MS:  BCM411
Houston, TX   77030-3411
713-798-6672 - 713-798-8201 Fax
jkrobert@bcm.edu
***************************************

-----Original Message-----
From: dmbates@gmail.com [mailto:dmbates@gmail.com] On Behalf Of Douglas Bates
Sent: Friday, July 21, 2006 12:01 PM
To: Fletcher, Thomas
Cc: Roberts, J. Kyle; s-news@lists.biostat.wustl.edu
Subject: Re: [S] lme coefficients question

Both the result of the coef extractor function and the lme structure, which 
contains a "coefficients" attribute, are documented so why not check the 
documentation to see what they are intended to be?

At least in R (and, I assume, in S-PLUS although I don't have access to a copy 
of S-PLUS to be able to check) the documentation for lme method of the coef 
extractor is available as

?coef.lme

and the documentation for the lme class of objects returned by the lme function 
is available as

?lmeObject

There is no reason to assume that these results should be the same.

On 7/21/06, Fletcher, Thomas <fletchert@umsl.edu> wrote:
> It didn't occur to me that the two renderered different results until you 
> mentioned it. But, here's what I have been able to detect.
>
> lme.out$coef give the 'grand' intercept and the differences for each group 
> from that intercept (or other random effects). So, take the fixed effect for 
> the intercept (or other fixed effects) and then add the coef rendered from 
> lme.out$coef.
>
> On the other hand,
>
> coef(lme.out) gives the effects for all groups and all effects. So, the 
> difference is already computed.
>
> If you have model with random intercepts and 1 fixed predictor. coef(lme.out) 
> will still provide a value for each group for the fixed predictor that 
> doesn't change. It's fixed. lme.out$coef doesn't replicate this fixed effect. 
> It is presented only once.
>
> Again, I am not sure why this is the case. It just happens to be what I 
> noticed in a somewhat simple model.
>
> HTH
> Tom
>
>
>
> -------------------------------------------------
> Thomas D. Fletcher, PhD
> Assistant Professor
> Department of Psychology
> University of Missouri - St. Louis
> One University Boulevard
> St. Louis, MO 63121
> FletcherT@umsl.edu
>
> Phone: (314) 516-5467
> Fax:     (314) 516-5392
>
> www.umsl.edu/~fletchert
> -------------------------------------------------
>
> This message is for the designated recipient(s) only and may contain 
> privileged or confidential information.  If you received it in error, please 
> notify the sender immediately and delete the original.
>
> ________________________________
>
> From: s-news-owner@lists.biostat.wustl.edu on behalf of Roberts, J. 
> Kyle
> Sent: Fri 7/21/2006 11:01 AM
> To: s-news@lists.biostat.wustl.edu
> Subject: [S] lme coefficients question
>
>
> Dear All,
>
> I have a question about lme.  When I run:
> coef(lme.out)
>
> I get different results from when I run:
> lme.out$coef
>
> I know from my data that the coef(lme.out) contains the right values.  Can 
> anyone tell me what lme.out$coef is doing?
>
> ***************************************
> J. Kyle Roberts, Ph.D.
> Baylor College of Medicine
> Center for Educational Outreach
> One Baylor Plaza, MS:  BCM411
> Houston, TX   77030-3411
> 713-798-6672 - 713-798-8201 Fax
> jkrobert@bcm.edu
> ***************************************
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To 
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with 
> the BODY of the message:  unsubscribe s-news
>

<Prev in Thread] Current Thread [Next in Thread>