## Linear Regression Calculator

## How to use calculator

This linear regression calculator can be used for linear regression analysis of two data ranges. It can calculate the regression coefficients, correlation between the data, various types of evaluation metrics and summation and statistical parameter for the given data.

- Enter the numbers separated by comma or separated by space or vertically stacked data copied from excel.
- User can input whole number (eg: 2,3 etc.) or decimal numbers (eg: 3.5, 9.2 etc.), but care should be taken that fraction should not be put (eg: 3/7, 2/3 etc.)

## Regression coefficients

In linear regression analysis the points are scattered in 2D plane and to predict any unknown value a best fit line has to be plotted amongst the scattered points.

There are multiple ways to draw a line through the scattered points but the best fit line would be that line which has the error minimized for the predicted values.

The equation of the best fit line is given as = Ax + B; where A and B are called as the regression coefficients.

Coefficient A is given as:

A=\frac{\sum_{i=1}^{n}\left(x_{i}-\bar{x}\right)\left(y_{i}-\bar{y}\right)}{\sum_{i=1}^{n}\left(x_{i}-\bar{x}\right)^{2}}Coefficient B is given as:

B=\bar{y}-A * \bar{x}where x bar and y bar are the mean values of x and y data ranges.

## Correlation

Correlation relates to the degree to which two data ranges correlate to each other.

A correlation coefficient ranges from -1 to 1, where -1 will be for two series which are perfectly opposite to each other and +1 will be for the two series which are exactly identical to each other. The correlation formula is given as:

R=\frac{\sum\left(x_{i}-\bar{x}\right)\left(y_{i}-\bar{y}\right)}{\sqrt{\sum\left(x_{i}-\bar{x}\right)^{2} \sum\left(y_{i}-\bar{y}\right)^{2}}}## Evaluation metrics in regression models

To evaluate the performance and reliability of a regression there are several evaluation metrics which have to be determined in order to have the best prediction of unknown value. Following five performance evaluation metrics are mostly used.

### Mean absolute error

### Mean squared error

### Root mean squared error

### Residual absolute error

### Residual squared error

## Other parameters

This linear regression calculator can also calculate the summation of both series, summation of the product of both series