Dear members,
I am new to stata and I need to estimate a regression model for each industry and year for years from 2000 till 2016 and 42 industries, my variables are y, x1, x2 ,x3, industry and year, I need that the regression is estimated if there is a minimum of 15 observations. I used this code but it returned nothing but a new variable in the original data set for the number of observations (nobs),
Thanks,
Your help is much appreciated
I am new to stata and I need to estimate a regression model for each industry and year for years from 2000 till 2016 and 42 industries, my variables are y, x1, x2 ,x3, industry and year, I need that the regression is estimated if there is a minimum of 15 observations. I used this code but it returned nothing but a new variable in the original data set for the number of observations (nobs),
Code:
bysort year industry: gen nobs = _N forval y=2000/2016 { forval i= 1/42 { di "year = `y' and industry = `i'" reg y x1 x2 x3 if Industry== `i' & year==`y' & nobs>15 }
Your help is much appreciated
Comment