Dear All,
I need to estimate a model using a cross-sectional regression for each industry and year over the period 2009 to 2014. The data is a panel data.
I used the following code:
bysort year industry: gen nobs = _N
forval y = 2009(1)2014 {
forval i = 1(1)50 {
di "year = `y' and industry = `i'"
reg part1 part2 part3 part4 part5 if industry== `i' & year==`y' & nobs>10, noconstant
predict r if industry== `i' & year==`y' & nobs>10, resid
}
}
However, every time I run this regression I have an error (although I have few missing observations) :
no observations
r(2000);
I would really appreciate any advice regarding the code.
Many thanks,
Nour
Related Posts with Cross-sectional regression for each ind and year
Dealing with Highly Collinear Independent VariablesDear Stata Members I have a panel data where my independent variables are highly COLLINEAR(Index1 t…
Creating a new variable (that changes value in every 3 days....)I am working with survey dataset. It has 30 people (variable name = dlp, numeric) who start work in …
Trim and fill using metatrimI looked through other forum posts (post1, post2, post3, post4) and this question has been asked man…
encode with strange number?Dear All, I have this data set in Stata format (dataex may not be appropriate for my purpose), encod…
Cannot install estout packageHello everyone, I have been experiencing some issues while trying to install the estout package on m…
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete