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
Bachelor ThesisHi there! We are two swedish students struggling with our bachelor thesis. We are investigating the …
Linearity/ non-linearity using residual plotArray How can I predict linearity or non-linearity of my regression model using this residuals Vs fi…
Seperating a string into substrings (by upper case letters)Dear all, I have to "cut a string into pieces". The "seperator" being a upper case letter. e.g. va…
Applying Brent's method in STATAHello, I wanted to apply Brent's theorem to a function generated in STATA, in order to invert it an…
Categorical Variables Treatment at Regression AnalysisHello everyone, Hope you all feeling well. I need help in the following specific case in STATA: Fir…
Subscribe to:
Post Comments (Atom)
0 Response to Labels
Post a Comment