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
How to do a margin plot with variables with non integers?Hello, I am trying to do a margin plot with interacion terms, but when I run Code: margins ssr., a…
what a. means in a observation?Hello, I merged two databases and after that, some observations (cells) have a string "a." What does…
repeated time values within panelDear statalisters, I am asking you for help because when I run Code: xtset firm year I receive a …
XtsccDears, I have question regarding XTSCC. As I read this can be used to deal with cross-section depen…
Scatterplot of dates?Hi All, I'm using STATA 15. My question is how do I convert and then format a datetime variable (c…
Subscribe to:
Post Comments (Atom)
0 Response to Labels
Post a Comment