1

Let there be two regressors $x_1$ is binary (i.e., takes on values $0$ and $1$) and $x_2$ is categorical with $3$ categories ($A$, $B$, and $C$). Write $E[y|x_1, x_2]$ as a linear regression.

So being a linear regression, then $E[y|x_1, x_2]$ must be linear in $x_1$ and $x_2$. So we can write $E[y|x_1, x_2] = \beta_1 x_1 + \beta_2 x_2 + \beta_3$ where $\beta_3$ is the intercept. But I am unsure of how to incorporate the dummy variable and categorical variable into the regression. Any help would be appreciated.

SwiftMo
  • 111
  • 2
  • Is this a homework/exercise/test question? If so, please add `[self-study]` tag and read its [wiki](http://stats.stackexchange.com/tags/self-study/info). – T.E.G. Oct 19 '17 at 03:44
  • It is an exercise in a book that I am self studying. After the reading a chapter on dummy and categorical variables, I came across this question. I have added self-study tag as you suggested. – SwiftMo Oct 19 '17 at 03:55
  • There are many questions on CV about categorical predictors in regression analysis. This question contains a hint on how to include $x_2$ in your model: https://stats.stackexchange.com/questions/115049/why-do-we-need-to-dummy-code-categorical-variables – T.E.G. Oct 19 '17 at 04:03
  • Thanks, I actually came across that question earlier, but I am still stuck. There are no examples of this sort in my textbook, so I was hoping if someone could show me the steps in doing this question that I'll be able to get the "hang" of it. – SwiftMo Oct 19 '17 at 04:19
  • To answer this question, we need to know *how* $x_3$ is quantified. There are multiple possibilities to create contrasts for a factor with three levels. – Sven Hohenstein Oct 19 '17 at 06:50
  • I see, how about $x_3 = \begin{cases} 1 & \text{ if } A \\ 2 & \text{ if } B \\ 3 & \text{ if } C \end{cases}$? The values have no meaning, they simply indicate the relevant category. – elbarto Oct 19 '17 at 06:57

0 Answers0