# 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.

### How to enter data as frequency table?

Simple. First-type data elements (separated by spaces or commas etc) then type f: and further write frequency of each data item. Each element must have defined frequency that number of numbers before and after symbol f: must be equal. For example:1.1 2.5 3.99

f: 5 10 15