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?