Hi all,
I'm working with dummy variables for a variable MOMRACE for a class I'm taking. MOMRACE can take on 7 values, each corresponding to a different race. Because there are very few data points for 5, 6, and 7, I've been instructed to just combine them into a new dummy variable called "momother" for use in a multiple regression model. However, I can't seem to get the results I want.
Here's the code I've tried using:
generate momother = .
replace momother = 1 if MOMRACE == 5 | MOMRACE == 6 | MOMRACE == 7
replace momother = 0 if MOMRACE != . & (MOMRACE !=5 | MOMRACE != 6 | MOMRACE != 7)
I assumed this would make a new dummy that includes categories 5,6, and 7, but when I look at the new variable momother, all of the values are 0.
Any help would be great, thanks!
I'm working with dummy variables for a variable MOMRACE for a class I'm taking. MOMRACE can take on 7 values, each corresponding to a different race. Because there are very few data points for 5, 6, and 7, I've been instructed to just combine them into a new dummy variable called "momother" for use in a multiple regression model. However, I can't seem to get the results I want.
Here's the code I've tried using:
generate momother = .
replace momother = 1 if MOMRACE == 5 | MOMRACE == 6 | MOMRACE == 7
replace momother = 0 if MOMRACE != . & (MOMRACE !=5 | MOMRACE != 6 | MOMRACE != 7)
I assumed this would make a new dummy that includes categories 5,6, and 7, but when I look at the new variable momother, all of the values are 0.
Any help would be great, thanks!
Comment