I have tried the following code but it does not work:
Code:
gen Var_1 = Var_66<=2 & Var_66<. & Var_67 >=1 & Vat_67 <. & Var_68 >=1 & Var_68 <. & Var_69 >=1 & Var_69<. & Var_70<=3 & Var_70 <.
So I want it so if someone gets 2 or less for Var_66 they get a 1 for Var_1 regardless of how they score on the other variables. I want it to ignore missing values and if someone has a missing value for all variables then they will have a missing value in Var_1. Otherwise I want it to be a 0 if all values don't meet the thresholds specified.
0 Response to Generating a new variable (0/1) based on multiple variables and excluding missing variables
Post a Comment