I have a variable for U.S. states that includes 01, 02, 03, ... , 50, 51, and these are all strings representing the 50 U.S. states and the District of Columbia. I would like to regress a dependent variable on each state individually as a dummy binary variable, but I don't want to have to create 51 separate dummies.
Is there a quick way to do this? I'm aware of using "i" to create separate dummies (e.g. "reg depvar i.indepvar"), but this doesn't seem to work since the "states" variable contains strings.
Any help is appreciated.
Related Posts with Convert Single String Variable to Many Binary Variables
which option can decreae the numbers of symbols of a graphArray As you can see, there are so many symbols, which option can decreae the numbers of symbols of …
Breaking down a difference in difference resultHello everyone! In the literature has been documented that new CEOs make more innovation. This effe…
Difference in difference with time variant treatment I am currently working on district-month level data and interested in examining how the use of poli…
Clarification regarding O/E from melogit modelI believe I am doing this correctly but I would love confirmation from others more experienced with …
Calculating integral for an independent variableHi I have a panel dataset with t=35 and n=300. For a project I need to run a regression of the follo…
Subscribe to:
Post Comments (Atom)
0 Response to Convert Single String Variable to Many Binary Variables
Post a Comment