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
Eprobit, entreat: missing information in model output for error correlationsHello, I am missing running a series of models using eprobit, entreat in Stata 16.1. My model is: …
Reference Category for PPML hdfeHi All, I am making use of the wonderful command Code: ppmlhdfe which is used to estimate models w…
Error "not stata format", but no change in software or dataset, which previously worked fineDear Statalists, I am currently working with a dataset from the European Values Survey. The past we…
Running stata commands within python: end blocks in Stata 16Dear Statalist users, I have to create a user-defined weighting function that weighs the independen…
PPML , endogeneityDear Prof. Joao Santos Silva , Prof. Tom Zylkin and dear Statalisters The purpose of my work is to …
Subscribe to:
Post Comments (Atom)
0 Response to Convert Single String Variable to Many Binary Variables
Post a Comment