Dear All,
I am trying to create a new "state" variable from certain city codes, one can observe that each city code has its own state number at the beginning. For example, 5 is state A and 99 is state Z. I was wondering if it is possible to extract the first (or first two) numbers from a city code and from that, create a new variable which assigns it to a state. I realize this is possible but due to my unfamiliarity with loops I would like to ask for anybody's help.
Thank you very much.
Juan
Related Posts with Creating State variables from city codes
Selecting values from panel dataI have data on visits to a clinic. In the example below, "value date" is the date of the clinic visi…
combining dates in 2 different columnsDear Stata forum members, I need advise on how to combine dates in 2 different columns in to one co…
Solving complex equations with STATADear Statalists, can anybody help me solve equations with STATA? In particular, I have one equation …
Labelling group patterns in concatenated variableGood morning. I would like some help regarding how to label concatenated variables. I have almost 40…
Westerlund ECM panel cointegrationGood morning, I would like to apply a Westerlund and Edgerton (2007) panel bootstrap cointegration t…
Subscribe to:
Post Comments (Atom)
0 Response to Creating State variables from city codes
Post a Comment