Read · 1 min
What is a linear regression?
Linear regression attempts to model the relationship between two variables by "fitting" a line to the data. This estimated linear relationship helps us predict information about one variable, given information about another on average.
A linear regression line has an equation of the form
Such that:
is the explanatory variable
is the dependent variable
The slope of the line is
The intercept is (y-value when x = 0)
For example, a statistician may want to relate the weights (explanatory variable) of individuals to their heights (dependent variable) using a linear regression model.
Note: Linear regressions are usually only useful when their is some kind of correlation between the variables. For example, if there is no correlation between the variables after looking at them on a scatterplot, fitting a line through the points will not be helpful as we cannot make a prediction on one variable based on information about the other (no relationship between the variables.).