Hello, i'm sure my problem is very basic, but I couldn't find an answer in past topics.

An example of what I want to do is

gen x=.
replace x=0 if y=("Married", "Engaged")

The thing is that variable y is a numeric variable with a certain label related to each number, but I want to work with the labels.

I can't work with the numeric values because for some observations if it says "Married" the value of y=1 and for other its y=3

Thanks!

José