I would like to add the t-value underneath the standard error in square bracket, how can I accomplish this with Stargazer?
school.reg1 <- lm(math~income+students+english, data=CASchools)
school.reg2 <- lm(read~income+students+english, data=CASchools)
stargazer(school.reg1, school.reg2, type="latex",
covariate.labels = c("Number of Students at School", "Median Income of Parents", "% of Non-Native English Speakers", "Total School Spending", "Percent Qualifying for CalWorks "),
dep.var.labels = c("Math", "Reading"),
keep.stat=c("n", "adj.rsq"),
add.lines = list(c("AIC", round(AIC(school.reg1),2), round(AIC(school.reg2),2) )) )
Currently the table looks like this
Source code taken from https://bookdown.org/ejvanholm/WorkingWithData/attractive-output.html
Perhaps you are also fine with "t=" instead of square brakets. Use the report
option.
library(AER)
data("CASchools")
school.reg1 <- lm(math~income+students+english, data=CASchools)
school.reg2 <- lm(read~income+students+english, data=CASchools)
library(stargazer)
stargazer(school.reg1, school.reg2, type="text",
covariate.labels = c("Number of Students at School", "Median Income of Parents", "% of Non-Native English Speakers", "Total School Spending", "Percent Qualifying for CalWorks "),
dep.var.labels = c("Math", "Reading"),
keep.stat=c("n", "adj.rsq"),
report = "vc*st",
add.lines = list(c("AIC", round(AIC(school.reg1),2), round(AIC(school.reg2),2) )) )
=============================================================
Dependent variable:
----------------------------
Math Reading
(1) (2)
-------------------------------------------------------------
Number of Students at School 1.498*** 1.501***
(0.083) (0.074)
t = 18.137 t = 20.177
Median Income of Parents 0.0001 -0.0001
(0.0002) (0.0001)
t = 0.408 t = -0.739
% of Non-Native English Speakers -0.406*** -0.569***
(0.035) (0.031)
t = -11.632 t = -18.101
Total School Spending 636.628*** 641.224***
(1.590) (1.431)
t = 400.498 t = 448.017
-------------------------------------------------------------
AIC 3248.6 3160.46
Observations 420 420
Adjusted R2 0.625 0.735
=============================================================
Note: *p<0.1; **p<0.05; ***p<0.01
To add those in square brackets, follow this approach and modify the source code of stargazer
R stargazer package: eliminate "t =" label from reported test statistics