I am trying to make a variable (state_num) for the 50 states and D.C. where Alabama ==1, Alaska ==2, etc. I have the variable "state" where they are all listed by name. Is there a quicker way to do this than replace state_num=1 if state=="Alabama". I could have done that in the time it's taken me to try and figure this out, but I am trying to learn the tips and tricks. I have been out of the stata game for some time now and trying to relearn. Thank you!
Related Posts with Value Label on states
Ordered Probit: discontinuous region with missing values encountered when estimating Marginal effectDear Statalist I am using ordered probit model. While calculating the marginal effect it showing th…
Generating a variable based on other variableDear Profs and colleagues, I am going to generate a variable that shows how many export varieties f…
Creating a gamma distribution function to estimate likelihoodsI have created a dataset from the following: set obs 10 gen goals=_n-1 gen alpha=1.4 gen beta=1 I …
Ordered logistic regression with panel data and an interaction term between two binary independent variablesHi Users, I have a panel data set covering the years 2011-18 but mainly focusing on 2015-16. I am a…
Why are my variables being omitted by Stata?I'm doing a random effects model. I have a dummy per treatment, which would be "Message", "MessageTa…
Subscribe to:
Post Comments (Atom)
0 Response to Value Label on states
Post a Comment