[R-sig-ME] lsmeans

Martin Henry H. Stevens HStevens at muohio.edu
Sat Jun 23 14:39:02 CEST 2007


Dear Frank,
As lmer doesn't use least squares means, I am not sure they are  
readily obtained. Predicted values may be obtained in several ways,  
including the following from Spencer Graves:

### From Spencer Graves
### For getting the predicted values from the fixed effects only.
predict.lmer <- function(object, X){
## From: Spencer Graves <spencer.graves>
## Date: Sun, 07 May 2006 08:07:07 -0700
# object has class "lmer"
# X = model matrix with columns
# matching object at X
    if(missing(X))
      X <- object @ X
    b <- fixef(object)
    X %*% b
}

Cheers,
Hank
On Jun 22, 2007, at 6:21 PM, Cougar wrote:

> I was wondering if someone could explain how to obtain LSmeans from  
> lmer.  I
> could not find any information in the R-archives.
>
> Respectfully,
>
> Frank Lawrence
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models




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