Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: propagating values within same name for the following 11 months


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: propagating values within same name for the following 11 months
Date   Fri, 3 Oct 2008 20:01:31 +0100

This is an FAQ. 

FAQ     . . . . . . . . . . . . . . . . . . . . . . . Replacing missing
values
        2/03    How can I replace missing values with previous or
                following nonmissing values?
                http://www.stata.com/support/faqs/data/missing.html

Nick 
n.j.cox@durham.ac.uk 

Silke Rottenberg

I don't have much experience with stata: I merged two datasets using 
"date". The problem is that in using date there is only one observation 
per year (sales at the end of the business year, i.e. 02/1990 sales were

3000 units for the 12 months before; in 02/1992 1500 units for the 12 
months before) while master data have monthly observations (for other 
variables).

Now I want to do the following: within one company name, the value for 
sales should be propagated to the following 11months if there is a 
-missing(sales)- It should if there is already another value for sales 
within the following 11 months.


My data look like the following:

"date"                     "name"     "sales"
 
01/1990                     -            -  
02/1990                     A           3000
03/1990                     -            -
04/1990                     -            - 
..
11/1990                     -             -
12/1990                     -             -          
01/1991                     -             -        
02/1992                     A           1500     
03/1992                     -             -          
...
31/2006                     -             -          

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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