我正在尝试使用 lme4 库运行方差分析模型。我没有任何真实数据,所以我只是从 MASS 中提取了 Cars93 数据。虽然我可以让 lmer(...) 工作,但我似乎无法让 anova 表打印。
这是发生的事情:
> library(MASS)
> cars <- Cars93
> library(lme4)
Loading required package: Matrix
Loading required package: lattice
Attaching package: ‘lme4’
The following object(s) are masked from ‘package:stats’:
AIC, BIC
> fit <- lmer(Max.Price ~ 1+(1|AirBags)+(1|Man.trans.avail), data=cars)
> anova(fit)
Analysis of Variance Table
Df Sum Sq Mean Sq F value
> summary(fit)
Linear mixed model fit by REML
Formula: Max.Price ~ 1 + (1 | AirBags) + (1 | Man.trans.avail)
Data: cars
AIC BIC logLik deviance REMLdev
688 698.1 -340 685.1 680
Random effects:
Groups Name Variance Std.Dev.
AirBags (Intercept) 62.2339 7.8888
Man.trans.avail (Intercept) 6.3022 2.5104
Residual 83.2786 9.1257
Number of obs: 93, groups: AirBags, 3; Man.trans.avail, 2
Fixed effects:
Estimate Std. Error t value
(Intercept) 23.81 5.00 4.761
任何帮助或建议将不胜感激。