It seems to me that you have had lots
of good suggestions, and the onus is
on you to tweak them according to
the idiosyncrasies of your data, which
we can only guess at.
What will be troublesome is if any of those
100 possibilities doesn't meet the
assumptions of -treatreg-. Slapping
capture noisily
in front may help, e.g.
forvalues i=1/100 {
di `i'
capture noisily treatreg y a b if d==`i', treat(c= l m n ) twostep
}
Nick
[email protected]
FUKUGAWA Nobuya, Ph.D.
[email protected]
> Thank you for your answers.
> A correct model does not include "c" in the main equation.
> treatreg y a b , treat(c= l m n) twostep
> My intention was to list selection-corrected coefficients of
> "c" according to
> "d" varying between 1 and 100.
>
> One suggestion was as follows.
> xi: treatreg y a b i.d*c , treat(c=l m n) twostep
> This model works while I am not sure if it is appropriate to
> specify "i.d*c" in
> the main equation.
>
> Another suggestion was as follows.
> statsby, by(d):treatreg y a b , treat(c=l m n) twostep
> I obtained error message "treat() invalid r(198);" while the
> difference between
> this model and the example shown below is unclear.
>
> The last suggestion was as follows.
> forvalues i=1/100 {
> treatreg y a b if d==`i', treat(c= l m n ) twostep
> }
> I obtained error message "treatments do not vary r(2000);".
>
> Any further suggestion will be appreciated.
*
* 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/