Roy Student: We ask for full real names here. Please read and act on http://www.statalist.org/forums/help#realnames
Looking at your questions: It seems that a string variable costat has the value A if active and I if inactive. You don't give other variable names, but something equivalent to
will count how many observations for each firm show that the firm was active in 1993. You want to drop firms with values of 0 or equivalently keep those with values of 1.
Missing values of total assets. You can count how many you have for each firm with something like
but there isn't a single best approach to missings on which all researchers agree. Three approaches among many others are (1) to keep only panels on which no value is missing (2) to use some threshold (e.g. that you want 5 years or more with non-missing values) (3) that you just drop observations with missing values. There are arguments for and against all of those.
Looking at your questions: It seems that a string variable costat has the value A if active and I if inactive. You don't give other variable names, but something equivalent to
Code:
bysort firmid : egen OK = total(costat == "A" & year == 1993)
Missing values of total assets. You can count how many you have for each firm with something like
Code:
by firmid: egen nmissing = total(missing(total_assets))
Comment