I think you have to read the data in again after -dropping-
most of it....
forvalues k= 1(1) 26 {
use mydata, clear
drop if kt~=`k'
do test.do
}
Nick
n.j.cox@durham.ac.uk
> -----Original Message-----
Phung Lang
>
> Many thanks to Thi Minh, Carrie and Bryan for their helpful
> comments. I
> tried to run the short program TM suggested, but found that
> it does not
> work for all 26 strata. It does the analysis for only one
> stratum and then
> stops, saying that there are no more observations in the
> database or a
> certain variable cannot be found (which is not originally
> in the database).
> Is it suppose to loop, so that the analysis is repeated for
> each of the 26
> stratum? If not, how can it be corrected so that it will
> loop 26 times, for
> each stratum?
>
> Here are my survey settings:
> pweight is fwtia
> strata is kt
> psu is cluster
>
> and the program:
>
> forvalues k= 1(1) 26 {
> drop if kt~=`k'
> do test.do
> }
>
*
* 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/