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
Highly significant Hansen statistics after xtabond2Hello everyone, I have an issue regarding xtabond2 and Hansen statistics and I was wondering if any…
Truncation of the most extreme 1 percent of earningsHi all, I want to truncate (not winsorize) the most extreme 1 percent of earnings. However, I do no…
Clustered standard errors in DID LSDV regressionHello Statlisters, I apply a DID approach on trade diversion in regard of antidumping duties impose…
Loop over double quotationI have a code look like the following: Code: macro drop _all macro def test foreach word in "a"…
Clustered standard errors in DID LSDV regressionHello Statlisters, I apply a DID approach on trade diversion in regard of antidumping duties impose…
Subscribe to:
Post Comments (Atom)
0 Response to Ignoring missing value in egen max
Post a Comment