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]

Re: st: inserting new observations between two consecutive observations

From   Nick Cox <>
Subject   Re: st: inserting new observations between two consecutive observations
Date   Wed, 27 Feb 2013 14:53:20 +0000

Not so. Find out about -fillin-. You just need to add the new values
of -year- once each and -fillin- will do the result.

Also, Rich is right and speaks from much experience: the idea that the
observations must be added in the middle is a distraction here. In
Stata it is easiest to add observations at the end and then -sort-.


On Wed, Feb 27, 2013 at 1:18 PM, James Bernard <> wrote:

> Well, the panel is to long and there are a few other variables. I
> would need to type every firm name again

On Wed, Feb 27, 2013 at 9:13 PM, Richard Goldstein

>> why not just add them at the end (or anywhere else) and then sort by
>> Firm Year?

On 2/27/13 8:06 AM, James Bernard wrote:

>>> I was wondering if you know of any way for adding new observations
>>> between two consecutive observations.
>>> Firm           Year
>>> --------         ----------
>>> A               1990
>>> A               1991
>>> A               1992
>>> B               1990
>>> B                1991
>>> B               1992
>>> C                1990
>>> C                 1991
>>> C                  1992
>>> I want to add years 1993 and 1994 to the year, so it has to be
>>> replaced between A-1992 and B-1990.
>>> I thought of -replace- command and using the loop (knowing that the
>>> length for each panel is 3). but that would not work as it replaces
>>> the observations. It does not insert.
*   For searches and help try:

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