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

st: RE: How do I fill in missing values using last-observation-carried-fo rward (LOCF) in stata


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: How do I fill in missing values using last-observation-carried-fo rward (LOCF) in stata
Date   Tue, 13 Jan 2004 17:52:11 -0000

Joseph Coveney and Tom Steichen posted solutions.

For more detailed discussion, see
http://www.stata.com/support/faqs/data/missing.html

Nick
[email protected]

[email protected]
>
> Is there an easy way of implementing the following task in
> STATA? (It
> sounds a very easy task, but it goes beyond my limited
> knowledge of STATA.)
>
> Say, I have a data series with two variables: date, dummy
>
> date      dummy
> 1/1/03      1
> 1/2/03      .
> 1/3/03      3
> 1/4/03      .
> 1/5/03      .
> 1/7/03      2
> 1/8/03      .
> 1/9/03      .
> 1/10/03    .
> 1/11/03    4
> 1/12/03    .
> 1/13/03    .
> .......
>
> I just want to fill the missing value, using the previous
> value until it
> changes (or the last-observation-carried-forward method), ie, to get
>
> date      dummy
> 1/1/03      1
> 1/2/03      1
> 1/3/03      3
> 1/4/03      3
> 1/5/03      3
> 1/7/03      2
> 1/8/03      2
> 1/9/03      2
> 1/10/03    2
> 1/11/03    4
> 1/12/03    4
> 1/13/03    4
> .......

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