Interactions

We can add another layer to relax these estimates even further by allowing both lines to have different slopes in addition to different intercepts.

  1. A collection of different regression lines for both genders.
  2. A collection of parallel regression lines,
  3. A single regression line so that there is no difference .

We shall use the notation:

\(y_{ij}\) : response observation \(j\) in group \(i\). For example, the weight of person \(j\) of gender \(i\).

\(x_{ij}\) : explanatory variable observation \(j\) in group \(i\). For example, the height of person \(j\) of gender \(i\).

\(n_i\) : sample size in group \(i\), for example, the number of people of gender \(i\).

\(p\) : number of groups. In this case \(p=2\) corresponding to males and females.

\(n\) : \(\sum_{i=1}^pn_i\) , total sample size. That is the total number of people

The most general model could be formulated as

\[\begin{equation*} E(Y_{ij}) = \alpha_i+\beta_ix_{ij} \end{equation*}\]

as group \(i\) has its own slope and intercept.

The models of interest can now be expressed as:

  1. different lines: \(E(Y_{ij}) = \alpha_i+\beta_i x_{ij}\).
  2. parallel lines: \(E(Y_{ij}) = \alpha_i+\beta x_{ij}\)
  3. single line: \(E(Y_{ij}) = \alpha+\beta x_{ij}\),

Each model has a different number of regression coefficients.

  1. \(\begin{aligned} \boldsymbol{\beta} &=&\left( \begin{array}{c} \alpha_1 \\ \beta_1\\ \alpha_2\\ \beta_2 \end{array} \right)\end{aligned}\)
  1. \(\begin{aligned} \boldsymbol{\beta} &=&\left( \begin{array}{c} \alpha_1 \\ \alpha_2\\ \beta\\ \end{array} \right)\end{aligned}\)
  1. \(\begin{aligned} \boldsymbol{\beta} &=&\left( \begin{array}{c} \alpha \\ \beta \end{array} \right)\end{aligned}\)

If the relationship between the response variable \(y\) and continuous variable \(x\) is different for each level of a factor, or categorical variable, then we refer to this as an interaction. For example, if the intercept and slope of the relationship between height and weight is different depending on gender then this is referred to as an interaction between the explanatory variable height and binary variable gender.