Re: [R] LSmeans and lsmeans

2018-02-13 Thread Pius Mwansa
Thanks Bert.

 

From: Bert Gunter [mailto:bgunter.4...@gmail.com] 
Sent: Tuesday, February 13, 2018 4:42 PM
To: Pius Mwansa <pmwa...@shaw.ca>
Cc: R-help <r-help@r-project.org>
Subject: Re: [R] LSmeans and lsmeans

 

A cursory reading indicates that they are identical; but others more 
knowledgeable than I need to confirm or deny this.

-- Bert






Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

 

On Tue, Feb 13, 2018 at 3:38 PM, Pius Mwansa <pmwa...@shaw.ca 
<mailto:pmwa...@shaw.ca> > wrote:

It is in the doBy package.

 

Thanks

 

From: Bert Gunter [mailto:bgunter.4...@gmail.com 
<mailto:bgunter.4...@gmail.com> ] 
Sent: Tuesday, February 13, 2018 4:32 PM


To: Pius Mwansa <pmwa...@shaw.ca <mailto:pmwa...@shaw.ca> >
Cc: R-help <r-help@r-project.org <mailto:r-help@r-project.org> >
Subject: Re: [R] LSmeans and lsmeans

 

Always cc the list unless there is good reason to keep your reply private.

There is no LSmeans() function in the lsmeans package.

Cheers,

Bert




Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

 

On Tue, Feb 13, 2018 at 3:20 PM, Pius Mwansa <pmwa...@shaw.ca 
<mailto:pmwa...@shaw.ca> > wrote:

They are in the lsmeans package.

 

Pius

 

From: Bert Gunter [mailto:bgunter.4...@gmail.com 
<mailto:bgunter.4...@gmail.com> ] 
Sent: Tuesday, February 13, 2018 4:16 PM
To: Pius Mwansa <pmwa...@shaw.ca <mailto:pmwa...@shaw.ca> >
Cc: R-help <r-help@r-project.org <mailto:r-help@r-project.org> >
Subject: Re: [R] LSmeans and lsmeans

 

In what packages?

-- Bert




Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

 

On Tue, Feb 13, 2018 at 11:17 AM, Pius Mwansa <pmwa...@shaw.ca 
<mailto:pmwa...@shaw.ca> > wrote:

Is there a difference between LSmeans and lsmeans functions in R?

Thanks,

Pius

__
R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To 
UNSUBSCRIBE and more, see
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.








[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] LSmeans and lsmeans

2018-02-13 Thread Pius Mwansa
It is in the doBy package.

 

Thanks

 

From: Bert Gunter [mailto:bgunter.4...@gmail.com] 
Sent: Tuesday, February 13, 2018 4:32 PM
To: Pius Mwansa <pmwa...@shaw.ca>
Cc: R-help <r-help@r-project.org>
Subject: Re: [R] LSmeans and lsmeans

 

Always cc the list unless there is good reason to keep your reply private.

There is no LSmeans() function in the lsmeans package.

Cheers,

Bert






Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

 

On Tue, Feb 13, 2018 at 3:20 PM, Pius Mwansa <pmwa...@shaw.ca 
<mailto:pmwa...@shaw.ca> > wrote:

They are in the lsmeans package.

 

Pius

 

From: Bert Gunter [mailto:bgunter.4...@gmail.com 
<mailto:bgunter.4...@gmail.com> ] 
Sent: Tuesday, February 13, 2018 4:16 PM
To: Pius Mwansa <pmwa...@shaw.ca <mailto:pmwa...@shaw.ca> >
Cc: R-help <r-help@r-project.org <mailto:r-help@r-project.org> >
Subject: Re: [R] LSmeans and lsmeans

 

In what packages?

-- Bert




Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

 

On Tue, Feb 13, 2018 at 11:17 AM, Pius Mwansa <pmwa...@shaw.ca 
<mailto:pmwa...@shaw.ca> > wrote:

Is there a difference between LSmeans and lsmeans functions in R?

Thanks,

Pius

__
R-help@r-project.org <mailto:R-help@r-project.org>  mailing list -- To 
UNSUBSCRIBE and more, see
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.






[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] LSmeans and lsmeans

