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
Complex conditions/generationDear all, I am using the following data with permno for all the different companies and the dummy f…
Multiple marginal effects with nehurdle commandI am using the community contributed nehurdle command in Stata12 to run a hurdle model. I want to ge…
simplified codeI am not sure whether the following code works best for the purpose. Based on my data, it takes arou…
Data import problemI have a problem in import the data set into STATA version 14. My data set has a sample value around…
Combine multiple variables (categorical and ordinal ones) into one variable (categorical) for regressionHey people, I want to run a regression with Stata and must change a few variables. There are three …
Subscribe to:
Post Comments (Atom)
0 Response to Output OLS Regression
Post a Comment