Dear all, I have been struggling to solve this.

I imported data from excel file. And have a variable "screening" that is entered as "yes" and "no".

I have tried all these commands:
egen screeningnew = group(screening),label

destring screening, generate (screeningnew)

encode screening, generate (screeningnew)

However when i want to calculate odds ratio with another variable "sex"
command:

tabodds screeningnew sex
response variable screeningnew not coded 0/1

How do i fix this? thank you so much