I have two questions about multi linear regression model.

First question. Suppose 2 independent samples

Sample1 : $y_1$, ... $y_{n_1}$ and $x_1$, ..., $x_{n_1}$

Sample2 : $y_{n_1 +1}$, ... $y_{n_1 +n_2}$ and $x_{n_1 +1}$, ..., $x_{n_1 +n_2}$

and each samples fit in the models as follows :

Sample 1 : $y_i$ = $\beta_0$ + $\beta_1$$x_i$ + $\epsilon$ for i = 1,2,...,$n_1$

Sample 2 : $y_i$ = $\gamma_0$ + $\gamma_1$$x_i$ + $\epsilon$ for i = $n_1 +1$,...,$n_1+n_2$

I want to unite these two models into a single model. How can i do this? I have considered a multi linear regression model with two regressor x and x' where x is from sample1, x' is from sample2. but I can't deal with the constant part.

Second question.

In my text book, the definition of $SS_R$, the regression sum of square is ($\hat{y}-\bar{y})^t$($\hat{y}-\bar{y}$) using matrix notation and its degree of freedom is k which is the number of regressors in the model. but I have also seen that in the text book, it is written that the regression sum of square $SS_R (\beta)$ = $\hat{\beta}^tX^t$y which is equal to $\hat{y}^t$$\hat{y}$ and its degree of freedom is k+1. Why $SS_R$ has two different formula?


Hoping that I properly understood the first question : for each data point create a binary variable $z_i$ which is $1$ if the data point come from the first sample and $2$ if the data point come from the second sample. Since the model is multilinear, you now have to fit $$y=(a+bz)+(c+dz)x=\alpha+\beta z+\gamma x+\delta x z$$ so three regressors ($x,z,xz$).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.