## Information

The linear regression calculator generates the linear regression equation, draws a linear regression line, a histogram, a residuals QQ-plot, a residuals x-plot, and a distribution chart.

It calculates the R square, the R, and the outliers, then it tests the fit of the linear model to the data and checks the residuals' normality assumption and the priori power.

### What is linear regression?

The linear regression is the linear equation that best fits the points.

There is no one way to choose the best fit ting line, the most common one is the ordinary least squares (OLS). The linear regression describes the relationship between the dependent variable (Y) and the independent variables (X).

The linear regression model calculates the dependent variable (DV) based on the independent variables (IV, predictors).

### What is "ordinary least squares"?

The ordinary least squares method chooses the line parameters that minimize the sum of squares of the differences between the observed dependent variables (Y) and the estimated value by the linear regression (Ŷ).

### Why do you need the linear regression?

We may use the linear regression when we want to do one of the following

- Predict the dependent variable (Ŷ)
- Estimate the effect of each independent variable (X) on the dependent variable (Y)
- Calculate the correlation between the dependent variable and the independent variables.
- Test the linear model significance level.

### How to calculate linear regression?

Following the linear regression formula:

Ŷ = b_{0} +b_{1}x

b

_{0} - the y-intercept, where the line crosses the y-axis.

b

_{1} - the slope, describes the line's direction and incline.

b_{1} = | SP_{xy} | = | Σ(x_{i}-x̄)(y_{i}-ȳ) |

SS_{x} | Σ(x_{i}-x̄)^{2} |

b_{0} = ȳ - b_{1}x̄

### How to calculate R squares?

R squares is the percentage of the variance explain by the regression (SS

_{Regression}) from the overall variance (SS

_{Total}).

R^{2} = | SS_{Regression} |

SS_{Total} |

The **right-tailed** F test checks if the entire regression model is statistically significant. Why only right tail?