如何在R中得到newey west 调整后的统计数值

2025年05月03日 06:10
有1个网友回答
网友(1):

library("sandwich")
library("lmtest")
........................................
model1 = lm(Ri ~ MktRF + SMB + HML + AGG_LIQ)
neweywest <- coeftest(model1, vcov = NeweyWest(model1, lag = 1))
print(neweywest)
出来的数据的形式:
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.033148 0.019524 -1.6978 0.1333559
MktRF -2.189634 0.455803 -4.8039 0.0019574 **
SMB -0.984162 0.246534 -3.9920 0.0052431 **
HML -1.994266 0.285168 -6.9933 0.0002128 ***
AGG_LIQ 0.499178 0.107696 4.6351 0.0023835 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1