Hello STATA experts,
I am not very STATA savvy and hence my question is probably very silly..
I am trying to create new variables by extracting certain values within one column of values (ml of blood, in case it is important). I need to create 5 variables according to amount of blood. My intent is to use those variables for a logistic regression later.
These are the 5 variables I am trying to create (numbers represent ml, so 3ml, 6ml, 10ml; <= 0 ml is possible because the values were calculated post-pre values and pre is occasionally larger than post)
Var1: <= 0
Var2: >0 & <=3
Var3: >3 & <=6
Var4: >6 & <=10
Var5: >10
I picked "create new variable", entered the variable name and then did the first expression 'PHEexpansion <=0' which worked perfectly.
As soon as I used the logical operator "&", it gave me an error saying "<=3 invalid name". The expression I entered into GUI was 'PHEexpansion >0 & <=3'
I tried to enter it with and without blanks which both gave me the same error. I also tried to enter the command directly into the command window without a change in result.
Does anyone have a suggestion what I am doing wrong here? I would be very grateful if I could make this work.
Thank you so much!
best,
Sarah
I am not very STATA savvy and hence my question is probably very silly..
I am trying to create new variables by extracting certain values within one column of values (ml of blood, in case it is important). I need to create 5 variables according to amount of blood. My intent is to use those variables for a logistic regression later.
These are the 5 variables I am trying to create (numbers represent ml, so 3ml, 6ml, 10ml; <= 0 ml is possible because the values were calculated post-pre values and pre is occasionally larger than post)
Var1: <= 0
Var2: >0 & <=3
Var3: >3 & <=6
Var4: >6 & <=10
Var5: >10
I picked "create new variable", entered the variable name and then did the first expression 'PHEexpansion <=0' which worked perfectly.
As soon as I used the logical operator "&", it gave me an error saying "<=3 invalid name". The expression I entered into GUI was 'PHEexpansion >0 & <=3'
I tried to enter it with and without blanks which both gave me the same error. I also tried to enter the command directly into the command window without a change in result.
Does anyone have a suggestion what I am doing wrong here? I would be very grateful if I could make this work.
Thank you so much!
best,
Sarah
Comment