Hi all! I am new to Stata, but I need to run quite a complicated regression. Please help me.
I have an unbalanced panel dataset of roughly 30,000 companies in over 20 years and each firm is part of an industry. I have 48 industry and create dummy variable that contains numbers from 1 to 48 to explain the industry.
I want to run regression for each industry in each year. Since I have 48 industry and 20 years, so if I do it manually, I will need to do it roughly (48x20) 960times which is very time consuming. I am looking for help to run it automatically & continuously by using stata.
The regression model is linear and have 3 independent variables: Y=c+b1x1+b2x2+b3x3+e
I only need to save the residuals of these models in one series if possible. And i would like to run the regression only in industry-year with at least 20 observations to avoid poor fit.
Im using Stata 15.
So, is there any way to run it continuously & automatically? Because Im afraid that I have to run it manually 960 times and save the residuals one by one. I am looking forward to details explanation for it since I am new to Stata. Your help is very much appreciated!
0 Response to cross sectional by each year and each industry
Post a Comment