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.9326923076923 (slope)
B = 9.1384615384615 (y intercept)
R = 0.96265074392828 (correlation coefficient)

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

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
n=5 A=nx2(x)2nxyxy=54244025118540123=1.9326923076923  B=nyAx=51231.932692307692340=9.1384615384615  y=f(x)=Ax+B=1.9327x+9.1385  R=(xmx)2(xmx)2(xmx)(ymy)=104419.2201=0.96265074392828

X-data


Average (mean): μ=8
Absolute deviation: 20
Mean deviation: 4
Minimum: 2
Maximum: 15
Variance: 20.8
Standard deviation σ=4.5607017003966
Corrected sample standard deviation s=5.0990195135928
Coefficient of variation cV=0.6373774391991
Signal-to-noise ratio SNR=1.5689290811055
Median: 7
Quartile Q1: 3.5
Quartile Q2: 7
Quartile Q3: 13
1st decile: 1.2 (Too few data to calculate deciles)
2nd decile: 2.6
3rd decile: 4.4
4th decile: 5.8
5th decile: 7
6th decile: 9.4
7th decile: 11.8
8th decile: 14.2
9th decile: 9
Interquartile range IQR: 9.5
Quartile Deviation QD: 4.75
Coefficient of Quartile Deviation CQD: 0.57575757575758
Lower fence: -10.75
Upper fence: 27.25
Set of outliers: {} - empty set - no outliers found
Interdecile range IDR: 7.8
Mode: {2, 5, 7, 11, 15} - multimodal
Geometric mean: 6.4940614952848
Harmonic mean: 4.997836434444
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

Calculation of normal distribution

Statistical file(X-data):
{2, 5, 7, 11, 15}


Y-data


Average (mean): μ=24.6
Absolute deviation: 34.4
Mean deviation: 6.88
Minimum: 12
Maximum: 40
Variance: 83.84
Standard deviation σ=9.1564185138077
Corrected sample standard deviation s=10.237187113656
Coefficient of variation cV=0.41614581762828
Signal-to-noise ratio SNR=2.403003845381
Median: 25
Quartile Q1: 16
Quartile Q2: 25
Quartile Q3: 33
1st decile: 7.2 (Too few data to calculate deciles)
2nd decile: 13.6
3rd decile: 18.4
4th decile: 22
5th decile: 25
6th decile: 25.6
7th decile: 28.8
8th decile: 37.2
9th decile: 24
Interquartile range IQR: 17
Quartile Deviation QD: 8.5
Coefficient of Quartile Deviation CQD: 0.3469387755102
Lower fence: -9.5
Upper fence: 58.5
Set of outliers: {} - empty set - no outliers found
Interdecile range IDR: 16.8
Mode: {12, 20, 25, 26, 40} - multimodal
Geometric mean: 22.857931028231
Harmonic mean: 21.115322144017
Sum: 123
Sum of squares: 419.2
Sum of absolute values: 123
Average absolute deviation: 6.88
Range: 28
Frequency table :
elementfrequencycumulative frequencyrelative frequencycumulative relative frequency
12 1 1 0.2 0.2
20 1 2 0.2 0.4
25 1 3 0.2 0.6
26 1 4 0.2 0.8
40 1 5 0.2 1
Z-score: {-1.3761, -0.5024, 0.0437, 0.1529, 1.6819}
Count items: 5

Calculation of normal distribution

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



Practice problems from statistics:



more math problems »