My dataset contains a varible of sex, the formate of which is string and the value of which contain male and female. I want to replace male with 1, and female with 0, so I write command as follows, but just get such results:
1. replace sex=1 if sex=="male"
type mismatch
2. replace sex=1 if sex="male"
invalid syntax

so what is the problem and how to correct it?
Thanks so much for answering