A simple linear regression is a statistical method that uses a straight line to model the relationship between a singe input variable (predictor) and a single output variable (response)
linear regression is helpful when: -Determining how one variable affects another - Make predictions based on observed patterns -Measure the strength of relationships
Example: Analyzing how car mileage affects resale pricing.
head(cars)
mileage year price 1 61662 2016 48161.40 2 67869 2019 54828.17 3 12985 2018 60841.36 4 39924 2014 53159.49 5 78292 2019 49201.08 6 72554 2017 45979.48