Hello,
i am trying to divide the 50 states into 2 categories: "childcare" and "no childcare".
I am assigning a value of 1 for "childcare" and 2 for "no childcare". Only 4 of the states are "childcare" and the rest are "no childcare." I already generated the variable "childcare" with this line of code:
gen childcare=.
replace childcare=1 if state==1 & state==43 & state == 27 & state == 21
for "no childcare," which is the remaining 46 states, is there an easier way to generate a variable without coding every state by hand?
Related Posts with Generating a single variables for multiple values
Lagged difference in DF testDear members, I was performing the DF test on a AR(1) model, I was firstly trying dfuller nilemax,…
Long to wide formatStatlist, I am trying to convert my data from long to wide. However, I get the error "too many time…
Difference in Differences with continues entry and decaying time trendI have a dataset that contains both physical and online sales of books. I am interested in examining…
rdplot - magnitude and statistical significance of discontinuous jumpDear all, I use the command -rdplot- to assess graphically if there is a discontinuous jump in a ti…
python integration, "Unable to find shared library."Hi Statalist, I am trying to integrate python with Stata. I am running into a pair of errors, the s…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a single variables for multiple values
Post a Comment