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!