Hi everyone,

Hope that you can help me.
I have to run a regression only when I have at least 15 observations per year and industry.
So I was thinking to, firstly, generate variable that counts how many observation per industry and year I have. After I run regression like this:

Code:
reg y x1 x2 x3 x4 x5 if numb_obs>=15
But the problem is a little bit more complicated, because I want that the observations will be counted only if these observations have not missing values on some variables.

How can I create this variable "numb_obs"?

Thank you in advance for your help