Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Closing gaps in STATA panel

From   Morten Hesse <>
To   stata list <>
Subject   st: Closing gaps in STATA panel
Date   Mon, 20 Sep 2010 11:07:14 +0200

Dear stata-listers,

I would like to request help for a problem with panels.

What I have is this:

I have a list of observations that indicate "events". These have a date and a subject ID.

Using "collapse" I have turned them into a panel with ID and time (years).

When the event has not occurred within a year, the observation year does not exist. That is, there are gaps in the panel.

I would like to add observation years for each ID with the value "0" to the event, when there is no event - essentially to close the gaps.

As my original dataset with events is the only relevant source of information about the events, the values should be zeroes.

I have tried to read about tsappend, but I could not figure out how to use this command for this end.

Any ideas?

Best regards
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index