Display the output of models estimated with lm()
or similar
functions. The parameter vce
allows to use covariance matrices consistent
to heteroskedasticity and autocorrelation (see the documentation of se()
).
coef_table(model, vce = NULL)
model | an estimated model returned by |
---|---|
vce | an object indicating how to obtain the covariance matrix. |
Invisibly returns the coefficient table
#> #> Call: #> lm(price ~ sqrft + bdrms, data = hprice1) #> #> Coefficients: #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) -19.314996 31.046619 -0.6221 0.5355 #> sqrft 0.128436 0.013824 9.2905 1.394e-14 *** #> bdrms 15.198191 9.483517 1.6026 0.1127 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 63.0448 on 85 degrees of freedom #> Multiple R-squared: 0.6319, Adjusted R-squared: 0.6233 #> F-statistic: 72.96 on 2 and 85 DF, p-value: < 2.22e-16 #># Heteroskedasticity consistent standard errors coef_table(mod, vce = "HC")#> #> Call: #> lm(price ~ sqrft + bdrms, data = hprice1) #> #> Covariance matrix estimate: HC. #> #> Coefficients: #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) -19.314996 44.979708 -0.4294 0.6687 #> sqrft 0.128436 0.021363 6.0121 4.438e-08 *** #> bdrms 15.198191 9.993865 1.5208 0.1320 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 63.0448 on 85 degrees of freedom #> Multiple R-squared: 0.6319, Adjusted R-squared: 0.6233 #> F-statistic: 23.2 on 2 and 85 DF, p-value: 9.1211e-09 #>