Sorry - I know this is very basic, I'm a relatively novice.
If I want to manipulate a variable that is a word into a number, how do I do it? I've been able to answer most of my Stats questions using online tutorials thus far, but I haven't been able to successfully do this.
As an example, let's say I have a variable called letter. I have two options for the variable letter, "alpha" and "beta." I want to change alpha to 1 and beta to 2. I think it's some variation of destring, but I can't get the syntax right. I've had to do this in the past with small data sets and simply manually manipulated the data sheet, but I have larger data set for which manual manipulation would be cumbersome.
Thanks!
Related Posts with String to numeric
how to split datae and timedateofvisit 1/25/2020 1:02 1/12/2020 11:55 variable type double. how can i split date and time in to…
stcox: Continuous Time Varying CovariatesWhen evaluating the effect of a continuous covariate that changes from one wave to the next, (in thi…
Blinder-Oaxaca Decomposition with group specific variablesI would like to run a Blinder-Oaxaca Decomposition on black-white differences. I have panel data whe…
Regressing Firm-specific variables against Macroeconomic variablesHello, I am using panel data with the following observations: The firm-specific dependent variable…
Converting DMS coordinates to decimal in StataHi! Can someone please tell me if it's possible to convert DMS coordinates to decimal in Stata? I am…
Subscribe to:
Post Comments (Atom)
0 Response to String to numeric
Post a Comment