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
Rolling AR Forecast by panel using RangerunHi, I have a panel dataset of multiple firms (gvkeys) across multiple quarters. I am trying to get…
Wald test or any related for regression with interaction termHi all, After reading many many topics I have a question on the possibilities of any test to check …
IVQREG2 - clustered SEDear All, I am trying to use the IVQREG2, firstly by trying the examples in the Stata help, but I ke…
Multiple imputation, miHello, I am trying to impute all missing values including covariates and outcomes at 3 months of fo…
Graph bar: how to change "blabel" sizeDear All, I'm producing a bar graph with data labels using the following code: Code: graph bar VAR…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables from text
Post a Comment