[R] glht after lmer with "$S4class-" and "missing model.matrix-" errors

From: Anna Radtke <annaradtke2309_at_googlemail.com>
Date: Fri, 25 Jul 2008 11:27:20 +0200


Hello everybody.
In my case, calculating multiple comparisons (Tukey) after lmer produced the following two errors:

> sv.mc <- glht(model.sv,linfct=mcp(comp="Tukey"))
Error in x$terms : $ operator not defined for this S4 class Error in factor_contrasts(model) :
  no 'model.matrix' method for 'model' found!

What I have done before:

> sv.growth <- groupedData(length~meas|box_id,outer=~comp,data=sv.growth)
> model.sv <- lmer(length~comp+(meas|box_id),data=sv.growth)
Warning message:
In .local(x, ..., value) :
  Estimated variance-covariance for factor 'box_id' is singular
> summary(model.sv)

Linear mixed-effects model fit by REML
Formula: length ~ comp + (meas | box_id)

   Data: sv.growth
  AIC BIC logLik MLdeviance REMLdeviance  1587 1606 -786.4 1605 1573 Random effects:

 Groups   Name        Variance Std.Dev. Corr
 box_id   (Intercept) 466698.1 683.153
          meas        230733.7 480.347  -1.000
 Residual               9138.3  95.595

number of obs: 120, groups: box_id, 40
Fixed effects:
            Estimate Std. Error t value
(Intercept)   600.90      21.31  28.196
comproot     -124.84      30.14  -4.142
compshoot    -167.36      30.14  -5.553
compxfull    -375.13      30.14 -12.446
Correlation of Fixed Effects:
          (Intr) comprt cmpsht
comproot  -0.707

compshoot -0.707 0.500
compxfull -0.707 0.500 0.500

Thanks for youR help in advance.
Anna



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. Received on Fri 25 Jul 2008 - 09:29:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 14:32:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive