How to Used Linear Regression: with Strategy Settings
Channel: Hamza khan
Date: 2022-05-01

In statistics, simple linear regression is a linear regression model with a single explanatory variable.[1][2][3][4][5] That is, it concerns two-dimensional sample points with one independent variable and one dependent variable (conventionally, the x and y coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight line) that, as accurately as possible, predicts the dependent variable values as a function of the independent variable. The adjective simple refers to the fact that the outcome variable is related to a single predictor.

It is common to make the additional stipulation that the ordinary least squares (OLS) method should be used: the accuracy of each predicted value is measured by its squared residual (vertical distance between the point of the data set and the fitted line), and the goal is to make the sum of these squared deviations as small as possible. Other regression methods that can be used in place of ordinary least squares include least absolute deviations (minimizing the sum of absolute values of residuals) and the Theil–Sen estimator (which chooses a line whose slope is the median of the slopes determined by pairs of sample points). Deming regression (total least squares) also finds a line that fits a set of two-dimensional sample points, but (unlike ordinary least squares, least absolute deviations, and median slope regression) it is not really an instance of simple linear regression, because it does not separate the coordinates into one dependent and one independent variable and could potentially return a vertical line as its fit.

The remainder of the article assumes an ordinary least squares regression. In this case, the slope of the fitted line is equal to the correlation between y and x corrected by the ratio of standard deviations of these variables. The intercept of the fitted line is such that the line passes through the center of mass (x, y) of the data points.


Contents
1 Fitting the regression line
1.1 Intuition about the slope
1.2 Intuition about the intercept
1.3 Intuition about the correlation
1.4 Simple linear regression without the intercept term (single regressor)
2 Numerical properties
3 Model-based properties
3.1 Unbiasedness
3.2 Confidence intervals
3.2.1 Normality assumption
3.2.2 Asymptotic assumption
4 Numerical example
5 See also
6 References
7 External links
Fitting the regression line
Consider the model function

{\displaystyle y=\alpha +\beta x,}y=\alpha +\beta x,
which describes a line with slope β and y-intercept α. In general such a relationship may not hold exactly for the largely unobserved population of values of the independent and dependent variables; we call the unobserved deviations from the above equation the errors. Suppose we observe n data pairs and call them {(xi, yi), i = 1, ..., n}. We can describe the underlying relationship between yi and xi involving this error term εi by

{\displaystyle y_{i}=\alpha +\beta x_{i}+\varepsilon _{i}.} y_i = \alpha + \beta x_i + \varepsilon_i.
This relationship between the true (but unobserved) underlying parameters α and β and the data points is called a linear regression model.

The goal is to find estimated values {\displaystyle {\widehat {\alpha }}}{\displaystyle {\widehat {\alpha }}} and {\displaystyle {\widehat {\beta }}}{\displaystyle {\widehat {\beta }}} for the parameters α and β which would provide the "best" fit in some sense for the data points. As mentioned in the introduction, in this article the "best" fit will be understood as in the least-squares approach: a line that minimizes the sum of squared residuals (see also Errors and residuals) {\displaystyle {\widehat {\varepsilon }}_{i}}{\displaystyle {\widehat {\varepsilon }}_{i}} (differences between actual and predicted values of the dependent variable y), each of which is given by, for any candidate parameter values {\displaystyle \alpha }\alpha  and {\displaystyle \beta }\beta ,