[R] lsmeans

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sun Jun 8 21:12:56 CEST 2008


Douglas Bates wrote:
> On 6/7/08, John Fox <jfox at mcmaster.ca> wrote:
>> Dear Dieter,
>>
>>  I don't know whether I qualify as a "master," but here's my brief take on
>>  the subject: First, I dislike the term "least-squares means," which seems to
>>  me like nonsense. Second, what I prefer to call "effect displays" are just
>>  judiciously chosen regions of the response surface of a model, meant to
>>  clarify effects in complex models. For example, a two-way interaction is
>>  displayed by absorbing the constant and main-effect terms in the interaction
>>  (more generally, absorbing terms marginal to a particular term) and setting
>>  other terms to typical values. A table or graph of the resulting fitted
>>  values is, I would argue, easier to grasp than the coefficients, the
>>  interpretation of which can entail complicated mental arithmetic.
> 
> I like that explanation, John.
> 
> As I'm sure you are aware, the key phrase in what you wrote is
> "setting other terms to typical values".  That is, these are
> conditional cell means, yet they are almost universally misunderstood
> - even by statisticians who should know better - to be marginal cell
> means.  A more subtle aspect of that phrase is the interpretation of
> "typical".  The user is not required to specify these typical values -
> they are calculated from the observed data.
> 
> If there are no interactions with the "other terms" and if the values
> chosen for those other terms based on the observed data are indeed
> typical of the values for which we wish to make inferences with the
> model then these conditional cell means may tell us something about
> the marginal cell means.  But if either of those conditions fails then
> these conditional means can be very different from the marginal means.

Well put Doug.  I would add another condition, which I don't know how to 
state precisely.  The settings for the other terms, which are usually 
marginal medians, modes, or means, must make sense when considered 
jointly.  Frequently when all adjustment covariates are set to overall 
marginal means the resulting "subject" is very atypical.

To me much of the problem is solved one one develops a liking for 
predicted values and differences in them.

Frank

> 
> I wouldn't have any problem at all with providing conditional cell
> means, especially if the user were required to specify the values at
> which to fix the other terms in the model, but that is not what people
> think they are getting.  I don't want to encourage them in their
> delusions by letting them think i can evaluate marginal cell means as
> a single, conditional evaluation.
> 
>>  > -----Original Message-----
>>  > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
>>  On
>>  > Behalf Of Dieter Menne
>>  > Sent: June-07-08 4:36 AM
>>  > To: r-help at stat.math.ethz.ch
>>  > Subject: Re: [R] lsmeans
>>  >
>>  > John Fox <jfox <at> mcmaster.ca> writes:
>>  >
>>  > > I intend at some point to extend the effects package to linear and
>>  > > generalized linear mixed-effects models, probably using lmer() rather
>>  > > than lme(), but as you discovered, it doesn't handle these models now.
>>  > >
>>  > > It wouldn't be hard, however, to do the computations yourself, using
>>  > > the coefficient vector for the fixed effects and a suitably constructed
>>  > > model-matrix to compute the effects; you could also get standard errors
>>  > > by using the covariance matrix for the fixed effects.
>>  > >
>>  >
>>  > >> Douglas Bates:
>>  > https://stat.ethz.ch/pipermail/r-sig-mixed-models/2007q2/000222.html
>>  > >>
>>  > My big problem with lsmeans is
>>  > that I have never been able to understand how they should be
>>  > calculated and, more importantly, why one should want to calculate
>>  > them.  In other words, what do lsmeans represent and why should I be
>>  > interested in these particular values?
>>  > >>
>>  >
>>  > Truly Confused, torn apart by the Masters
>>  >
>>  > Dieter
>>  >
>>  > ______________________________________________
>>  > R-help at r-project.org mailing list
>>  > https://stat.ethz.ch/mailman/listinfo/r-help
>>  > PLEASE do read the posting guide
>>  http://www.R-project.org/posting-guide.html
>>  > and provide commented, minimal, self-contained, reproducible code.
>>
>>  ______________________________________________
>>  R-help at r-project.org mailing list
>>  https://stat.ethz.ch/mailman/listinfo/r-help
>>  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>  and provide commented, minimal, self-contained, reproducible code.
>>
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list