# Linear regression calculator

This linear regression calculator uses the least squares method to find the line of best fit for a set of paired data. The line of best fit is described by the equation**f(x) = Ax + B**, where A is the slope of the line and B is the y-axis intercept.

All you need is enter paired data into the text box, each pair of x and y each line (row).

Also calculate

**coefficient of correlation**Pearson product-moment correlation coefficient (PPMCC or PCC or R). The Pearson correlation coefficient is used to measure the strength of a linear association between two variables, where the value R = 1 means a perfect positive correlation and the value R = -1 means a perfect negataive correlation.

## Calculation:

Statistical file:{[2; 12], [5; 20], [7; 25], [11; 26], [15; 40]}

A = 1.93269230769 (slope)

B = 9.13846153846 (y intercept)

R = 0.962650743928 (correlation coefficient)

**y = f(x) = Ax + B = 1.9327x+9.1385**

## Calculation Summary:

x | y | xy | x^{2} |
x-m_{x} | y-m_{y} |
(x-m_{x})^{2} | (y-m_{y})^{2} |
(x-m_{x})(y-m_{y}) |
---|---|---|---|---|---|---|---|---|

2 | 12 | 24 | 4 | -6 | -12.6 | 36 | 158.76 | 75.6 |

5 | 20 | 100 | 25 | -3 | -4.6 | 9 | 21.16 | 13.8 |

7 | 25 | 175 | 49 | -1 | 0.4 | 1 | 0.16 | -0.4 |

11 | 26 | 286 | 121 | 3 | 1.4 | 9 | 1.96 | 4.2 |

15 | 40 | 600 | 225 | 7 | 15.4 | 49 | 237.16 | 107.8 |

∑x = 40 | ∑y = 123 | ∑xy = 1185 | ∑x^{2} = 424 |
m_{x}=8 |
m_{y}=24.6 |
SSX = ∑(y-m_{y}))^{2} = 104 |
SSY = ∑(y-m_{y}))^{2} = 419.2 |
SP = ∑(x-m_{x})(y-m_{y}) = 201 |

### X-data

Average (mean): μ=8

Absolute deviation: 20

Mean deviation: 4

Minimum: 2

Maximum: 15

Variance: 20.8

Standard deviation σ=4.5607017004

Corrected sample standard deviation s=5.09901951359

Coefficient of variation c

_{V}=0.637377439199

Signal-to-noise ratio SNR=1.56892908111

Median: 7

Quartile Q1: 3.5

Quartile Q2: 7

Quartile Q3: 13

1st decile: 2

**(Too few data to calculate deciles)**

2nd decile: 3.5

3rd decile: 5

4th decile: 6

5th decile: 7

6th decile: 9

7th decile: 11

8th decile: 13

9th decile: 15

Interquartile range IQR: 9.5

Quartile Deviation QD: 4.75

Coefficient of Quartile Deviation CQD: 0.575757575758

Lower fence: -10.75

Upper fence: 27.25

Set of outliers: {} - empty set - no outliers found

Interdecile range IDR: 13

Mode: {2, 5, 7, 11, 15} - multimodal

Geometric mean: 6.49406149528

Harmonic mean: 4.99783643444

Sum: 40

Sum of squares: 104

Sum of absolute values: 40

Average absolute deviation: 4

Range: 13

Frequency table :

element | frequency | cumulative frequency | relative frequency | cumulative relative frequency |
---|---|---|---|---|

2 | 1 | 1 | 0.2 | 0.2 |

5 | 1 | 2 | 0.2 | 0.4 |

7 | 1 | 3 | 0.2 | 0.6 |

11 | 1 | 4 | 0.2 | 0.8 |

15 | 1 | 5 | 0.2 | 1 |

Count items: 5

Calculation of normal distribution

Statistical file(X-data):

{2, 5, 7, 11, 15}

### Y-data

Average (mean): μ=8

Absolute deviation: 83

Mean deviation: 16.6

Minimum: 12

Maximum: 40

Variance: 359.4

Standard deviation σ=18.9578479791

Corrected sample standard deviation s=21.1955183942

Coefficient of variation c

_{V}=2.64943979928

Signal-to-noise ratio SNR=0.377438279697

Median: 25

Quartile Q1: 16

Quartile Q2: 25

Quartile Q3: 33

1st decile: 12

**(Too few data to calculate deciles)**

2nd decile: 16

3rd decile: 20

4th decile: 22.5

5th decile: 25

6th decile: 25.5

7th decile: 26

8th decile: 33

9th decile: 40

Interquartile range IQR: 17

Quartile Deviation QD: 8.5

Coefficient of Quartile Deviation CQD: 0.34693877551

Lower fence: -9.5

Upper fence: 58.5

Set of outliers: {} - empty set - no outliers found

Interdecile range IDR: 28

Mode: {2, 5, 7, 11, 15} - multimodal

Geometric mean: 22.8579310282

Harmonic mean: 21.115322144

Sum: 40

Sum of squares: 1797

Sum of absolute values: 123

Average absolute deviation: 16.6

Range: 28

Frequency table :

element | frequency | cumulative frequency | relative frequency | cumulative relative frequency |
---|---|---|---|---|

2 | 1 | 1 | 0.2 | 0.2 |

5 | 1 | 2 | 0.2 | 0.4 |

7 | 1 | 3 | 0.2 | 0.6 |

11 | 1 | 4 | 0.2 | 0.8 |

15 | 1 | 5 | 0.2 | 1 |

Count items: 5

Calculation of normal distribution

Statistical file(Y-data):

{12, 20, 25, 26, 40}