Skip to course content
Free R statistics course

Statistical Data Analytics with R

Unit 08.00: A correlation near zero means no straight line

A correlation near zero does not mean no relationship. It means no straight-line relationship.

Plot it, then quote it

Correlation measures the strength of a linear association. A strong curved relationship — a U shape, a threshold, a saturation curve — can produce a correlation of nearly zero while being entirely predictable.

It is also extremely sensitive to individual points. A single observation far from the rest can create a large correlation where none exists among the bulk of the data, or destroy a real one.

Both failures are invisible in the number and obvious in the scatter plot, which is why the plot comes first and the coefficient second — always in that order.

This block correlates a linear relationship, a U-shaped one, and then adds a single distant point to unrelated data.

suppressPackageStartupMessages(library(ggplot2))
set.seed(501)

x <- runif(120, 0, 10)
linear    <- 2 * x + rnorm(120, 0, 3)
curved    <- (x - 5)^2 + rnorm(120, 0, 3)

cat("Linear relationship,  correlation:", round(cor(x, linear), 3), "\n")
cat("U-shaped relationship, correlation:", round(cor(x, curved), 3), "\n\n")

cat("The second correlation is near zero and the relationship is strong --\n")
cat("correlation measures STRAIGHT-LINE association only.\n\n")

# One point can create or destroy a correlation.
x2 <- c(rnorm(40, 5, 1), 20)
y2 <- c(rnorm(40, 5, 1), 20)
cat("40 points with no relationship, correlation:",
    round(cor(x2[1:40], y2[1:40]), 3), "\n")
cat("The same 40 plus one distant point       :", round(cor(x2, y2), 3), "\n\n")

p <- ggplot(data.frame(x, curved), aes(x, curved)) + geom_point()
ggsave(file.path(tempdir(), "curved.png"), p, width = 5, height = 3, dpi = 100)
cat("Always plot before quoting a correlation.\n")

The linear relationship gives 0.871. The U-shaped one — strong, obvious in a plot, perfectly predictable — gives 0.113, near zero. Then forty points with no relationship at all correlate at 0.039; adding one distant observation takes that to 0.85. A single row manufactured a strong correlation out of nothing.

The mistake this prevents

The mistake is computing a correlation matrix over many variables and reading off the large values. Neither curvature nor a single influential point is visible in a matrix of numbers.

Takeaway

Plot every relationship before quoting its correlation. Treat a near-zero coefficient as evidence about linearity only, and check whether any single point is driving a large one.