Hello all,
i have this code,
forvalues i=97(2)99{;
generate Wife`i'=.;
generate Head`i'=.;
};
forvalues i=97(2)99{;
replace Wife`i'=1 if (SN`i'==2 & (Rel`i'==20 | Rel`i'==22));
replace Head`i'=1 if SN`i'==1 & Rel`i'==10;
};
My problem is that it creates the Wife97.......Head99 variables fine. But when it reaches the second loop, it says that Wife is a "Ambiguous abbreviation". I can't seem to figure out why. I tried setting the 'varabbrev off' but if I do that, in the second loop it says that the variables do not exist. How can I get around this? Thank you for your help.
i have this code,
forvalues i=97(2)99{;
generate Wife`i'=.;
generate Head`i'=.;
};
forvalues i=97(2)99{;
replace Wife`i'=1 if (SN`i'==2 & (Rel`i'==20 | Rel`i'==22));
replace Head`i'=1 if SN`i'==1 & Rel`i'==10;
};
My problem is that it creates the Wife97.......Head99 variables fine. But when it reaches the second loop, it says that Wife is a "Ambiguous abbreviation". I can't seem to figure out why. I tried setting the 'varabbrev off' but if I do that, in the second loop it says that the variables do not exist. How can I get around this? Thank you for your help.
Comment