我有一个线性模型:linearMod <- lm(dist ~ speed, data=cars) summary(linearMod)
全部正常,并且:
summary(summary(linearMod))
Length Class Mode
call 3 -none- call
terms 3 terms call
residuals 50 -none- numeric
coefficients 8 -none- numeric
aliased 2 -none- logical
sigma 1 -none- numeric
df 3 -none- numeric
r.squared 1 -none- numeric
adj.r.squared 1 -none- numeric
fstatistic 3 -none- numeric
cov.unscaled 4 -none- numeric
但是
class(summary(summary(linearMod)))
[1] "summaryDefault" "table"
请问我如何访问fstatistic,这是我想要的
我希望能用
sr <- summary(summary(linearMod))
sr$fstatistic
但我明白
summary(summary(linearMod))$fstatistic
Error in summary(summary(linearMod))$fstatistic :
$ operator is invalid for atomic vectors
1条答案
按热度按时间disho6za1#
我想你只是想要
summary(linearMod)$fstatistic
。在summary(linearMod)
周围放置另一个summary()
会生成一个类似列表的对象,它是摘要的摘要!