Dont know the answer to this question BUT do not do this!!! This approach to missing data introduces a lot of bias. Please look into modern missing data techniques (i.e. Multiple imputations).
Hi,
So I have Panel Data (ie. a number of different firms and across time)
I want to say something like 'if there is missing values for variable x then delete the whole firm', as opposed to just deleting that particular firm-year observation.
Help?
Dont know the answer to this question BUT do not do this!!! This approach to missing data introduces a lot of bias. Please look into modern missing data techniques (i.e. Multiple imputations).
I agree with Lazar's advice, but this is how you would do it. The trick is that missing numbers in Stata are higher than other numbers - so if you sort by variable x, the missing values will come last.
Therefore you can do it in one line:
x[_N] is the last value of x within each company.Code:bysort company (x): drop if missing(x[_N])
|
|