Hi folks,
I'm brand new to Stata (just made the switch from SPSS) so I am running some tests I did in SPSS in Stata just to help get familiar with it.
I want to run a logistic regression, but first I need to change a continuous variable into binary. I used this command to do it:
recode X3TCREDCOMPSCI (0 = 0)(0.5/5 = 1), gen(CS_enrollment)
However, in the data their is negative values as well, which I don't want to show up in the final data. So any numbers outside of the range 0-5 I want excluded from the new "CS_enrollment".
Any recommendations on how to do this?
Thank you!
I'm brand new to Stata (just made the switch from SPSS) so I am running some tests I did in SPSS in Stata just to help get familiar with it.
I want to run a logistic regression, but first I need to change a continuous variable into binary. I used this command to do it:
recode X3TCREDCOMPSCI (0 = 0)(0.5/5 = 1), gen(CS_enrollment)
However, in the data their is negative values as well, which I don't want to show up in the final data. So any numbers outside of the range 0-5 I want excluded from the new "CS_enrollment".
Any recommendations on how to do this?
Thank you!
Comment