Hello,
I am trying to create a newvar that has 0 and 1 from two variables.
The first variable (var1) is binary (yes = 1, no = 0). The second variable (var2) is a range of values (-2 through +2 at 0.5 intervals; ie. -2, -1.5, -0.5, 0, etc).
For the newvar:
1. I want 0 to be true if var1 = 0 and var2 to be >= -0.5.
2. I want 1 to be true if var1 = 1 and var2 to be >= -0.5.
Notice, this will also be working with missing data. Missing data will be any rows with var2 <= -1, which I don't want included in my future analysis.
Appreciate the help!
Thanks
I am trying to create a newvar that has 0 and 1 from two variables.
The first variable (var1) is binary (yes = 1, no = 0). The second variable (var2) is a range of values (-2 through +2 at 0.5 intervals; ie. -2, -1.5, -0.5, 0, etc).
For the newvar:
1. I want 0 to be true if var1 = 0 and var2 to be >= -0.5.
2. I want 1 to be true if var1 = 1 and var2 to be >= -0.5.
Notice, this will also be working with missing data. Missing data will be any rows with var2 <= -1, which I don't want included in my future analysis.
Appreciate the help!
Thanks
Comment