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
Combining two datasets and keeping specific observationsI have two datasets. Dataset A and Dataset B. Dataset A is my existing data that I have organized an…
compare value different variable and rowshello, I want to compare values of two varible in diffrent rows. For example vr1 vr2 10 20 20 30 40 …
New version of wridit on SSCThanks as always to Kit Baum, a new version of the wridit package is now available for download from…
Replacing values from one observation to anotherDear Statalist users, this may be a trivial question to you, but I am a little bit struggling to do…
table summarizing 3 categorical variables in string form between two groups (binary variable)Hello, I am having a hard time finding examples of summary tables between two groups let's say stud…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable on non-missing condition
Post a Comment