Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Fill in values for year in an unbalanced panel with known order


From   Fernando Luco <[email protected]>
To   [email protected]
Subject   st: Fill in values for year in an unbalanced panel with known order
Date   Tue, 23 Oct 2012 11:07:22 -0500

Hi all,

I'm trying to fill in the year of observations for which I know the
month and because of the order, I have no doubt about the year.
However, the year was not recorded. In particular, the data looks as
follows

id year month
1 1988 5
1 . 6
1 . 7
1 . 8
1 . 9
1 . 10
1 . 11
1 . 12
1 . 1
1 1989 2
1 1989 3
1 . 4
2 . 3
2 1989 4
2 1989 5
2 . 6
2 . 7
2 . 8
2 1989 9
2 . 10
2 . 11
2 . 12
2 . 1
2 1990 2
2 . 3

So, it is an unbalanced panel, that for each id might start and end at
a different year month combination, and I know that the order of the
observations within id is correct, so I'm sure that the first
observation for id==2 is of 1989 while the second observation that has
id==2 and month==3 (the last observation in the example) corresponds
to 1990. The main complication is that for some people I might have a
gap of more than one year between observations, which has made things
difficult. I would like to use the structure of the data to fill in
the data for year.

Any ideas?

Thanks,

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index