0
votes

I am trying to export my regression results to excel with the command outreg2:

reg index_bhar adsue1 i.date, cluster(company_id)
outreg2 using stock_regression.csv, replace bdec(4) sdec(4) ctitle(DSUE1) addstat(Adjusted R-squared, e(r2_a)) keep(adsue1) addtext(Time FE, YES)

How can I add the t-value and p-value of the regression results in Stata, in other words which e-class do I have to use?

1
Check help outreg2. The stats() option allows you to specify t values, p values and more options.Aspen Chen
Dear Aspen, thank you for your answer, but isn´t stats() used for descriptive statistics? I need the result for estimates.eternity1
It works for estimates. Try adding this option: stats(coef se tstat pval) and click on the seeout link.Aspen Chen
Dear Aspen, it works as pointed out. Thank you!eternity1
Statistical correctness: What you are doing is better described as multiple regression. Multivariate regression entails a multivariate response.Nick Cox

1 Answers

2
votes

You can compute the t-stat and p-value and then feed into outreg2:

clear all
set more off

sysuse auto
regress price mpg foreign

local tstat = _b[foreign]/_se[foreign]
local pval = 2*ttail(e(df_r),abs(`tstat'))

outreg2 using tptest.txt, replace addstat(t-stat, `tstat', p-val,`pval')

Read

Stata tip 53: Where did my p–values go? by Maarten L. Buis. The Stata Journal, Volume 7 Number 4: pp. 584-586. http://www.stata-journal.com/article.html?article=st0137

As suggested there, you can also check help estimates table.