
The variation lies in limiting how far non-missing values are copied. This is a variation on a problem documented since 2000 as an FAQ: see here Is there a way to do this, either with carryforward or otherwise? I've tried setting this up with the "carryforward" command, but haven't figured out how to have it stop filling down after a specified number of years that varies by group. I'd want to carry 2004's value into 2005, 2006, and 2007, but not beyond that-the later years should stay missing. Similarly, in group B, I'd want to carry 2000's value forward into years 2001, 2002, and 2003 (because the "cyclelength" here is 4 years). And I ALSO wouldn't want to fill in the 2011 value, because the "cyclelength" variable tells me that group A's observations are supposed to take place every two years, so I don't want to carry data forward past that. I wouldn't want to fill in 2000 at all, since I don't have the preceding value. So for example, I could have a dataset that looks like this:įor group A, I'd want to fill in the value for 2002 with 2001's value, 2004 with 2003, etc. But I only want to do this for a certain number of rows after the original observation. I'm trying to "fill down" the data so that existing observations are carried down into missing cells. I have a dataset with observations at specific timepoints, but those timepoints (and the length of time between them) vary by group.
