From b1fb15a410631464765280b309eb37e1b60ecf3d Mon Sep 17 00:00:00 2001 From: Mitsuo Shiota <48662507+mitsuoxv@users.noreply.github.com> Date: Tue, 9 Feb 2021 02:35:02 +0900 Subject: [PATCH] x_1 denotes a variable, while a_1 denotes a parameter (#920) --- model-basics.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model-basics.Rmd b/model-basics.Rmd index a353785..9846130 100644 --- a/model-basics.Rmd +++ b/model-basics.Rmd @@ -350,7 +350,7 @@ The following sections expand on how this formula notation works for categorical ### Categorical variables -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: +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 = a_0 + a_1 * sex` because `sex` isn't a number - you can't multiply it! Instead what R does is convert it to `y = a_0 + a_1 * sex_male` where `sex_male` is one if `sex` is male and zero otherwise: ```{r} df <- tribble(