stargazer icon indicating copy to clipboard operation
stargazer copied to clipboard

Add option to display t-statistics instead of standard errors below coefficients

Open maruoss opened this issue 2 years ago • 1 comments

Compared to the open #78 pull request, this one takes the t statistics from the statsmodels models directly. Also, the tstats are displayed below the coefficients with e.g. "t=1.9645" instead of (1.9645). For conf. intervals and standard errors, brackets are kept.

maruoss avatar Sep 23 '22 10:09 maruoss

Thanks @maruoss . First, sorry ( @carterkd ) for not reacting #78

Then, on the t= replacing the brackets, I have no objection but I have never seen it: @carterkd what do you think? What does R/other packages do?

This said, small bug (of both PRs):

table = stargazer([something])
table.show_t_statistic(True)
table.show_confidence_intervals(True)
table

... will not show confidence interrvals. In other words, once we have two variables regulating what is shown, each command must change both. It's not nice, and I'm open to a more elegant solution, but as a temporarily solution (we'll have to change the API anyway) it's fine to just do so (changing both).

toobaz avatar Sep 27 '22 17:09 toobaz

I just want to pitch in here that I think an option to display t-stat is quite essential for some areas of research. In terms of display design, In my experience, I've seen two options in literature (1) put t-stat and replace std. errors altogether, (2) use squared brackets to differentiate from round brackets used for std. error (or robust t-stat). So maybe the way to go is to allow multiple designs of t-stat style, although I think option 1 is far more common.

Regardless of the reporting design, I think this is a very important feature.

Jiacheng-Liu avatar Nov 21 '22 18:11 Jiacheng-Liu