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

RE: st: filling previous missing observations repeatedly.


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: filling previous missing observations repeatedly.
Date   Mon, 12 Jul 2004 18:07:08 +0100

This is not going to work for reasons I gave 
and for reasons I alluded to in an earlier 
posting. 

-while- does not buy you a loop over observations 
unless you ask for that explicitly. 

Also, Stata is going to interpret this as 

while b[1] == . { 
	...
}

so, depending on b[1], the loop is either never
entered or infinite. 

Nick 
[email protected] 

[email protected]
 
> How about this:
> 
> 
> while b == . {
> 	replace b=b[_n+1]*c if b==. & year <1999
> 	replace b=b[_n-1]*c if b==. & year >1999
> }

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