Hi!
I have three binary variables hh_d_floor, hh_d_wall and hh_d_roof. The three of them take values of 0 and 1.
I am trying to run the following instruction:
gen housing = 1 if (hh_d_floor == 1| hh_d_wall == 1| hh_d_roof == 1)**The household has inadequate (1) housing materials in any of the three components: floor, roof, or walls.
replace housing=0 if (hh_d_floor==0) & (hh_d_wall==0) & (hh_d_roof==0) **The household has adequate (0) housing materials if it has all of the three components: floor, roof, or walls.
The first line is giving me an error....How could I express the union of threeevents in stata?
and... is the intersection defined with &?
Thanks!
I have three binary variables hh_d_floor, hh_d_wall and hh_d_roof. The three of them take values of 0 and 1.
I am trying to run the following instruction:
gen housing = 1 if (hh_d_floor == 1| hh_d_wall == 1| hh_d_roof == 1)**The household has inadequate (1) housing materials in any of the three components: floor, roof, or walls.
replace housing=0 if (hh_d_floor==0) & (hh_d_wall==0) & (hh_d_roof==0) **The household has adequate (0) housing materials if it has all of the three components: floor, roof, or walls.
The first line is giving me an error....How could I express the union of threeevents in stata?
and... is the intersection defined with &?
Thanks!
Comment