I would like to loop through several categorical variables, run
regressions of an outcome on these variables using the "xi" command,
and then manipulate the regression results for each dummy variable
created by xi. However, with long variable names, xi truncates the
names of the newly created dummy variables, so I am unable to refer to
variable "_Ilongvariablename" after running the regression. Does
anyone know of a solution (other than giving my variables shorter
names)?
Here is an example of my code:
foreach var of varlist a b c longvariablename d e f g {;
xi: svy: outcome i.`var' ;
postfile `results' beta se using `signif';
foreach binary of varlist _I`var'_* {;
post `results' (_b[`binary']) (_se[`binary']) ;
};
postclose `results';
};
Many thanks,
Melissa
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/