# Linear regression calculator

Two-dimensional linear regression of statistical data is done by the**method of least squares**. Enter the statistical data in the form of a pair of numbers, each pair is on a separate line. The first number is considered as X (each odd-numbered in the order), second as Y (each even-numbered in the order).

The output of the linear regression is coefficients

**A**and

**B**of the linear function f(x) = Ax + B, which approximates given 2D data by linear function (line). Least squares means that we minimize the sum of the squares of the errors made in the results of every point.

Also calculate

**coefficient of correlation**Pearson product-moment correlation coefficient (PPMCC or PCC or R) is a measure of the linear correlation (dependence) between two variables X and Y, giving a value between +1 and −1 inclusive, where 1 is total positive correlation, 0 is no correlation, and −1 is total negative correlation.