Statalist The Stata Listserver


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

Re: st: Re: loop to fill in missing observations


From   "Carole J. Wilson" <[email protected]>
To   [email protected]
Subject   Re: st: Re: loop to fill in missing observations
Date   Fri, 15 Jun 2007 11:52:14 -0500

Fabrizio,

I am not entirely sure why -fillin- doesn't work for you here:

.list
countryn year elecn
|--------------------|
|    1   1990      1 |
|    1   1994      2 |
|    1   1994      3 |
|    1   1997      4 |
|    2   1995      3 |
|--------------------|
|    2   1999      4 |
|    2   1992      2 |
|    2   1989      1 |
|    2   2000      5 |
+--------------------+


.fillin countryn year

|------------------------------|
|    1   1989      .          1 |
|    1   1990      1         0 |
|    1   1992      .          1 |
|    1   1994      3         0 |
|    1   1994      2         0 |
|------------------------------|
|    1   1995      .          1 |
|    1   1997      4         0 |
|    1   1999      .          1 |
|    1   2000      .          1 |
|    2   1989      1         0 |
|------------------------------|
|    2   1990      .          1 |
|    2   1992      2         0 |
|    2   1994      .          1 |
|    2   1995      3         0 |
|    2   1997      .          1 |
|------------------------------|
|    2   1999      4         0 |
|    2   2000      5         0 |
+------------------------------+

if you need data for 75-2002, I assume you have data on some country
for each year.  If not, you add them for one country manually and then
-fillin-.

An alternative approach would be to use -merge- by creating country
and year data and merging it with your current data.

Am I missing something?

--Carole

_________________________________
      Carole J. Wilson
University of Texas at Dallas
School of Economic, Political,
     and Policy Sciences
     Phone: 972.883.4957
      Fax: 972.883.6571
    [email protected]
http://www.utdallas.edu/~cjwilson
__________________________________
*
*   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