- #1

Vital

- 108

- 4

I have listened to a great lecture, which gave helpful intuitive insight into correlation and regression (basic stuff). But there are formulas, which I cannot grasp intuitively and don't know their origin. To remember them I would like to understand what's happening in each part of the formula and why these mathematical combinations are used to get the desired result, i.e. I would like to understand both mathematically and intuitively what's happening in those formulas.

I will be grateful for your patience and your help.

**The first**one is for the slope, and the second - for y-intercept

(both formulas below are used for variables in a simple linear relationships formula

y = y-intercept + slope multiplied by x).

**slope = [ n×Σxy - ΣxΣy ] / [ n×Σx^2 - (Σx)^2 ]**

I have "whys" about each part of this formula:

numerator

- why we take the sum of xy

- why we then multiply that sum by n (the number of elements) and what is the meaning and role of the result

- why we subtract from the previous result the sum of x multiplied by the sum of y

denominator

- why we take the sum of x squared

- why we then multiply it by n

- why we take the sum of all x and then square the result

- why we subtract the first from the second

formula

- why we use [n×Σxy - ΣxΣy] for numerator and [n×Σx^2 - (Σx)^2 ] for the denominator,

how do they work together, and what is the intuition behind the process?

**The second**one is for the y intercept:

**intercept = [ Σy/n ] - slope x [ Σx / n]**

Same questions here.And finally what is more confusing is that

**[ Σx / n]**is called a margin of error. Why is this called a margin of error if it looks as a formula for finding the average value of x, given n elements. Thank you.