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
georouteHello, I've a list of pair of coordinates for varX and varY and I'm using georoute to calculate the …
Calculating cost of equity through fama and french 3 factor modelHello, I have to calculate the cost of equity capital based on fama and french 3 factor model. For …
Bootstrap two stagesHi all, I am trying to perform the following: extract n bootstrap samples from a strongly balanced …
discrete-time survival analysis xtcloglog late entryDear members, I am running a discrete-time survival analysis on an unbalanced panel data by using x…
Multiple observations with some different covariates and non-integer weightsHi. I have a dataset with some multiple observations, but the observations are different for one sp…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable on non-missing condition
Post a Comment