Dear all,
I have a panel data and would like to create a dummy variable using the following:
bys bvd_id: egen filter=max(X>16 & year==2018); however, if the observation of X in 2018 is missing (.), then egen also generates 1, instead of 0. How can I treat that missing value as zero? I tried the following:
bys bvd_id: egen filter=max(missing(X>16 & year==2018)); This slightly works, but now if I have a missing value for year other than 2018, then the result is also 0.
Really appreciate your help.
Best,
Abdan
Related Posts with Ignoring missing value in egen max
Test for significance of Time DummiesHi, I am doing a FE and RE Regression and I am not sure if I should use Time Dummies (i.date) or a …
Difference in Difference Panel ModelThe objective of my research is to see how firms can overcome their liability of origin when they ge…
Two way fixed effects and interaction termsHello Stataforum, I'm working on a generalized difference difference model with multiple groups and…
t-value too longHow can I see the full value without the e ? t= -1.5e+02 …
Is there any difference between "Sort X Y" versus. "Bysort X Y: gen A=1"I know in Bysort you have to generate something. But other than that will using Sort X Y vs. Bysort …
Subscribe to:
Post Comments (Atom)
0 Response to Ignoring missing value in egen max
Post a Comment