# Show regression line passes through points $(X_1,\bar{Y_2}),(X_2,\bar{Y_2})$

Assuming a simple linear regression model , $$n_1$$ points are sampled at $$X_1$$ and $$n_2$$ at $$X_2$$ and let $$\bar{Y_1} , \bar{Y_2}$$ be the averages at $$X_1 , X_2$$ respectively. The problem that I am struggling with is to show that that the regression line with least squares estimates of parameters passes through the points $$(X_1,\bar{Y_2}),(X_2,\bar{Y_2})$$.

I have tried putting in $$X_1$$ into the equation and hoping to get $$\bar{Y_1}$$ back to prove that the point lies on the line but I end up with a term looking like $$\frac{n_1\bar{Y_1}+n_2\bar{Y_2}}{n_1+n_2}+ \frac{n_1(X_1-\bar{X})\bar{Y_1}+n_2(X_2-\bar{X})\bar{Y_2}}{\sum(X_i-\bar{X})^2}$$

I'm not sure if I've made a mistake here or that this is actually reducible to $$\bar{Y_1}$$ and I just haven't noticed how.

Recall the simple regression line formula is: $$\hat{y} = \hat{\theta}_0 + \hat{\theta}_1 x$$
Plugging in $$(\bar{x}, \bar{y})$$, we get: $$\bar{y} = \hat{\theta}_0 + \hat{\theta}_1 \bar{x}$$
We can substitute $$\hat{\theta}_0 = \bar{y} - \hat{\theta}_1 \bar{x}$$ to get: $$\bar{y} = \bar{y} - \hat{\theta}_1 \bar{x} + \hat{\theta}_1 \bar{x}$$
Which simplifies to: $$\bar{y} = \bar{y}$$
The equation is valid, which means the point $$(\bar{x}, \bar{y})$$ lies on the line.