Hi
I have a small query. I am trying to generate a new variable (X), based on my existing 3 variables (A, B and C). I want the new variable X to equal A if A has a non-missing value. In case of A's value is missing, then X should equal B, if however if B's value is missing then X should equal C's value. I tried using if and else if commands but I am not being able to execute it properly. Kindly share any help or suggestions. Thank You.
Related Posts with Generating a new variable on non-missing condition
IV Fixed Effects Model combined with HeckitDear Statalist, Following this discussion: https://www.statalist.org/forums/for...quations-model …
Predictions after mlogitThe margins command calculates predicted probabilities for each covariate across groups (outcome). F…
Combining Heckman with 2SLSDear Statalisters, I am interested in measuring the performance of imitative products. These produc…
Regression Results with "If" StatementI am trying to run a simple regression for a school assignment. The question asks me to run a regres…
How to include Fixed Effects in a Diff-in-diff specification?I'm doing a difference-in-difference report on whether the EU Industrial Emissions Directive (implem…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable on non-missing condition
Post a Comment