STATISTICAL WORKSHEETS

Distinguishing undefined correlation from a coefficient of zero

Compare a correlation request that is rejected because one list never changes with a valid request whose coefficient comes out as zero.

What Pearson correlation needs from each list

Pearson correlation measures how closely two lists move together in a straight-line pattern. It is computed as the sum of cross-products of the deviations from each mean, divided by the square root of the product of the two sums of squared deviations. That denominator is the reason constant lists cause trouble. If every value in a list equals its mean, the sum of squared deviations is zero, and the formula divides by zero. The Pearson Correlation Calculator therefore rejects such input, instead of reporting a number. This guide contrasts that rejection with a valid result of zero, since the two are easy to confuse in a report.

The rejected pair

Take x equal to 1, 1, 1 and y equal to 1, 2, 3. The mean of x is 1, and every deviation is zero, so the sum of squared deviations for x is zero. The numerator is zero as well, and the ratio becomes zero over zero. The tool refuses the pair and reports a constant list. There is no correlation to compute because x has no variation to relate to the changes in y. Asking how y changes when x changes is meaningless when x never changes. The y list varies, so the problem is entirely on the x side. Either list being constant is enough to trigger the rejection, and so is a pair where both lists are constant, such as 4, 4, 4 against 7, 7, 7. A practical consequence arises with filtered data: selecting only the rows from one site, one day or one category can leave a column with a single repeated value, and a correlation that worked on the full table fails on the subset.

A defined coefficient of zero

Now take x equal to minus 1, 0, 1 and y equal to 1, 0, 1. Both lists vary. The mean of x is 0 and the mean of y is two thirds. The deviations of x are minus 1, 0 and 1, and the deviations of y are one third, minus two thirds and one third. The cross-products are minus one third, 0 and one third, which sum to 0. With a nonzero denominator, the coefficient is 0 divided by a positive number, which is 0, and the tool returns it. This is an actual computed value: there is no linear trend between the two lists.

Why zero and undefined must stay apart

Reporting a rejected constant list as a correlation of zero would assert that a coefficient was calculated and found to be nil. It was not calculated at all. A reader could draw the conclusion that the variables are unrelated, when the truth is that one of them never changed, so the data cannot say anything about a relationship. In a table of many pairwise correlations, undefined cells should be marked as such. A spreadsheet that fills them with zero will make a constant column look like an uncorrelated one.

Perfect and negative coefficients for contrast

To see the range of defined values, compare a few simple pairs. The lists 1, 2, 3 and 2, 4, 6 move together in a perfect straight line with a positive slope, and the coefficient is 1. The lists 1, 2, 3 and 3, 2, 1 form a perfect line with a negative slope, and the coefficient is minus 1. Every defined result from the tool lies between minus 1 and 1. A coefficient of zero sits in the middle of that range and says only that the linear co-movement in these particular lists cancels out.

Zero correlation does not mean no relationship

Pearson correlation summarizes linear association. It can be exactly zero when two lists are strongly related in a curved pattern. Take x equal to minus 2, minus 1, 0, 1, 2 and y equal to x squared, which is 4, 1, 0, 1, 4. Each y is fully determined by x, yet the centered cross-products sum to zero, so the coefficient is 0. The symmetric shape cancels the positive and negative slopes. This is why a coefficient of zero should be paired with a look at the data, such as a scatter plot, before anyone concludes that the variables are independent.

Why a computed coefficient still needs thought

A coefficient between minus 1 and 1 looks precise, but its meaning depends on context. Values near 1 or minus 1 indicate that the points lie close to a straight line, yet a single outlier can create such a value from otherwise unrelated lists. A value near zero can hide a strong curve, as the squared example shows. The coefficient also changes when either list is rescaled by a negative factor, which flips its sign, and it ignores any shift or positive scale change in either list. These properties make Pearson correlation useful for comparing lists measured in different units, and they also explain why the number alone rarely settles a question.

Checking your lists before computing

Two quick checks save time. First, confirm that each list has more than one distinct value, since an export or filter can leave a column of identical numbers. Second, confirm that the lists have the same length and that matching positions refer to the same observation. A shifted or misaligned column can produce a coefficient that is defined but meaningless. If the tool rejects the input, inspect the source data for a stuck sensor, a default value that was never updated, or a subset selected so narrowly that all rows share one value.

What the controls demonstrate and what they leave out

The two cases show a rejection rule and a computed zero, and nothing more. They do not claim that a zero coefficient is common, that short lists give stable estimates, or that a linear summary is appropriate for any particular data. The calculator does not test significance, give confidence intervals or consider outliers. With only three pairs, even a large coefficient would be weak evidence of anything. Use this page to understand how the tool treats these edge conditions, then handle real data with the additional checks the question requires. Document the rejection in a report as an undefined entry with its reason, so that a reader seeing a blank cell knows whether the data were missing or the coefficient could not exist.

Reproduce the checks

Constant x list

Open the Pearson Correlation Calculator and enter:

X observations
1,1,1
Y observations
1,2,3

Expected rejection:

constant list

The coefficient denominator has a zero variation term.

Defined zero coefficient

Open the Pearson Correlation Calculator and enter:

X observations
-1,0,1
Y observations
1,0,1

Expected output:

R

0

Both lists vary, so zero is an actual computed coefficient.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks