Hi,
I got some survey data. The raw data is in text, like for example there was a question about education where the responses are "undergraduate degree", "postgraduate degree" etc. Now, I'd like to turn this into binary variables (one "undergraduate" variable, one "postgraduate" variable etc). I know that this can be done manually though it's quite time-consuming, but I was wondering if this process could be automated somehow using STATA.
I was thinking of generating a variable and then have the variable take the value 1 when the response was in a certain way (so the value "undergraduate" takes the value 1 when the response is "Undergraduate degree". However, when I tried this I got a "type mismatch" error.
Is there any way to get around this or should I just start translating the data into 1's and 0's manually?
Related Posts with Creating variables from text
Help! How do I use the command collapse? Hi, I have a question about an exercise we did in my econometrics class. I have this database of te…
changing numeric string to numeric variable where e5 next to a number means 10^5I have a string variable of the type show below, where 63e5 represents 6300000. How do I change it 6…
Putdocx and loopingDear list, I have three variables called Sex (coded as male/female), HTN (yes/no) and Cancer (yes/n…
An indicator variableHi everyone, I have a dataset including over 500 firms that have CEO changes based on CEO_ID and la…
Interpretation of probit post-estimation testHi Statalisters, I have a question about interpreting post-estimation tests in Stata. Suppose I est…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables from text
Post a Comment