1. Learn
  2. /
  3. Courses
  4. /
  5. Data Analysis and Statistical Inference

Exercise

Gendermale

Note that the estimate for gender is called gendermale in your summary output. You'll see this name change whenever you introduce a categorical variable. The reason is that R recodes gender from having the values of female and male to being an indicator variable called gendermale that takes a value of 0 for females and a value of 1 for males. (Such variables are often referred to as 'dummy' variables.)

As a result, for females, the parameter estimate is multiplied by zero, leaving the intercept and slope form familiar from simple regression. $$\begin{align*} \widehat{\mathrm{score}} &= b_0 + b_1 \times \mathrm{bty_avg} + b_2 \times (0) \ &= b_0 + b_1 \times \mathrm{bty_avg} \end{align*}$$

Instructions

100 XP

Plot this line and the line corresponding to males with the following custom function multiLines(m_bty_gen)