# Linear Regression Through a Point

#### timmo567

##### New Member
Hi Everyone, I'm trying to find the slope of the regression line with the least squares fit which passes through a certain point $$(x_0,y_0)$$

The equation for my line is $$y=a(x-x_0)+y_0$$ so that at $$x=x_0, y=y_0$$ as required.
I can find the slope if the line equation is the standard $$y=ax+b$$ using the formula given here (for $$\hat{\beta}$$) http://en.wikipedia.org/wiki/Simple_linear_regression but I am unsure how to go through the same steps for the form of $$y$$ which I require.

From that wiki page, the slope of the standard $$y=\hat\beta x+\alpha$$ is $$\hat\beta = \frac{ \sum_{i=1}^{n} (x_{i}-\bar{x})(y_{i}-\bar{y}) }{ \sum_{i=1}^{n} (x_{i}-\bar{x})^2 }$$ where $$\bar{x} \mbox{ and } \bar{y}$$ are the mean of all $$x_i \mbox{ and } y_i$$
I'm hoping to find a similar equation for my form of $$y$$ ($$y=a(x-x_0)+y_0$$) where $$(x_0,y_0)$$ is the coordinate which the best fit line must pass through.

Thanks for any help, Tim
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.943828821182251, "perplexity": 190.75374937972387}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-40/segments/1600400221980.49/warc/CC-MAIN-20200925021647-20200925051647-00270.warc.gz"}