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
Estimating p-value from t-value in regression with cluster-robust standard errorsHi, I have run a regression model with cluster-robust standard errors, using the following command:…
Random Effects vs Fixed Effects model issues with Hausman Test (V_b Vb not positive definite)Dear Statalister, I have an unbalanced panel dataset for 5817 (N) firms per 8 years (T). I'm runnin…
Drop many variables with same answer in the observationsHi, I'm working with a database from a University. In the observations there are a lot of variables …
Error rdplotI have a problem regarding a regression discontinuity design. I use panel data, where I have two yea…
Test whether multi-level analysis is neededHi Statalist members, I was wondering whether there is any explicit test that can tell me if I need…
Subscribe to:
Post Comments (Atom)
0 Response to String to numeric
Post a Comment