Skip to main content
Statistics LibreTexts

12.2: Coding for Carry-Over Covariates

  • Page ID
    33196
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The late Dr. Steve Arnold (Penn State), came up with a satisfactory solution to account for carry-over effects in the data analysis. The following example will illustrate how the procedure works. The data can be found in the textbook Design of Experiments, by Kuehl, as Example 16.1. Investigators want to evaluate the effect of 3 diets on Neutral Detergent Fiber (NDF) levels in steer. The three diets are administered to each steer in a sequence over 3 periods. A total of 6 sequences were used and two steers were assigned to each sequence of treatments.

    The cross-over design can be summarized as:

    Period
    Sequence 1 2 3
    1 A B C
    2 B C A
    3 C A B
    4 A C B
    5 B A C
    6 C B A

    If we look at the first part of the dataset (Steer Data) for this example in Excel, we can see the following:

    Screenshot of steer dataset in Excel with columns A through E containing the following data in order: period, sequence, diet, steer, and NDF level.
    Figure \(\PageIndex{1}\): First five columns of steer dataset in Excel.

    We need now to add two columns to use an effect-type coding for the 3 treatment levels. We can use:

    \(x_1\) \(x_2\)
    A 1 0
    B 0 1
    C -1 -1

    Where \(x_{1}\) and \(x_{2}\) will be columns we create in the data to input for all of the rows of data. The coding values depend on which treatment level is administered during the previous period. For example, if treatment A was administered in the previous period, then coding values would be \(x_{1}=1, x_{2}=0\).

    There will be no entries for the first period because on the first application of each treatment there are no treatments that have preceded it. Therefore a 0 is used as the coding value for both \(x_{1}\) and \(x_{2}\).

    The Excel spreadsheet from Figure 1 above, with additional columns F and G containing x1 and x2 respectively.
    Figure \(\PageIndex{2}\): Steer dataset, including \(x_{1}\) and \(x_{2}\), in Excel.

    Looking at Period 2, sequence 1, treatment B we can refer back to the Sequence chart and see that it was preceded by treatment level A, so we assign \(x_{1}=1\), and \(x_{2}=0\), indicating that it was treatment A that could produce a carry-over effect here.

    Excel screenshot with arrows showing that steer 1 in period 2, sequence 1, treatment B, has x1 = 1 and x2 = 0 because it was proceeded by sequence 1, treatment A in period 1.
    Figure \(\PageIndex{3}\): Identifying the carry-over effects using the spreadsheet.

    The process can be repeated to define the coding variables to each entry in the dataset. The coded variables \(x_{1}\) and \(x_{2}\) are then entered into the general linear model as continuous covariates and LSmeans for treatments are adjusted for carry-over effects.


    This page titled 12.2: Coding for Carry-Over Covariates is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Penn State's Department of Statistics via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.