Statalist The Stata Listserver


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

Re: st: Panel Differences


From   "Stas Kolenikov" <[email protected]>
To   [email protected]
Subject   Re: st: Panel Differences
Date   Mon, 1 May 2006 14:10:38 -0500

you can -tsset- your data in the panel way:

tsset ID year

And then L.whatever should no longer be failing you.

On 5/1/06, Alexander Nervedi <[email protected]> wrote:
Hi,

I have data on a panle of 10 kids for 10 years observed approximately every
3 weeks. It kind of looks like as below.

For each child I'd like to get the difference in the date of interviews.
Simple things like

gen diff = interview - L1.interview fail me since the tsset command assumes
that the day preceeding the current interview date (i,t), is a (i, t-1)
where the t-1 is not specific to the i but for anyonein the data set.
Consequently interview(i, t-1) may well be missing.

I was wondering what the simplest way would be to get the average distance
between interview dates for each of these 10 kids over the 10 year period.

thanks.

alex


ID   year  interview
1      1      10
1      1      47
...
1      1    365
1      2      31
1      2      62
...
1      2    340
...
1     10    342
2      1     10

...

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

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


--
Stas Kolenikov
http://stas.kolenikov.name

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