Dear Statalist,

Suppose I have the following dataset:

Code:
input state dist year value
1 1 1990 10
1 1 1991 20
1 1 1992 30
1 1 1993 40
1 1 1994 50
1 1 1995 60
1 1 1996 70
1 1 1997 80
1 1 1998 90
1 1 1999 100
1 1 2000 110
end
My object is to use certain values for different sets of years (of unequal length). For example, I would like to use the 1990 value for all years between 1990-1993, the 1994 value for all years between 1994-1995, and the 1996 value for all years between 1997-2000.

While at first I thought I could use a replace with an [_n-#] modifier, the unequal time spans (and sometimes missing start/end points) are proving challenging. Is there an alternative to replace I am missing?

Best,

Jeff