2018-02-13 Thread Bert Gunter
A cursory reading indicates that they are identical; but others more
knowledgeable than I need to confirm or deny this.

-- Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Feb 13, 2018 at 3:38 PM, Pius Mwansa <pmwa...@shaw.ca> wrote:

> It is in the doBy package.
>
>
>
> Thanks
>
>
>
> *From:* Bert Gunter [mailto:bgunter.4...@gmail.com]
> *Sent:* Tuesday, February 13, 2018 4:32 PM
>
> *To:* Pius Mwansa <pmwa...@shaw.ca>
> *Cc:* R-help <r-help@r-project.org>
> *Subject:* Re: [R] LSmeans and lsmeans
>
>
>
> Always cc the list unless there is good reason to keep your reply private.
>
> There is no LSmeans() function in the lsmeans package.
>
> Cheers,
>
> Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>
> On Tue, Feb 13, 2018 at 3:20 PM, Pius Mwansa <pmwa...@shaw.ca> wrote:
>
> They are in the lsmeans package.
>
>
>
> Pius
>
>
>
> *From:* Bert Gunter [mailto:bgunter.4...@gmail.com]
> *Sent:* Tuesday, February 13, 2018 4:16 PM
> *To:* Pius Mwansa <pmwa...@shaw.ca>
> *Cc:* R-help <r-help@r-project.org>
> *Subject:* Re: [R] LSmeans and lsmeans
>
>
>
> In what packages?
>
> -- Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>
> On Tue, Feb 13, 2018 at 11:17 AM, Pius Mwansa <pmwa...@shaw.ca> wrote:
>
> Is there a difference between LSmeans and lsmeans functions in R?
>
> Thanks,
>
> Pius
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>
>
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] LSmeans and lsmeans

2018-02-13 Thread Bert Gunter
Always cc the list unless there is good reason to keep your reply private.

There is no LSmeans() function in the lsmeans package.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Feb 13, 2018 at 3:20 PM, Pius Mwansa <pmwa...@shaw.ca> wrote:

> They are in the lsmeans package.
>
>
>
> Pius
>
>
>
> *From:* Bert Gunter [mailto:bgunter.4...@gmail.com]
> *Sent:* Tuesday, February 13, 2018 4:16 PM
> *To:* Pius Mwansa <pmwa...@shaw.ca>
> *Cc:* R-help <r-help@r-project.org>
> *Subject:* Re: [R] LSmeans and lsmeans
>
>
>
> In what packages?
>
> -- Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>
> On Tue, Feb 13, 2018 at 11:17 AM, Pius Mwansa <pmwa...@shaw.ca> wrote:
>
> Is there a difference between LSmeans and lsmeans functions in R?
>
> Thanks,
>
> Pius
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] LSmeans and lsmeans

2018-02-13 Thread Bert Gunter
In what packages?

-- Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Feb 13, 2018 at 11:17 AM, Pius Mwansa  wrote:

> Is there a difference between LSmeans and lsmeans functions in R?
>
> Thanks,
>
> Pius
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] LSmeans and lsmeans

2018-02-13 Thread Pius Mwansa
Is there a difference between LSmeans and lsmeans functions in R?

Thanks,

Pius

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] ..lsmeans and coxme..

2015-05-28 Thread Matthias Kuhn
Dear list-eners,

I run into the following problem when I want to get contrasts from a coxme
model using the lsmeans package: A call to lsmeans on the coxme model
throws the following error:

Error in if (adjustSigma  object$method == ML) V = V *
object$dims$N/(object$dims$N -  :
  missing value where TRUE/FALSE needed


I give an example:


library(coxme)
library(lsmeans)

fm - coxme(Surv(y, uncens) ~ trt + (trt | center) + strata(center),
data=eortc)
summary(fm)

lsmeans(fm, ~ trt)



traceback points to the internal function lsmeans:::lsm.basis.lme()

Any ideas?

Thanks in advance.

-m

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] lsmeans in R

2009-03-11 Thread suman Duvvuru
I need help with calculating lsmeans (adjusted means) of different terms in
a linear model including the main effect and the interaction effect terms. I
use lm to run the linear models...I previously noted from literature that
that effects package can be used to generate lsmeans. But I tried to use
it but could not figure out which option to use to get means. If anyone can
give an example of how to get lsmeans using lm object, that will very
helpful.

