R 为什么lmList与lmList[[x]]的汇总结果不同
我使用R 为什么lmList与lmList[[x]]的汇总结果不同,r,regression,R,Regression,我使用nlme软件包中的lmList根据函数的不同分组运行各种回归。对于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
nlme
软件包中的lmList
根据函数的不同分组运行各种回归。对于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)
set.seed(123)
tnlme中的lmList
及其摘要方法的版本有一个参数pool
:
一个可选的逻辑值,指示
剩余标准误差应用于标准偏差的计算
摘要的偏差或标准错误
我猜如果在调用summary
时将其设置为FALSE
,您将得到相同的值