Hi there,
Using the following code, i was unable to create dummy variables for this generated interval. I result does not exactly provide dummy variables.
use poverty, clear
keep xhpsu xhnum hhsize
gen hhsize_grp=""
replace hhsize_grp = "1-2 persons" if hhsize <= 2
replace hhsize_grp = "3-4 persons" if hhsize >= 3 & hhsize <= 4
replace hhsize_grp = "5-6 persons" if hhsize >= 5 & hhsize <= 6
replace hhsize_grp = "7-8 persons" if hhsize >= 7 & hhsize <= 8
replace hhsize_grp = "9-10 persons" if hhsize >= 9 & hhsize <= 10
replace hhsize_grp = "11 or more" if hhsize >= 11
Is there any I could get dummy variables for this? Thanks
Using the following code, i was unable to create dummy variables for this generated interval. I result does not exactly provide dummy variables.
use poverty, clear
keep xhpsu xhnum hhsize
gen hhsize_grp=""
replace hhsize_grp = "1-2 persons" if hhsize <= 2
replace hhsize_grp = "3-4 persons" if hhsize >= 3 & hhsize <= 4
replace hhsize_grp = "5-6 persons" if hhsize >= 5 & hhsize <= 6
replace hhsize_grp = "7-8 persons" if hhsize >= 7 & hhsize <= 8
replace hhsize_grp = "9-10 persons" if hhsize >= 9 & hhsize <= 10
replace hhsize_grp = "11 or more" if hhsize >= 11
Is there any I could get dummy variables for this? Thanks

Comment