Categories

How to Calculate Linearity

By Colin McGrath; Updated April 25, 2017

Being able to calculate linearity (or correlation, as it's often referred to) is a very valuable skill. Linearity is a quantitative assessment of how strongly related a set of data is. Linearity ranges from 0 (not related at all) to 1 (completely related) and gives a useful numerical gauge to be used alongside a numerical plot. For our calculations, the following sample (x, y) pairs will be used: x: 2.4, 3.4, 4.6, 3.7, 2.2, 3.3, 4.0, 2.1 y: 1.33, 2.12, 1.80, 1.65, 2.00, 1.76, 2.11, 1.63

Calculating Sx

Add together all of your x-values and you get sum(x) = 25.7.

Calculate x^2 by squaring all of your individual x-values. This is done by multiplying each x-value by itself. Your x^2 values will be 5.76, 11.56, 21.16, 13.69, 4.84, 10.89, 16.00, 4.41.

Add together all of your x^2 values and you get sum(x^2) = 88.31.

Multiply sum(x) by itself to obtain sum(x)^2, which is equal to 660.49.

Divide sum(x)^2 by 8 (the total number of data pairs in our sample data). You will get an answer of 82.56.

Subtract 82.56 (answer from step 5) from sum(x^2) (answer from step 4). You will get an answer of 5.75, which we refer to as Sx.

Calculating Sy

Add together all of your y-values and you get sum(y) = 14.40.

Calculate y^2 by squaring all of your individual y-values. This is done by multiplying each y-value by itself. Your y^2 values will be 1.7689, 4.4944, 3.2400, 2.7225, 4.0000, 3.0976, 4.4521, 2.6569.

Add together all of your y^2 values and you get sum(y^2) = 26.4324.

Multiply sum(y) by itself to obtain sum(y)^2, which is equal to 207.36.

Divide sum(y)^2 by 8 (the total number of data pairs in our sample data) and subtract that answer from sum(y^2). You will get an answer of 0.5124, which we refer to as Sy.

Tip

References

About the Author

Colin McGrath began writing professionally in 2004. He's written reviews for boisereviews.com and has also published in leading academic journals such as "Optics Express" and "Engineering Letters." McGrath graduated from the University of Washington in Seattle with a Bachelor of Science in physics and a Bachelor of Science in applied mathematics.