I want the same stars for significancies in regression output in stargazer as in the \"normal output\".
I produce data
library(\"stargazer\"); library(\"
You need to provide the p values associated with your coeftest
. From the man page.
p a list of numeric vectors that will replace the default p-values for each model. Matched by element names. These will form the basis of decisions about significance stars
The following should work.
test <- coeftest(model, vcov = vcovHC(model, type="HC3"))
ses <- test[, 2]
pvals <- test[, 4]
stargazer(model, type="text", p=pvals, se=ses)
This provides the following.
===============================================
Dependent variable:
---------------------------
log(y)
-----------------------------------------------
x -0.00005
Constant 6.956***
(0.003)
-----------------------------------------------
Observations 100
R2 0.026
Adjusted R2 0.016
Residual Std. Error 0.027 (df = 98)
F Statistic 2.620 (df = 1; 98)
===============================================
Note: *p<0.1; **p<0.05; ***p<0.01