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
Using a secondary dataset to generate new variables to main dataset given conditionsHi all, So as usual, I'm having a hard time describing what I'm trying to do, which I believe is wh…
lincom after transform_marginsHi I was wondering how to obtain appropriate lincom results after using transform_margins. I am usi…
Eststo/esttab with sum of coefficients (dummies)Hello, Suppose I have Y as my dependent variable, and I have three dummies, d1, d2, d3. Suppose I r…
test1 trying to see what this code looks like Code: * Example generated by -dataex-. To install: ssc i…
repeated time values in sample problemHello, I have panel data on cryptocurrencies. Uniquely identified by coin's rank and date. I used ts…
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDelete