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é
Related Posts with Labels
Histogram –Assigning min and max values to binsDear Stata users, For my Project, I need the histogram of the intraday returns for each day and save…
Dummy variable for group matched observationsDear all, I have a variable of unique ids for a dataset of survey respondents which I have matched …
Different colors for the confidence intervals plotDear All, I want to plot confidence intervals with different colors of my preference. I am using the…
infile command cuts off the id variableHello! I would like to import a .txt file (which I created in Mplus, .raw would also be possible) b…
Generate variable with conditionsDear all, I am currently working on my masterthesis. For this thesis, I am preparing a dataset whic…
Subscribe to:
Post Comments (Atom)
0 Response to Labels
Post a Comment