Linear regression is a statistical method used to model the relationship between two variables by fitting a linear equation to observed data. One variable is considered to be an explanatory variable (X), and the other is considered to be a dependent variable (Y).

1. Slope (B): \[B = \frac{n\sum xy - \sum x \sum y}{n\sum x^2 - (\sum x)^2}\] Where n is the number of data points, x and y are the variables.

2. Intercept (A): \[A = \bar{y} - B\bar{x}\] Where \(\bar{x}\) and \(\bar{y}\) are the means of x and y respectively.

3. Regression Equation: \[Y = BX + A\] This is the final equation that describes the linear relationship between X and Y.

- Calculate the sums: \(\sum x\), \(\sum y\), \(\sum xy\), and \(\sum x^2\)
- Calculate the means: \(\bar{x}\) and \(\bar{y}\)
- Use the formula to calculate the slope (B)
- Use the formula to calculate the intercept (A)
- Form the regression equation: Y = BX + A

Let's calculate for the dataset: X = (1, 2, 3, 4, 5), Y = (2, 4, 5, 4, 5)

- Calculate sums:
- \(\sum x = 1 + 2 + 3 + 4 + 5 = 15\)
- \(\sum y = 2 + 4 + 5 + 4 + 5 = 20\)
- \(\sum xy = 1(2) + 2(4) + 3(5) + 4(4) + 5(5) = 70\)
- \(\sum x^2 = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55\)

- Calculate means:
- \(\bar{x} = 15 / 5 = 3\)
- \(\bar{y} = 20 / 5 = 4\)

- Calculate slope: \[B = \frac{5(70) - 15(20)}{5(55) - 15^2} = 0.7\]
- Calculate intercept: \[A = 4 - 0.7(3) = 1.9\]
- Regression equation: \[Y = 0.7X + 1.9\]

This scatter plot represents the example dataset. The red line indicates the regression line Y = 0.7X + 1.9, showing the best fit for the data points.

We can create a free, personalized calculator just for you!

Contact us and let's bring your idea to life.

Category
Loan
Tax
Interest
Investment
Profit & Loss
Credit and Debt Planning
Algebra
Statistics
Matrix
Number
Plane Geometry
Solid Geometry
Trigonometry
Construction
Analytic Geometry
Math graphing
Color Converter
Numeral system
Unit
Energy
Temperature
Power
Frequency
Charge
Voltage
Lighting
Classic Physic
Electronic
Engineering
Chemistry
Electrical
Date
Time
Commemorative days
Observance days
Health and medicine
Family and Fun
Weather
Webmaster tools