我可以请你帮助我扩展 R 中 mtable 输出中的小数位数吗?目前仅显示小数点后 1 位,但希望看到小数点后 5 位。谢谢!
m1<-lm(formula=Sales~Price.Eggs,data=sales.data)
m2<-update(m1,.~.+Ad.Type)
m3<-update(m2,.~.+Price.Cookies)
mtable(m1,m2,m3)
======================================================
m1 m2 m3
------------------------------------------------------
(Intercept) 115.366*** 101.571*** 137.370***
(10.041) (9.899) (10.834)
Price.Eggs -19.286*** -16.643*** -16.118***
(2.263) (2.166) (1.646)
Ad.Type: 1/0 4.195** 4.147***
(1.371) (1.040)
Price.Cookies -8.711***
(1.901)
------------------------------------------------------
**R-squared 0.7 0.8 0.9
adj. R-squared 0.7 0.8 0.9**
sigma 3.9 3.4 2.6
F 72.6 51.8 67.1
p 0.0 0.0 0.0
Log-likelihood -82.5 -78.1 -69.2
Deviance 431.2 320.3 177.2
AIC 171.1 164.2 148.4
BIC 175.3 169.8 155.4
N 30 30 30
======================================================
这应该有效:
m1<-lm(formula=Sales~Price.Eggs,data=sales.data)
m2<-update(m1,.~.+Ad.Type)
m3<-update(m2,.~.+Price.Cookies)
mtable(m1,m2,m3, digits = 5)