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
Poisson command on panel datawhen i run the following commnad xtpqml lexp_food year mig_stats_16 mig_stats_yr sex sector edu_hh e…
multilevel ordinal probit model_meoprobit_iccI am intending to establish a multilevel ordinal probit model. The dependent variables is injury sev…
Can esttab produce percent change results for mixed models with log-transformed dependent variable?Hi Statalist, Is it possible to create a coefficients table that produces percent change instead of…
asdoc : addition of bysort prefix with tab, tab1, tab2 commandsI have just added support for the bysort prefix with tabulation commands in asdoc. Details and examp…
outreg2 after tab1Using the below code, I generate several one-way frequency tables. I would like to send all the tabl…
Subscribe to:
Post Comments (Atom)
0 Response to Creating State variables from city codes
Post a Comment