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
Creating a dummy variable that selects the data I've created dummy variables for treatment and comparison group (treat1) and for the Minimum Wage I…
Exporting vif results to excel Hi I am new to stata I had run this regression reg log_daystoreject_ctnf i.filing_year i.uspc_enco…
Self constructed variable (CTT_MDDR) related to time/age of wine that switches from negative to positive: HOW TO IMPLEMENT?Dear all! My research is about the price behavior of investment grade wines. Of each wine, critics …
Computing Fixed Effects ManuallyHi guys, I have a problem regarding computing fixed effects manually: even if results when I do it m…
Is poisson QML fixed effect estimation appropriate for non-negative continuous variable in event-study design?Dear Stata users, I'm looking at the effect of coauthorship with a star scientist on the individual…
Subscribe to:
Post Comments (Atom)
0 Response to String to numeric
Post a Comment