I have a final dataset that contains the three variables shown in the table below. I need to assign a 1 or a 0 to the OneOrZero variable based on the value in the OddsRatio variable, but I cannot find a way to do this. I have researched terms like "Random allocation" but have so far failed to find an answer to my problem.
The OddsRatio variable is the hat generated using
logistic and
predict in one dataset which I have then merged onto a second dataset to create my final dataset.
I am using Stata version 14.
Case |
OddsRatio |
OneOrZero |
1 |
0.1 |
|
2 |
0.25 |
|
3 |
0.5 |
|
4 |
0.75 |
|
5 |
0.95 |
|
Many thanks for your time and help.
0 Response to Allocation of 1 or 0 to a variable based on an odds ratio contained in another variable.
Post a Comment