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

xyxyx2 x-mxy-my (x-mx)2(y-my)2 (x-mx)(y-my)
2 12 24 4 -6-12.6 36158.76 75.6
5 20 100 25 -3-4.6 921.16 13.8
7 25 175 49 -10.4 10.16 -0.4
11 26 286 121 31.4 91.96 4.2
15 40 600 225 715.4 49237.16 107.8
∑x = 40 ∑y = 123 ∑xy = 1185 ∑x2 = 424 mx=8 my=24.6 SSX = ∑(y-my))2 = 104 SSY = ∑(y-my))2 = 419.2 SP = ∑(x-mx)(y-my) = 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 cV=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 :
elementfrequencycumulative frequencyrelative frequencycumulative 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
Z-score: {-1.3156, -0.6578, -0.2193, 0.6578, 1.5349}
Count items: 5

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 cV=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 :
elementfrequencycumulative frequencyrelative frequencycumulative 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
Z-score: {0.211, 0.633, 0.8967, 0.9495, 1.688}
Count items: 5

Statistical file(Y-data):
{12, 20, 25, 26, 40}