diff --git a/model-basics.Rmd b/model-basics.Rmd index 27e00e3..3dc09c6 100644 --- a/model-basics.Rmd +++ b/model-basics.Rmd @@ -352,7 +352,7 @@ The following sections expand on how this formula notation works for categorcal Generating a function from a formula is straight forward when the predictor is continuous, but things get a bit more complicated when the predictor is categorical. Imagine you have a formula like `y ~ sex`, where sex could either be male or female. It doesn't make sense to convert that to a formula like `y = x_0 + x_1 * sex` because `sex` isn't a number - you can't multiply it! Instead what R does is convert it to `y = x_0 + x_1 * sex_male` where `sex_male` is one if `sex` is male and zero otherwise: -```{r, echo = FALSE} +```{r} df <- tribble( ~ sex, ~ response, "male", 1,