[R-sig-ME] lsmeans for multiple response variables

Ben Bolker bbolker at gmail.com
Sun Mar 30 17:29:31 CEST 2014


On 14-03-30 12:47 AM, Paul Tanger wrote:
> Hi,
> Not sure this is the best place to ask since I'm fitting a fixed effect
> model.. please advise if there is a better forum..
> I'm trying to get lsmeans for a set of response variables, but I'm getting
> this error and I can't figure out how to get it working.. it just spits out
> the lsmeans for the first response.
> Here is an example:

  The short answers are that (1) this is indeed not a mixed-model question;
try r-help at r-project.org or Stack Overflow (2) you may not be aware that
you're fitting two separate linear models here --  from ?lm

   If ‘response’ is a matrix a linear model is fitted separately by
     least-squares to each column of the matrix.

This is a relatively less-used feature, so presumably lsmeans()
doesn't expect it.  You could fit the two models separately, or
use lapply() ... or request of the lsmeans maintainer that they
change lsmeans to allow such support.

  Ben Bolker



More information about the R-sig-mixed-models mailing list