To construct the new variable you need to use both the generate and replace commands. To create the new variable you type:
The first command creates a new variable called newvar2, each observation in the data set has a value of 0 for this new variable. The second step recodes the newvar2 values from 0 to the value 1 if the gender variable is equal to 2.
Does this seem right? Did you type this instead?:
replace newvar2 = 1 if gender == Female
Continue on with Module 3 for an explanation of the above syntax.