Hello everyone.
For my thesis I have to run a OLS regression estimated cross-sectionally by industry and fiscal year(see underneath). But my question is not about how to do this, but about the output Stata is generating. Because I have 209 industry-year combinations, Stata runs 209 different industry-year regressions and therefore also the output of the regression underneath are 209 tables. But of course, for my thesis these results have to be in one table instead of 209.
How can I get the results of these 209 seperate tables into one table??
sum sic2id
local k=r(max)
forvalues i=1(1)`k'{
qui reg CCE CE1 CCEChange ATOChange ACC1 ACC SALESC NEGSALESC if sic2id==`i'
qui predict res if sic2id==`i', res
qui replace UECCE=res if sic2id==`i'
qui replace r2b=e(r2_a) if sic2id==`i'
qui replace c1=_b[CE1] if sic2id==`i'
qui replace c2=_b[CCEChange] if sic2id==`i'
qui replace c3=_b[ATOChange] if sic2id==`i'
qui replace c4=_b[ACC1] if sic2id==`i'
qui replace c5=_b[ACC] if sic2id==`i'
qui replace c6=_b[SALESC] if sic2id==`i'
qui replace c7=_b[NEGSALESC] if sic2id==`i'
qui drop res
di `i' " / " `k'
}
Kind Regards,
Sjoerd
Related Posts with Output OLS Regression
Can I regress company data as dependent and macroeconomic data as independent?Can I regress company data (as firm performance - the dependent variable) on macroeconomic data (as …
Adding category to variable and sustain response after point of change in longitudinal datasetDear Stata Listers, I am working with a 19 wave longitudinal dataset of around 1,000 respondents, w…
Doubts on Diff-in-Diff methodDear Stata users, I am writing this post hoping that someone could help me. Here the story, I am a…
🙋 How to display full matrix names?This Code: clear all version 15.1 matrix A = 32 matrix rownames A = interview__id matrix list A …
Coding linear time trend with missing yearsI am familiar with creating linear time trends. For example, if I have study years 1996, 1997, 1998 …
Subscribe to:
Post Comments (Atom)
0 Response to Output OLS Regression
Post a Comment