TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What is correlation? The correlation coefficient explained

Correlation measures how closely two variables move together, as a coefficient between -1 and +1. How to calculate r, read its size, and spot the outliers and curves that fool it.

Chen Yu Reviewed by Sophia Bennett Also called correlation coefficient Last updated Nov 19, 2026 Glossary

Quick answer

Correlation measures how closely two variables change together. The correlation coefficient r runs from -1 (one rises as the other falls) through 0 (no straight-line link) to +1 (they rise together). It describes a pattern, not a cause.

Formula: r = Σ(xᵢ − x̄)(yᵢ − ȳ) ÷ √[Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²]

What does correlation measure?

Correlation measures how closely two variables move together. If days with more visitors also tend to be days with more orders, the two are positively correlated. If days with slower pages tend to be days with fewer orders, they are negatively correlated. The usual number is the correlation coefficient, written r, which always falls between −1 and +1.

Three things to hold on to before any calculation:

  • Sign is direction. Positive means "both rise together", negative means "one rises as the other falls".
  • Size is how tightly the points hug a straight line. Close to ±1 is tight; close to 0 is a shapeless cloud.
  • Neither one says why. A coefficient describes a pattern in the data you have. It does not say which variable drives the other, or whether a third one drives both (see causation and correlation vs causation).

How is the correlation coefficient calculated?

When people say "correlation" without qualification they mean the Pearson product-moment coefficient (Pearson, 1895). It is the covariance of the two variables divided by the product of their standard deviations:

r = Σ(xᵢ − x̄)(yᵢ − ȳ) ÷ √[ Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)² ]

In words: for each pair, check whether x and y sit on the same side of their own averages. If they usually do, the products are mostly positive and r is positive. Dividing by the spread of both variables removes the units, so r is the same whether you measure revenue in dollars or cents.

Two companions are worth knowing:

  • r² (the coefficient of determination) is the share of the variation in y that a straight line on x accounts for. r = 0.97 gives r² = 0.94.
  • Spearman's rank correlation applies the same formula to the ranks of the values instead of the values. It captures any consistently rising or falling relationship, not only straight lines, and it is far less disturbed by extreme values.

A worked example you can recompute

Sample data: ten days of a small shop. x is sessions that day, y is orders that day.

Day12345678910
Sessions (x)120135150160180200210230250270
Orders (y)4557698101112
  1. Averages: x̄ = 190.5, ȳ = 7.7.
  2. Σ(x − x̄)(y − ȳ) = 1,206.5; Σ(x − x̄)² = 22,622.5; Σ(y − ȳ)² = 68.1.
  3. r = 1,206.5 ÷ √(22,622.5 × 68.1) = 1,206.5 ÷ 1,241.2 = 0.972.
  4. r² = 0.945, so about 94.5% of the day-to-day variation in orders in this sample lines up with sessions.
  5. The fitted line is orders = −2.46 + 0.0533 × sessions, roughly 5.3 more orders per 100 extra sessions.
  6. Is 0.972 plausibly luck with only 10 days? t = r × √(n − 2) ÷ √(1 − r²) = 0.972 × √8 ÷ √0.0552 = 11.7. With 8 degrees of freedom the two-sided 0.001 critical value is about 5.04, so p is below 0.001.

Spearman on the same data is 0.973, almost identical, because the relationship really is a steady climb.

How strong is "strong"? Reading the coefficient

There are no universal cut-offs. The bands below are common rules of thumb; what counts as useful depends on the field and the stakes.

Absolute rRough labelWhat it looks like on a scatter plotTypical reading
0.00–0.19NegligibleShapeless cloudTreat as no linear relationship
0.20–0.39WeakWide band, clear overlapReal but too loose to predict individual cases
0.40–0.69ModerateVisible slope with a lot of scatterUseful for group-level patterns
0.70–0.89StrongPoints hug a lineUseful for forecasting totals
0.90–1.00Very strongAlmost a lineCheck for double counting: one variable may contain the other

Two reading rules that matter more than the label:

  • Square it. r = 0.5 sounds like "half", but r² = 0.25: a straight line on x explains a quarter of the variation in y.
  • Significant is not strong. With enough rows, even r = 0.05 is "statistically significant" and still explains 0.25% of the variation. Report the size, not only the p-value (see p-value).

