Why Recurring Calendar Patterns Need Their Own Representation
An outcome that changes with enrollment time need not be following one steady upward or downward trajectory. Hospital admissions, for example, might rise each winter and fall each summer, while the average level also changes over several years. The repeating within-year pattern is seasonal drift; a persistent change in the underlying level over calendar time is a secular trend. In a response-adaptive trial, confusing the two can make an outcome model miss important structure, particularly when treatment assignments are unevenly distributed across calendar periods.
The earlier material on linear calendar-time adjustment and splines represents long-run changes with a time trend. Here the additional task is to encode a pattern that recurs at a known period, such as a year. A useful model can include both components, but the data must contain enough repeated calendar periods to distinguish them.
Seasonal Indicators With a Secular Trend
Suppose enrollment time is recorded in months, and the outcome has a possible annual pattern. A seasonal-indicator model assigns a separate mean shift to each month of the year, while a time variable represents secular change. For a trial with treatment indicator \(A_i\), one possible conditional-mean model is:
Here \(Y_i\) is participant \(i\)'s outcome, \(t_i\) is calendar time measured in years, \(C_i\) is the calendar month, and \(I(C_i=m)\) equals 1 when the participant enrolls in month \(m\), and 0 otherwise. January is the reference month, so \(\gamma_m\) is the modeled difference between month \(m\) and January at the same time and treatment assignment. The coefficient \(\beta_1\) is the modeled secular change in outcome per year. The treatment coefficient \(\tau\) is a constant treatment contrast in this model; this tutorial does not address models in which that contrast changes over time.
This representation assumes that the month-specific pattern repeats in the same form over the observed years, and that the secular component is adequately represented by the chosen time function. For the displayed linear version, it also assumes the conditional mean can be represented by these additive terms. It does not require normally distributed outcomes to define the mean model; additional assumptions are needed for particular standard-error and testing procedures. Seasonal indicators allow the month effects to take any shape, but they do not require adjacent months to have similar effects.
Worked Example: Seasonal Indicators and a Yearly Increase
Consider hypothetical quarterly average outcomes measured in units, with two observations per quarter: one in year 1 and one in year 2. The times are \(t=0\) and \(t=1\), measured in years since the first observation. The observed averages are:
| Quarter | Year 1, \(t=0\) | Year 2, \(t=1\) |
|---|---|---|
| Q1 | 52 | 56 |
| Q2 | 60 | 64 |
| Q3 | 48 | 52 |
| Q4 | 40 | 44 |
The outcome rises by 4 units from year 1 to year 2 in every quarter. Under an additive model with quarter indicators and a linear yearly trend, the estimated secular slope is therefore:
The average outcome in each quarter across the two years is Q1: \((52+56)/2=54\), Q2: \((60+64)/2=62\), Q3: \((48+52)/2=50\), and Q4: \((40+44)/2=42\). These averages describe the quarter pattern at the average observed time, \(t=0.5\). Relative to the overall average of \(52\), the quarter effects are \(+2,+10,-2,-10\) units. Thus the fitted mean can be written as an overall level of 52 units, plus the appropriate quarter effect, plus \(4(t-0.5)\) units. The large Q2-to-Q4 difference is recurring seasonal variation; the increase of 4 units per year is secular change. The example assumes a stable quarter pattern and a common linear yearly increase.
Cyclic Terms for Smooth Repeating Patterns
When a seasonal pattern is expected to vary smoothly across the calendar, it can be represented by sine and cosine terms. For a period \(P\), the first harmonic is:
The sine and cosine terms together allow the peak and trough to occur at different phases of the cycle. Adding harmonics permits more complex recurring shapes:
Each term repeats after \(P\) time units because adding \(P\) to \(t\) adds an integer number of full turns to the sine and cosine arguments. The value of \(K\) controls how much detail the model can represent. A small \(K\) gives a smooth cycle; more harmonics allow sharper changes but require more information in the data and can fit random fluctuations.
Worked Example: Calculating a Cyclic Pattern
Suppose hypothetical monthly outcome deviations from the overall level are modeled by one annual harmonic, with \(t=0\) at the start of January, \(P=12\) months, \(a_1=3\) outcome units, and \(b_1=2\) outcome units. The fitted seasonal component is:
At \(t=0\), the fitted deviation is \(3\cos(0)+2\sin(0)=3(1)+2(0)=3\) units. At \(t=3\), the argument is \(\pi/2\), so the deviation is \(3(0)+2(1)=2\) units. At \(t=6\), it is \(3(-1)+2(0)=-3\) units. At \(t=9\), it is \(3(0)+2(-1)=-2\) units. The value at \(t=12\) returns to \(3\) units, as required for an annual cycle. These fitted values describe a recurring seasonal component, not a decline of 6 units from month 0 to month 6: the cycle returns to its starting value after 12 months.
A secular term can be added separately, for example \(\beta_1t\). It would change the level from year to year while the sine and cosine contribution repeats. The assumed smooth annual shape is a modeling choice, not a guarantee that the real seasonal pattern is sinusoidal.
Why Repeated Cycles Separate Season From Trend
A simple way to see the distinction is to write the mean outcome as a linear trend plus a periodic component, \(m(t)=\beta_0+\beta_1t+g(t)\), where \(g(t+P)=g(t)\). Compare two observations at the same seasonal phase, separated by exactly one period. Their expected difference is:
The seasonal terms cancel because the phase is the same; the remaining difference identifies the change in level over one full period under this model. Dividing by \(P\) gives the linear trend per time unit. This argument depends on having repeated cycles and on the seasonal component being stable across them. It is a justification for the decomposition, not a guarantee that any particular finite sample will estimate its components precisely.
With observations from only one annual cycle, a low outcome in winter and a high outcome in summer can be described as seasonality, but it is difficult to establish that the pattern truly repeats rather than reflecting a one-time trend or another event. Multiple cycles, coverage of the same seasons in different years, and a defensible model are important for distinguishing recurring variation from secular change.
Worked Example: Seasonal Imbalance Can Mimic an Arm Difference
Suppose a hypothetical trial has four seasonal periods with mean outcomes of 10, 14, 18, and 22 units. Assume for this illustration that the treatment has no effect and that these outcome differences are entirely seasonal. Treatment A and Treatment B nevertheless have different enrollment distributions:
| Season | Mean outcome | Treatment A participants | Treatment B participants |
|---|---|---|---|
| 1 | 10 | 8 | 2 |
| 2 | 14 | 6 | 4 |
| 3 | 18 | 4 | 6 |
| 4 | 22 | 2 | 8 |
The unadjusted mean for Treatment A is:
For Treatment B, it is:
The raw difference, Treatment B minus Treatment A, is \(18-14=4\) units, even though the assumed treatment effect is zero. Within every season the treatment means are identical by construction. Standardizing both arms to the same seasonal distribution therefore gives a difference of zero. For example, giving each season weight \(1/4\) yields \((10+14+18+22)/4=16\) units for each arm. This example shows why a recurring outcome pattern can matter when allocation and enrollment timing are associated. Seasonal adjustment does not repair every design problem: the within-season comparisons must be supported by data, and the seasonal model must describe the relevant outcome pattern.
Diagnostics, Alternatives, and Limitations
A seasonal model should be assessed as a representation of the outcome pattern, not selected solely because calendar labels are available. Plot outcomes or model residuals against calendar time, marking the seasonal phase. A model that captures the recurring component should not leave a systematic month- or quarter-specific pattern in its residuals. Also compare the same seasons across successive years: if winter residuals, for example, become steadily more positive, the model may have missed a secular change or an evolving seasonal pattern.
- Check cycle coverage. Count how many full cycles are observed and whether important seasons are represented in multiple years. A partial cycle gives limited evidence about what recurs.
- Check seasonal support by arm. Tabulate treatment assignment and outcomes by season. If an arm is absent or nearly absent in a season, adjustment relies on extrapolation or imprecise comparisons.
- Check model complexity. Indicators use many parameters and can be unstable with sparse observations. A low-order cyclic model is more parsimonious but may miss abrupt or irregular seasonal shapes.
- Check whether the pattern is stable. If seasonal effects change in size or phase across years, a single repeating component may not fit. A recurring cycle should not be imposed merely because the calendar repeats.
Seasonal indicators are the main alternative to cyclic terms when the shape is unknown or may have abrupt differences between seasons. They make fewer assumptions about the shape but estimate a separate effect for each category. Cyclic terms are compact and naturally join the end of one cycle to the beginning of the next, but their smooth harmonic structure can be wrong. A secular spline, discussed in the earlier material on flexible trend adjustment, can represent nonlinear long-run change; it is not a substitute for seasonal terms unless its structure happens to capture the recurring pattern. These approaches can also be combined when the data support the added complexity.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A trial observes outcomes in February of two successive years, with the second-year mean 5 units higher. Under a stable annual pattern and a linear trend, what component does this same-month difference inform?
- For a cyclic model with \(P=12\), why must the seasonal contribution at \(t=1\) equal the contribution at \(t=13\)?
- In the four-season example, what is the standardized mean for either treatment arm when each season receives equal weight?
- What is one advantage and one limitation of seasonal indicators compared with a small number of sine and cosine terms?
Solutions. (1) Because both observations are at the same seasonal phase, the recurring seasonal component cancels; under the model, the 5-unit difference estimates the secular increase over one year. (2) Replacing \(t\) by \(t+12\) adds \(2\pi k\) to the argument of each harmonic, and sine and cosine are unchanged after a full number of turns. (3) The standardized mean is \((10+14+18+22)/4=16\) units for either arm, so the standardized difference is zero. (4) Indicators can represent an arbitrary pattern across the specified seasons, but may use many parameters and be unstable with sparse data. A small harmonic model is more parsimonious and smooth, but can misrepresent an irregular or abrupt seasonal pattern.