我使用lmList
from nlme
package 来运行基于不同组的各种回归 by 函数。鉴于我看到的解释,我对总结结果有点困惑summary.lmList
The `summary.lm` method is applied to each lm component of object to produce
summary information on the individual fits, which is organized into a list of
summary statistics.
The returned object is suitable for printing with the print.summary.lmList
method.
我的意思是下面
set.seed(123)
t <- data.frame(
name=sample(c("a","b","c"),size=500,replace=T),
x=1:500,
y=1:500+rnorm(100)
)
ta <- t[t$name=="a",]
lma <- lm(y~x,ta)
lmL <- lmList(y~x | name,t)
r1 <- summary(lmL)
r2 <- summary(lmL[["a"]])
r3 <- summary(lma)
有人可以向我解释为什么 r1 中显示的“a”值与 r2 和 r3 中的值不匹配,而 r2 中的值与 r3 中的值匹配吗?