使用汇总命令时,我可以获得重要的系数。在这里,通过查看星星,我看到 Sepal.Width 和 Petal.Length 的 P 值低了很多。但是,如果我只打印出系数,这些星星就会消失。怎么把星星找回来?(注意:我想要输出中的星星。)
library(plm)
m1 = plm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=iris, index=c('Species'))
summary(m1)
Oneway (individual) effect Within Model
Call:
plm(formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width,
data = iris, index = c("Species"))
Balanced Panel: n=3, T=50, N=150
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-0.79400 -0.21900 0.00899 0.20300 0.73100
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
Sepal.Width 0.495889 0.086070 5.7615 4.868e-08 ***
Petal.Length 0.829244 0.068528 12.1009 < 2.2e-16 ***
Petal.Width -0.315155 0.151196 -2.0844 0.03889 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 38.956
Residual Sum of Squares: 13.556
R-Squared: 0.65201
Adj. R-Squared: 0.62593
F-statistic: 89.9338 on 3 and 144 DF, p-value: < 2.22e-16
在这里,我尝试仅打印出系数。我的重要明星不见了。
summary(m1)$coeff
Estimate Std. Error t-value Pr(>|t|)
Sepal.Width 0.4958889 0.08606992 5.761466 4.867516e-08
Petal.Length 0.8292439 0.06852765 12.100867 1.073592e-23
Petal.Width -0.3151552 0.15119575 -2.084418 3.888826e-02