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
Regression of a continuous variable on three binary endogenous variables and other covariatesI wish to run a regression of wages on three distinct training choices. These training choices are b…
Interaction terms in logit regression Computing real odd after estimationHi there, I am writing this logit model in stata: logit prop_FS_cat i.Path##need..., where Path is h…
Ordering table by percent "yes"I'm pretty new to STATA and this is probably a silly question, but I can't seem to find the answer a…
Clustered SE with SVYDear all, I am using a longitudinal survey with a complex design. Thus, I am using svy command. - …
Interaction effects and few cases at the ends of a distribution.Dear all, I am estimating a linear regression with an interaction effect between a continuous and a…
Subscribe to:
Post Comments (Atom)
0 Response to String to numeric
Post a Comment