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
average using past group informationHi all, I have company-level information as follows. For each company id in a country, I have the c…
Python: Importing pandas (and other packages) into STATA 16I am running STATA 16 and installed Anaconda to be able to run python code from STATA. The installat…
How get variable list for a conditionI wonder if its possible get a variable list for a condition, example: Code: clear all sysuse auto…
Analysis of Stock market data in Stata - First TimeDear All, I have daily stock market data of 174 firms from 2000 to 2019 (about 4400 prices per stoc…
Expand dataDear Statalist Members, I am looking for help with expanding my dataset below to include a categori…
Subscribe to:
Post Comments (Atom)
0 Response to Output OLS Regression
Post a Comment