I am running bivariate probits for several outcomes using the same set
of variables on the right hand side. Then I am using the adjust
command to calculate the predicted probabilities for each age holding
the Xs constant for the whole sample (at the e(sample) mean). Here's
my simplified code:
foreach outcome in o1 o2 o3 {;
probit `outcome' age age2 x1 x2 x3;
adjust x1 x2 x3 if e(sample), pr by(age age2) gen(`outcome'_hat)
}
However, in some of the specifications, x1 predicts failure perfectly,
and is dropped. When I try to use the adjust command, it fails because
the dropped variable is not used in last estimation. I tried including
the names of the included variables in a local:
foreach outcome in o1 o2 o3 {;
probit `outcome' age age2 x1 x2 x3;
adjust `=subinstr("`:colfullnames e(b)'","_cons","",.)' if e(sample),
pr by(age age2) gen(`outcome'_hat)
}
Unfortunately, this does not work when I have a lot of Xs because the
local is too long. Is there a way to get Stata to do what I want?
Dimitriy
*
* 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/