Which correlation coefficient should you use?

CoefficientUse it whenNotes
Pearson rBoth variables are numeric, the relationship looks like a straight line, few extreme valuesThe default; sensitive to outliers
Spearman ρValues are ranked, skewed, or you expect a steady rise that is not a straight lineUses ranks; robust to outliers
Kendall τSmall samples with many tiesCounts pairs that agree or disagree in order
Point-biserialOne variable is yes/no (for example "bought or not"), the other numericSame as Pearson with a 0/1 variable

For two categorical variables (device and channel, say) none of these apply; you compare counts in a cross-tab instead (see categorical data).

Why can correlation mislead?

Five ways a coefficient misleads, each with a number.

  • One outlier can erase it. Add one eleventh day to the example: 130 sessions, 30 orders (a bulk order, say). Pearson r drops from 0.972 to −0.005, while Spearman only falls to 0.57. Always look at the scatter plot first (see scatter plot).
  • Curves read as zero. For x = −3…3 and y = x², y is completely determined by x, yet r = 0.000 because the left and right halves cancel out. Pearson only measures straight-line fit.
  • A third variable can drive both. Daily ice-cream sales and sunburn cases rise together because of temperature. If you suspect that, see confounding variable.
  • Time trends fake relationships. Two numbers that both grow over months correlate strongly even when unrelated. Compare changes (this week minus last week) rather than levels.
  • Few points prove little. With only 5 days, r = 0.8 gives t = 0.8 × √3 ÷ √0.36 = 2.31, below the two-sided 5% critical value of 3.18 for 3 degrees of freedom, so it is not significant. The same r from 30 days would be.

Also remember range restriction: if you only look at customers who already spent over $500, the correlation between visits and spend inside that group is usually weaker than in everyone.

How do you check correlation in your analytics data?

TapCub has no correlation or significance-test report: it does not calculate r. What it does is give you clean, consistently counted daily numbers that you can correlate yourself. A typical task is "do days with more chat conversations also have more goal completions?".

  1. Pick two daily series. For example sessions from Web analytics › Overview and goal completions from Web analytics › Goals, over the same 30 or 60 days. Bots are counted separately from people, so crawler spikes do not enter the human numbers.
  2. Get the numbers out. Copy the daily table, or define the two metrics in All-platform analytics › Behavior › Metrics & SQL and query them by day. For raw rows, All-platform analytics › Data › Data export creates an asynchronous export job (check the Data export docs for how the file is delivered).
  3. Compute r in a spreadsheet. Use CORREL(range1, range2) in Excel or Google Sheets, and RSQ for r². Chart the two columns as a scatter plot before you trust the number.
  4. Remove obvious one-off days. If a launch or outage day sits far from the rest, recompute without it, or use Spearman. Configuration › Annotations marks releases and campaigns on charts so you can tell which days were unusual.
  5. Treat the result as a lead, not a verdict. TapCub does not run experiments or A/B tests. If the pattern matters for a decision, test it with a controlled change and use TapCub to measure the outcome.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Chen Yu

Technical Engineer

Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is a good correlation coefficient?

There is no universal threshold. As a rule of thumb, |r| above 0.7 is strong, 0.4 to 0.7 moderate and below 0.2 negligible. Square it to see how much variation is explained: r = 0.5 explains 25%. What counts as good depends on the field and the cost of being wrong.

Does correlation imply causation?

No. Two variables can move together because one drives the other, because a third variable drives both, or by chance. A coefficient cannot tell these apart. Establishing cause needs a controlled change or a design that rules out the alternatives.

Can a correlation be 0 when two variables are clearly related?

Yes. Pearson r only measures straight-line fit. If y = x² for x from -3 to 3, y is fully determined by x, yet r = 0 because the two halves cancel. Plot the data before trusting the number.

What is the difference between correlation and R-squared?

r is the correlation between two variables and carries a sign. R² is r squared: the share of variation in y that a straight line on x accounts for. r = -0.8 and r = 0.8 both give R² = 0.64.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics