Perform linear regression to find relationships between variables. Input data points to calculate the best-fit line, essential in statistics, economics, and scientific research.
Linear regression is used to model the relationship between two variables. The formula for a straight line is:
y = mx + b
The slope (m) and intercept (b) are calculated using the following formulas:
m = (NΣxy - ΣxΣy) / (NΣx² - (Σx)²)
b = (Σy - mΣx) / N
Where:
X values: 1, 2, 3, 4, 5
Y values: 2, 4, 6, 8, 10
Solution: Slope (m) = 2, Intercept (b) = 0
X values: 1, 3, 5, 7, 9
Y values: 2, 6, 10, 14, 18
Solution: Slope (m) = 2, Intercept (b) = 0
X values: 2, 4, 6, 8, 10
Y values: 1, 3, 5, 7, 9
Solution: Slope (m) = 1, Intercept (b) = -1
X values: 0, 1, 2, 3, 4
Y values: 5, 4, 3, 2, 1
Solution: Slope (m) = -1, Intercept (b) = 5
X values: 1, 2, 3, 4, 5
Y values: 3, 5, 7, 9, 11
Solution: Slope (m) = 2, Intercept (b) = 1
X values: 1, 4, 7, 10, 13
Y values: 2, 8, 14, 20, 26
Solution: Slope (m) = 2, Intercept (b) = 0
X values: 2, 5, 8, 11, 14
Y values: 1, 4, 7, 10, 13
Solution: Slope (m) = 1, Intercept (b) = -1
X values: 1, 2, 3, 4, 5
Y values: 1, 2, 1, 2, 1
Solution: Slope (m) = 0, Intercept (b) = 1.5
X values: 1, 3, 5, 7, 9
Y values: 9, 5, 3, 5, 9
Solution: Slope (m) = 0, Intercept (b) = 6.2
X values: 1, 4, 7, 10, 13
Y values: 2, 5, 8, 11, 14
Solution: Slope (m) = 1, Intercept (b) = 1
X values: 1, 2, 3, 4, 5
Y values: 3, 7, 11, 15, 19
Solution: Slope (m) = 4, Intercept (b) = -1
X values: 1, 3, 5, 7, 9
Y values: 1, 3, 5, 7, 9
Solution: Slope (m) = 1, Intercept (b) = 0
X values: 2, 3, 4, 5, 6
Y values: 3, 6, 9, 12, 15
Solution: Slope (m) = 3, Intercept (b) = -3
X values: 0, 1, 2, 3, 4
Y values: 10, 9, 8, 7, 6
Solution: Slope (m) = -1, Intercept (b) = 10
X values: 1, 4, 6, 8, 10
Y values: 2, 5, 7, 9, 12
Solution: Slope (m) = 1.2, Intercept (b) = 0.8
X values: 1, 2, 3, 4, 5
Y values: 2, 2.5, 3, 3.5, 4
Solution: Slope (m) = 0.5, Intercept (b) = 1.5
X values: 1, 2, 3, 4, 5
Y values: 10, 8, 6, 4, 2
Solution: Slope (m) = -2, Intercept (b) = 12
X values: 1, 3, 5, 7, 9
Y values: 3, 6, 7, 8, 11
Solution: Slope (m) = 0.8, Intercept (b) = 2.2
X values: 0, 2, 4, 6, 8
Y values: 5, 7, 9, 11, 13
Solution: Slope (m) = 1, Intercept (b) = 5
X values: 1, 2, 3, 4, 5
Y values: 4, 5, 6, 7, 8
Solution: Slope (m) = 1, Intercept (b) = 3