Hello everyone 
I apologize in advance if this question has already been asked.
I have a variable var1 "births in the past year" coded as 1=yes (the respondent has given birth in the past year), 0=no (the respondent has not given birth in the past year);
and a variable var2 "currently pregnant", where 1=yes (the respondent was pregnant at the time of the interview), 0=no (the respondent was not pregnant).
I need to create a third variable, var3, coded as
1=respondents who gave birth in the past year and respondents who are pregnant (category=1 of var1+var2), 0=respondents who have not given birth in the past year (as =0 in var 1).
Or, to put it in another way, I would like to add to the category =1 of var1, the category=1 of var2.
I tried by using the -stack- command, but I need something that does not delete the rest of my dataset.
I hope I made myself clear, thank you!
Virginia

I apologize in advance if this question has already been asked.
I have a variable var1 "births in the past year" coded as 1=yes (the respondent has given birth in the past year), 0=no (the respondent has not given birth in the past year);
and a variable var2 "currently pregnant", where 1=yes (the respondent was pregnant at the time of the interview), 0=no (the respondent was not pregnant).
I need to create a third variable, var3, coded as
1=respondents who gave birth in the past year and respondents who are pregnant (category=1 of var1+var2), 0=respondents who have not given birth in the past year (as =0 in var 1).
Or, to put it in another way, I would like to add to the category =1 of var1, the category=1 of var2.
I tried by using the -stack- command, but I need something that does not delete the rest of my dataset.
I hope I made myself clear, thank you!
Virginia
Comment