Can anyone help with the set up of a multiple variable regression function that does not have an intercept (no beta hat 0)? I've tried to figure it out based on class notes for one variable regression without an intercept and multiple variable regression with an intercept but my answers seem way way off.
-
1$\begingroup$ Do you mean, in some kind of software? Mathematically? $\endgroup$– John MaddenCommented Oct 27, 2022 at 19:41
-
$\begingroup$ Either excel or mathematically. For my econometrics class $\endgroup$– BradenCommented Oct 27, 2022 at 19:47
-
$\begingroup$ Preferably mathematically, but either works $\endgroup$– BradenCommented Oct 27, 2022 at 20:05
-
1$\begingroup$ If mathematically, just leave out the $\beta_0$ in the regression function. $\endgroup$– jbowmanCommented Oct 27, 2022 at 20:08
-
$\begingroup$ Regression is about fitting data to a line, and lines must intercept the axes. $\endgroup$– BenCommented Oct 27, 2022 at 20:09
1 Answer
Ditch the intercept term and fit as usual. Unlike in regression with an intercept, the model matrix (typically denoted by $X$) will not have a column of $1$s. However, if you make a matrix $X$ with each vector of variable values as a column, then the usual equation works: $\hat\beta=(X^TX)^{-1}X^Ty$.
At least in R software, the reported $R^2$ sneakily uses a different formula than usual. While this choice can be defended, it is worth knowing that it does this and that other software might, too. Their $R^2$ in this situation is:
$$ R^2=1-\dfrac{\sum\left( y_i-\hat y_i \right)^2}{ \sum y_i^2 } $$
-
$\begingroup$ You may also want to point out explicitly how exactly this $R^2$ differs from the usual one. $\endgroup$ Commented Oct 28, 2022 at 6:47