Skip to content

This notebook creates a linear regression model and related statistics by hand and by using python libraries, and then compares the results.

License

Notifications You must be signed in to change notification settings

burrittresearch/linear-regression-by-hand-vs-libraries-in-python

Repository files navigation

linear-regression-by-hand-vs-libraries-in-python

This notebook creates a linear regression model and related statistics by hand using the underlying mathematical formulas and a sample dataset. It then creates another linear regression model and related statistics using python libraries and the same sample dataset. Both methods include calculating the equation of a line $y = mx+b$, the line's slope ($m$) and y-intercept ($b$), the coefficient of determination R-squared ($r^2$), and Pearson's correlation coefficient ($r$). The results of the two modeling methods are then compared and summarized.

Highlights

Both models produced the same linear regression line $y = mx+b$, slope ($m$) and y-intercept ($b$), the coefficient of determination R-squared ($r^2$), and Pearson's correlation coefficient ($r$).

About

This notebook creates a linear regression model and related statistics by hand and by using python libraries, and then compares the results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published