For revenue, firm A has one missing value in 2002. Firm B has no missing values.
I am trying to generate dummy = 1 for all years unless a firm has missing values for all years.
Basically, I would like to have dummy = 1 for both firms for all years.
I tried the below, but it only generate dummy = 1 for non-missing values..
Code:
gen dum = 0 bysort firmid: replace dum= 1 if revenue !=.
With the code I have, I see dum = 0 in 2002, I need it to be dum = 1.
How could we do that?
0 Response to How to replace per individual
Post a Comment