Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: RE: RE: repeating the same analysis for each stratum


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: RE: repeating the same analysis for each stratum
Date   Wed, 30 Jul 2003 15:37:53 +0100

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 
[email protected] 

> -----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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index