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.
| Day | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Sessions (x) | 120 | 135 | 150 | 160 | 180 | 200 | 210 | 230 | 250 | 270 |
| Orders (y) | 4 | 5 | 5 | 7 | 6 | 9 | 8 | 10 | 11 | 12 |
- Averages: x̄ = 190.5, ȳ = 7.7.
- Σ(x − x̄)(y − ȳ) = 1,206.5; Σ(x − x̄)² = 22,622.5; Σ(y − ȳ)² = 68.1.
- r = 1,206.5 ÷ √(22,622.5 × 68.1) = 1,206.5 ÷ 1,241.2 = 0.972.
- r² = 0.945, so about 94.5% of the day-to-day variation in orders in this sample lines up with sessions.
- The fitted line is orders = −2.46 + 0.0533 × sessions, roughly 5.3 more orders per 100 extra sessions.
- 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 r | Rough label | What it looks like on a scatter plot | Typical reading |
|---|---|---|---|
| 0.00–0.19 | Negligible | Shapeless cloud | Treat as no linear relationship |
| 0.20–0.39 | Weak | Wide band, clear overlap | Real but too loose to predict individual cases |
| 0.40–0.69 | Moderate | Visible slope with a lot of scatter | Useful for group-level patterns |
| 0.70–0.89 | Strong | Points hug a line | Useful for forecasting totals |
| 0.90–1.00 | Very strong | Almost a line | Check 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?
| Coefficient | Use it when | Notes |
|---|---|---|
| Pearson r | Both variables are numeric, the relationship looks like a straight line, few extreme values | The default; sensitive to outliers |
| Spearman ρ | Values are ranked, skewed, or you expect a steady rise that is not a straight line | Uses ranks; robust to outliers |
| Kendall τ | Small samples with many ties | Counts pairs that agree or disagree in order |
| Point-biserial | One variable is yes/no (for example "bought or not"), the other numeric | Same 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?".
- 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.
- 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).
- 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.
- 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.
- 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
- Pearson, K. (1895). Note on regression and inheritance in the case of two parents. Proceedings of the Royal Society of London, 58, 240–242.
- Anscombe, F. J. (1973). Graphs in Statistical Analysis. The American Statistician, 27(1), 17–21.
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.3.26 Scatter Plot.
- SciPy documentation, scipy.stats.pearsonr (formula and the t-based p-value used above).
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

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