Thanks,
SUman

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] lsmeans in R

2009-03-11 Thread Chuck Cleland
On 3/11/2009 2:45 AM, suman Duvvuru wrote:
 I need help with calculating lsmeans (adjusted means) of different terms in
 a linear model including the main effect and the interaction effect terms. I
 use lm to run the linear models...I previously noted from literature that
 that effects package can be used to generate lsmeans. But I tried to use
 it but could not figure out which option to use to get means. If anyone can
 give an example of how to get lsmeans using lm object, that will very
 helpful.

  This R-help thread from March 2007 should help:

http://finzi.psych.upenn.edu/R/Rhelp02/archive/95809.html

 Thanks,
 SUman
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@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.


Re: [R] lsmeans in R

2009-03-11 Thread John Fox
Dear Suman,

Chuck Cleland has already pointed you toward a reasonably complete
discussion of the topic (thank you Chuck). To update my contribution to that
discussion, the effects package now uses t-intervals for models with an
estimated dispersion parameter (such as linear models) and will create
displays for multinomial and proportional-odds logit models. (The latter
isn't relevant to your intended application, of course.)

Beyond that, I don't quite understand your question. Adjusted means are
fitted values, and this is what the effects package gives you for linear
models. Maybe you could explain in more detail what it is that you want and
why you think that you're not getting it.

Regards,
 John


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
 Behalf Of suman Duvvuru
 Sent: March-11-09 2:45 AM
 To: r-help@r-project.org
 Subject: [R] lsmeans in R
 
 I need help with calculating lsmeans (adjusted means) of different terms
in
 a linear model including the main effect and the interaction effect terms.
I
 use lm to run the linear models...I previously noted from literature that
 that effects package can be used to generate lsmeans. But I tried to use
 it but could not figure out which option to use to get means. If anyone
can
 give an example of how to get lsmeans using lm object, that will very
 helpful.
 
 Thanks,
 SUman
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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@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.


Re: [R] lsmeans

2008-09-26 Thread Nutter, Benjamin
I hope you'll forgive me for resurrecting this thread.  My question
refers to John Fox's comments in the discussion of lsmeans from 
https://stat.ethz.ch/pipermail/r-help/2008-June/164106.html

John you said, 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.

I've been able to make use of all of that except for the 'suitably
constructed model-matrix' part.  I've looked through some other threads
on this topic, but am still a little in the dark as to what I'd need to
do to construct a suitable matrix.

I would like to use the least squares means to develop parameter
estimates for a parametric ROC analysis, as described by Mithat Gonen's
book (Analyzing Receiver Operating Characteristic Curves with SAS,
2007).  

Any suggestions on references that would explain how to go about
constructing the suitable model matrix?  

Many Thanks
Benjamin


P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News  World Report (2008).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use\...{{dropped:13}}

__
R-help@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.


Re: [R] lsmeans

2008-09-26 Thread John Fox
Dear Benjamin,

In the absence of interactions, a suitably constructed model matrix could,
for example, allow one predictor to range over its values while others are
held to typical values (such as means). The effects package does this for
linear and generalized linear models (and soon for proportional-odds and
multinomial-logit models), and produces reasonable displays when there are
interactions and other complex terms (such as regression splines or
polynomials) in a model, but it doesn't have methods for mixed-effects
models or survival-regression models. 

I hope this helps,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
 Behalf Of Nutter, Benjamin
 Sent: September-26-08 3:48 PM
 To: r-help@r-project.org
 Subject: Re: [R] lsmeans
 
 I hope you'll forgive me for resurrecting this thread.  My question
 refers to John Fox's comments in the discussion of lsmeans from
 https://stat.ethz.ch/pipermail/r-help/2008-June/164106.html
 
 John you said, 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.
 
 I've been able to make use of all of that except for the 'suitably
 constructed model-matrix' part.  I've looked through some other threads
 on this topic, but am still a little in the dark as to what I'd need to
 do to construct a suitable matrix.
 
 I would like to use the least squares means to develop parameter
 estimates for a parametric ROC analysis, as described by Mithat Gonen's
 book (Analyzing Receiver Operating Characteristic Curves with SAS,
 2007).
 
 Any suggestions on references that would explain how to go about
 constructing the suitable model matrix?
 
 Many Thanks
 Benjamin
 
 
 P Please consider the environment before printing this e-mail
 
 Cleveland Clinic is ranked one of the top hospitals
 in America by U.S. News  World Report (2008).
 Visit us online at http://www.clevelandclinic.org for
 a complete listing of our services, staff and
 locations.
 
 
 Confidentiality Note:  This message is intended for use\...{{dropped:13}}
 
 __
 R-help@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@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.


Re: [R] lsmeans

2008-06-09 Thread Dieter Menne
John Fox jfox at mcmaster.ca writes:

 Actually, the effects package does exactly what you suggest for continuous
 predictors.

But not for lme.

Dieter

__
R-help@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.


Re: [R] lsmeans

2008-06-08 Thread Douglas Bates
On 6/7/08, John Fox [EMAIL PROTECTED] 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.

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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  On
   Behalf Of Dieter Menne
   Sent: June-07-08 4:36 AM
   To: [EMAIL PROTECTED]
   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@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@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@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.


Re: [R] lsmeans

2008-06-08 Thread hadley wickham
On Sun, Jun 8, 2008 at 12:58 PM, Douglas Bates [EMAIL PROTECTED] wrote:
 On 6/7/08, John Fox [EMAIL PROTECTED] 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.


How does Searle's population marginal means fit in to this?  The
paper describes a PMM as expected value of an observed marginal mean
as if there were one observation in every cell. - which was what I
thought happened in the effects display.  Is this a subtly on the
definition of typical, or is that PMM's are only described for pure
ANOVA's (i.e. no continuous variables in model)?

Hadley

-- 
http://had.co.nz/

__
R-help@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.


Re: [R] lsmeans

2008-06-08 Thread John Fox
Dear Doug,

Your point is correct, of course, but if people are interested in computing
marginal means (or marginal cell means), then they can do so simply and
don't need a statistical model. I think that when such a model is fit,
interest is typically in conditioning on the other explanatory variables.

(Also see my responses to Hadley and Frank's points.)

Regards,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
 Behalf Of Douglas Bates
 Sent: June-08-08 1:58 PM
 To: John Fox
 Cc: Dieter Menne; [EMAIL PROTECTED]
 Subject: Re: [R] lsmeans
 
 On 6/7/08, John Fox [EMAIL PROTECTED] 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.
 
 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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
   On
Behalf Of Dieter Menne
Sent: June-07-08 4:36 AM
To: [EMAIL PROTECTED]
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@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@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@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

Re: [R] lsmeans

2008-06-08 Thread John Fox
Dear Hadley,

Unfortunately, the term marginal gets used in two quite different ways,
and Searle's population marginal means would, I believe, be more clearly
called population conditional means or population partial means. This is
more or less alternative terminology for least-squares means (to which
Searle rightly objects).

Regards,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


 -Original Message-
 From: hadley wickham [mailto:[EMAIL PROTECTED]
 Sent: June-08-08 2:52 PM
 To: Douglas Bates
 Cc: John Fox; Dieter Menne; [EMAIL PROTECTED]
 Subject: Re: [R] lsmeans
 
 On Sun, Jun 8, 2008 at 12:58 PM, Douglas Bates [EMAIL PROTECTED]
wrote:
  On 6/7/08, John Fox [EMAIL PROTECTED] 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.
 
 
 How does Searle's population marginal means fit in to this?  The
 paper describes a PMM as expected value of an observed marginal mean
 as if there were one observation in every cell. - which was what I
 thought happened in the effects display.  Is this a subtly on the
 definition of typical, or is that PMM's are only described for pure
 ANOVA's (i.e. no continuous variables in model)?
 
 Hadley
 
 --
 http://had.co.nz/

__
R-help@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.


Re: [R] lsmeans

2008-06-08 Thread hadley wickham
 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.

Maybe I'm still misunderstanding, but isn't that exactly what effects
displays are?  They're just some way to allow you to say, I'm
interested in variables x, y and z, and I don't really care about the
other variables in the model - what are some typical predictions?

The effects package implements this idea for categorical x, y, and z,
but the basic idea remains the same for continuous variables - except
instead of using all the levels of the factor, you'd use a grid within
the range of the data.

Hadley


-- 
http://had.co.nz/

__
R-help@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.


Re: [R] lsmeans

2008-06-08 Thread John Fox
Dear Hadley,

Actually, the effects package does exactly what you suggest for continuous
predictors.

Regards,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
 Behalf Of hadley wickham
 Sent: June-08-08 3:48 PM
 To: Frank E Harrell Jr
 Cc: John Fox; Douglas Bates; [EMAIL PROTECTED]; Dieter Menne
 Subject: Re: [R] lsmeans
 
  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.
 
 Maybe I'm still misunderstanding, but isn't that exactly what effects
 displays are?  They're just some way to allow you to say, I'm
 interested in variables x, y and z, and I don't really care about the
 other variables in the model - what are some typical predictions?
 
 The effects package implements this idea for categorical x, y, and z,
 but the basic idea remains the same for continuous variables - except
 instead of using all the levels of the factor, you'd use a grid within
 the range of the data.
 
 Hadley
 
 
 --
 http://had.co.nz/
 
 __
 R-help@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@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.


Re: [R] lsmeans

2008-06-07 Thread Dieter Menne
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@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.


Re: [R] lsmeans

2008-06-07 Thread John Fox
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.

Regards,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
 Behalf Of Dieter Menne
 Sent: June-07-08 4:36 AM
 To: [EMAIL PROTECTED]
 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@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@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.


Re: [R] lsmeans

2008-06-07 Thread hadley wickham
On Sat, Jun 7, 2008 at 3:02 PM, John Fox [EMAIL PROTECTED] 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.

The other advantage is that the effects values are on the same scale
as the original data, and it can be useful to supplement the pure
effects with the original data.

Hadley

-- 
http://had.co.nz/

__
R-help@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] lsmeans

2008-06-06 Thread Dani Valverde

Hello,
I have the next function call:

lme(fixed=Error ~ Temperature * Tumour ,random = ~1|ID, data=error_DB)

which returns an lme object. I am interested on carrying out some kind 
of lsmeans on the data returned, but I cannot find any function to do 
this in R. I'have seen the effect() function, but it does not work with 
lme objects. Any idea?


Best,

Dani

--
Daniel Valverde Saubí

Grup de Biologia Molecular de Llevats
Facultat de Veterinària de la Universitat Autònoma de Barcelona
Edifici V, Campus UAB
08193 Cerdanyola del Vallès- SPAIN

Centro de Investigación Biomédica en Red
en Bioingeniería, Biomateriales y
Nanomedicina (CIBER-BBN)

Grup d'Aplicacions Biomèdiques de la RMN
Facultat de Biociències
Universitat Autònoma de Barcelona
Edifici Cs, Campus UAB
08193 Cerdanyola del Vallès- SPAIN
+34 93 5814126

__
R-help@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.


Re: [R] lsmeans

2008-06-06 Thread John Fox
Dear Dani,

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.

I hope this helps,
 John

On Fri, 06 Jun 2008 17:05:58 +0200
 Dani Valverde [EMAIL PROTECTED] wrote:
 Hello,
 I have the next function call:
 
 lme(fixed=Error ~ Temperature * Tumour ,random = ~1|ID,
 data=error_DB)
 
 which returns an lme object. I am interested on carrying out some
 kind of lsmeans on the data returned, but I cannot find any function
 to do this in R. I'have seen the effect() function, but it does not
 work with lme objects. Any idea?
 
 Best,
 
 Dani
 
 -- 
 Daniel Valverde Saubí
 
 Grup de Biologia Molecular de Llevats
 Facultat de Veterinària de la Universitat Autònoma de Barcelona
 Edifici V, Campus UAB
 08193 Cerdanyola del Vallès- SPAIN
 
 Centro de Investigación Biomédica en Red
 en Bioingeniería, Biomateriales y
 Nanomedicina (CIBER-BBN)
 
 Grup d'Aplicacions Biomèdiques de la RMN
 Facultat de Biociències
 Universitat Autònoma de Barcelona
 Edifici Cs, Campus UAB
 08193 Cerdanyola del Vallès- SPAIN
 +34 93 5814126
 
 __
 R-help@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.


John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

__
R-help@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.