Session Ready
Exercise

Syntax from math

The babies data set contains observations about the birthweight and other characteristics of children born in the San Francisco Bay area from 1960--1967.

We would like to build a model for birthweight as a function of the mother's age and whether this child was her first (parity == 0). Use the mathematical specification below to code the model in R.

$$ birthweight = \beta_0 + \beta_1 \cdot age + \beta_2 \cdot parity + \epsilon $$

Instructions
100 XP

The birthweight variable is recorded in the column bwt.

  • Use lm() to build the parallel slopes model specified above. It's not necessary to use factor() in this case as the variable parity is coded using binary numeric values.