Dear All,
I would like to create a 5 month *follow up period* after a specific variable takes a value of 1. My data looks as follows:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(id month) float followup
52   1 .
52   2 .
52   3 .
52   4 .
52   5 .
52   6 .
52   7 .
52   8 .
52   9 .
52  10 .
52  11 .
52  12 .
52  13 .
52  14 .
52  15 .
52  16 .
52  17 .
52  18 .
52  19 .
52  20 .
52  21 1
52  22 .
52  23 .
52  24 .
52  25 .
52  26 .
52  27 1
52  28 .
52  29 .
52  30 .
52  31 .
52  32 .
52  33 .
52  34 .
52  35 .
52  36 .
52  37 .
52  38 .
52  39 .
52  40 .
52  41 .
52  42 .
52  43 .
52  44 .
52  45 .
52  46 .
52  47 .
52  48 1
52  49 .
52  50 .
52  51 .
52  52 .
52  53 .
52  54 .
52  55 .
52  56 .
52  57 .
52  58 .
52  59 .
52  60 .
52  61 .
52  62 .
52  63 .
52  64 .
52  65 .
52  66 .
52  67 .
52  68 .
52  69 .
52  70 .
52  71 .
52  72 .
52  73 .
52  74 .
52  75 .
52  76 .
52  77 .
52  78 .
52  79 .
52  80 .
52  81 .
52  82 .
52  83 .
52  84 .
52  85 .
52  86 .
52  87 .
52  88 .
52  89 1
52  90 .
52  91 .
52  92 .
52  93 .
52  94 .
52  95 .
52  96 .
52  97 .
52  98 .
52  99 .
52 100 .
end
So each time the variable followup==1, I want to replace F1.followup-F5.followup==1. For instance, after followup==1 in month 21, I would like to replace followup in months 22-26 with 1 as well. But I get an error when I try to do this:

Code:
 bysort id: replace F1.followup=1 if followup==1
factor variables and time-series operators not allowed
r(101);
I am not sure why time series operator is not working in this case as it seems to work otherwise. I will be grateful for your help.
Sincerely,
Sumedha.