Slope
The slope of the least-squares line.
The formula:
Slope = [n∑(xy) - ∑(x)∑(y)]/[n∑(x²) - ∑(x)²]
Sample 1
Given the set of X and Y values where X and Y can represent any correlated values below:
V |
W |
1 |
2 |
2 |
4 |
3 |
6 |
4 |
8 |
5 |
10 |
6 |
12 |
7 |
14 |
8 |
16 |
9 |
18 |
10 |
20 |
Sample table
Steps:
1. Solve the parts of the formula:
Slope = ∑(xy) - ∑(x)∑(y)]/[n∑(x²) - ∑(x)²
n =count of items, equal to 10
∑(xy) = multiply all x and y items and get the sum = 770
1x2 + 2x4 + 3x6 + 4x8 + 5x10 + 6x12 + 7x14 + 8x16 + 9x18 + 10x20 = 770
∑(x) = sum of x items = 55
∑(y) = sum of y items = 110
∑(x²) = get the square of all x items and sum up the values. To square a number also means to multiply the number by itself.
1x1 + 2x2 + 3x3 + 4x4 + 5x5 + 6x6 + 7x7 + 8x8 + 9x9 + 10x10 = 385
∑(x)² = get the sum of all items in x and get the square = 55 * 55 or 3025
2. Substitute the known values in the formula and computed for the Slope:
Slope = [n∑(xy) - ∑(x)∑(y)]/[n∑(x²) - ∑(x)²]
Slope = [10(770) – 55(110)]/[10(385) – 3025]
Slope = [7700 – 6050]/3850-3025]
Slope = 1650/825
Slope = 2