Statistics Glossary → Correlation Analysis
Correlation Analysisanalysis
An analysis showing how two numeric variables vary together, giving the direction (positive or negative) and strength of the relationship in a single coefficient between −1 and 1.
Concept
Correlation asks whether, as one variable increases, the other tends to increase too (positive association) or to decrease (negative association). The closer the coefficient is to 1, the more tightly the points line up along a rising line; the closer to −1, along a falling line; 0 means no linear relationship. The square of the coefficient (r²) shows how much of the variation in one variable is shared with the other.
Pearson's correlation can be thought of as the average product of the two variables' standardised values: r = Σ (zₓ · z_y) / (n − 1). It measures linear association and is sensitive to outliers. Spearman's correlation does the same calculation on the ranks of the values and captures one-directional (monotonic) relationships even when they are not linear; Kendall's τ looks at whether pairs of observations are ordered in the same or opposite directions and is preferred in small samples and when there are many tied values. Partial correlation shows the relationship that remains once the effect of a third variable has been removed.
Correlation does not show causation: two variables may vary together because one affects the other, or because a third variable affects both. Since Pearson's coefficient measures only linear association, it can be close to zero for a curved relationship, so the scatter plot should always be inspected. In large samples even very weak correlations can be significant; the size of the coefficient and its confidence interval matter more for interpretation than the p value.
When to use it
- To summarise the direction and strength of the relationship between two numeric variables, or to screen the relationships among many variables in a matrix.
- If the data are ordinal, skewed or contain outliers, use Spearman instead of Pearson; with a small sample and many ties, use Kendall's τ.
- To predict one variable from another or examine several variables at once, use regression; to assess agreement between two measurement methods, use Bland-Altman analysis or the intraclass correlation rather than correlation.
An everyday example
A running club records the weekly training distance and 10 km race time of its 40 members. Those who run more finish the race faster, and Pearson's correlation comes out at r = −0.70: a strong negative relationship. r² ≈ 0.49, so about half of the variation in race times is shared with training distance. This does not prove that training alone shortens race times, though; younger members may both train more and run faster. Partial correlation is used to see the effect of age.
Parameters in MerQur
Variables
Concept: The numeric variables whose relationships are computed; a coefficient is computed for every pair of selected variables and the results are collected in a correlation matrix. Choosing k variables gives k(k − 1)/2 pairs.
Everyday example: If the running club chooses training distance, race time and age, 3 pairs are examined. Adding weight and sleep time raises this to 10 pairs, increasing the chance that some associations come out significant by luck.
What it does: Selects the numeric variables whose correlation will be computed; all pairs of the selected variables are computed.
Effect on the result: Determines the matrix size, the number of tests in the p adjustment (k(k - 1)/2) and the set of cases used in listwise deletion. Adding unnecessary variables increases the multiple-comparison burden.
On the validation data: USJudgeRatings 12 variables = 66 pairs; with the Holm adjustment the CONT x INTG p-value rises from 0.3945 to 1.0.
Method (Pearson (parametric), Spearman (ordinal), Kendall τ)
Concept: Sets which kind of association is measured. Pearson measures linear association and expects the two variables to be roughly jointly normal; Spearman is based on the ranks of the values and measures monotonic association; Kendall's τ is based on the proportion of pairs of observations ordered concordantly or discordantly.
Everyday example: If one club member runs 150 km a week, far beyond everyone else, that single outlier can noticeably change Pearson's coefficient. Spearman looks only at ranks, so it registers that this member runs the most, not how far ahead they are.
What it does: Pearson measures linear association, Spearman rank-based monotonic association, and Kendall τ-b the proportion of concordant/discordant pairs (tie-corrected). Pearson is preferred for bivariate normal data, Spearman for ordinal or skewed data, Kendall for small samples and many ties.
Effect on the result: The r, p and confidence interval formulas change. The Spearman p-value uses the t approximation, the Kendall p-value the exact distribution if there are no ties and n is small.
On the validation data: Fitness Oxygen x RunTime: Pearson -0.8684, Spearman -0.8013, Kendall -0.6243. Tuna (n = 9) Kendall right-tailed exact p = 0.0597.
Confidence Level (%90, %95, %99, Other (custom))
Concept: Sets how 'sure' the confidence interval for the correlation coefficient is. The coefficient and p value do not change.
Everyday example: With 40 members, the 95% confidence interval for r = −0.70 runs from about −0.83 to −0.50; at 99% it widens. When the interval is wide, it cannot be said for certain whether the relationship is 'moderate' or 'very strong'.
What it does: The level (1 - alpha) of the confidence interval for r; it also sets the rank intervals and the bootstrap percentiles. The custom value is in the range 80.0-99.9.
Effect on the result: Only the interval width; r and p do not change.
On the validation data: Fitness Oxygen x RunTime: 90% [-0.9296, -0.7606], 95% [-0.9377, -0.7328], 99% [-0.9510, -0.6704] (Fisher z, no bias adjustment).
Hypothesis direction (Two-sided (≠), Right-tailed (>), Left-tailed (<))
Concept: States whether the research question looks for any association (two-sided) or one in a pre-specified direction (only positive or only negative). The direction should come from theory, chosen before the data are collected.
Everyday example: If the club's coach wrote down in advance the expectation that 'those who run more finish faster', a one-sided test in the negative direction may be chosen. If the direction is unknown, or both directions are of interest, the two-sided test is appropriate.
What it does: Two-sided, right-tailed (ρ > 0) or left-tailed (ρ < 0) test; for when the direction was set theoretically before data collection.
Effect on the result: The p-value, the partial correlation p-value and the confidence interval change; in a directional hypothesis the interval is one-sided (the opposite limit is ±1).
On the validation data: Fitness Weight x RunTime p: two-sided 0.2965, right 0.1482, left 0.8518. The one-tailed p is given for the selected direction (Weight x Oxygen right-tailed 0.7868). Tuna right-tailed Pearson [-0.0222, 1].
p-adjustment (multiple) (None, Bonferroni, Holm, FDR (BH))
Concept: When many correlations are tested at once, the chance that some come out significant by luck grows even when there is no real association. Bonferroni and Holm limit the probability of at least one false alarm across all tests; Benjamini-Hochberg controls the share of false alarms among the associations declared significant and suits exploratory screening better.
Everyday example: If the club looks at all 45 correlations among 10 variables, about 2 would come out significant at the 5% level by chance even with no real associations. The adjustment helps weed out chance findings such as 'sleep time is related to shoe size'.
What it does: Controls the familywise error (Bonferroni, Holm) or the false discovery rate (Benjamini-Hochberg) in many pairwise tests. Holm suits confirmatory reports and BH exploratory screening.
Effect on the result: The p matrix changes to the adjusted p; r and the interval do not change. A p_adj column is added to the partial correlation table.
On the validation data: Fitness Weight x Oxygen p = 0.4264 -> Bonferroni 1.0, Holm 0.5930, BH 0.4264. In USJudgeRatings all 66 pairs are adjusted together.
Confidence interval for r
Concept: Shows the uncertainty of the sample r about where the true correlation may lie. Because the distribution of r is not symmetric, the interval is usually computed with the Fisher z transformation, so it may not extend equally on both sides of r.
Everyday example: For the club's r = −0.70 the interval runs from −0.83 to −0.50; it lies 0.13 from −0.70 on one side and 0.20 on the other. This asymmetry becomes more marked as the coefficient approaches ±1.
What it does: Gives the Fisher z (SE = 1/√(n - 3)) interval for Pearson and Spearman and the Fieller (SE = √(0.437/(n - 4))) interval for Kendall. In a directional hypothesis the interval is one-sided. It is reported together with r (APA 7).
Effect on the result: If switched off, the interval column is removed. The r, p, interval and n of all pairs are shown in the "ALL PAIRS" table.
On the validation data: The Pearson and Spearman intervals are computed with the Fisher z transformation (no bias adjustment); for Spearman the Fieller-Hartley-Pearson interval is wider. Kendall Oxygen x RunTime [-0.7601, -0.4363] (Fieller).
Missing data (Pairwise deletion, Listwise deletion)
Concept: Sets how missing values are handled. With pairwise deletion each correlation uses all observations complete on those two variables, so sample sizes can differ between pairs; with listwise deletion only observations complete on all selected variables are used, and every coefficient rests on the same people.
Everyday example: If 5 club members have no recorded age, pairwise deletion computes the training-time correlation from 40 members and those involving age from 35. Listwise deletion uses the same 35 members for every correlation, which keeps the coefficients consistent with one another.
What it does: In pairwise deletion each pair uses its own complete cases; in listwise deletion, the cases complete on all selected (and control) variables. Listwise is preferred if the matrix must be consistent (positive definite).
Effect on the result: n, r, p and descriptives change. With pairwise deletion the header shows the range of n per pair.
On the validation data: Fitness Weight x Oxygen pairwise r = -0.1536 (n = 29), listwise -0.1842 (n = 28); listwise mean Weight = 77.2168. With pairwise deletion the header shows n = 28-29.
Rank correlation CI (Fisher z (default), Bonett-Wright / Fieller)
Concept: For rank-based coefficients such as Spearman's and Kendall's, the Fisher z interval designed for Pearson does not always give correct coverage. The Bonett-Wright and Fieller intervals are adjusted to reflect the uncertainty of rank correlations more accurately.
Everyday example: If the club chose Spearman because of outliers, it is more appropriate to report the Bonett-Wright interval, designed for rank correlations, as the coefficient's confidence interval as well.
What it does: Gives the Bonett-Wright (SE = √((1 + r²/2)/(n - 3))) interval for Spearman and the Fieller interval for Kendall as an additional table; coverage is better than Fisher z (Bonett and Wright, 2000).
Effect on the result: An additional table; the main interval does not change. The field is disabled when Pearson is selected. For Kendall the default interval is Fieller, so the additional table equals the main interval.
On the validation data: Fitness Weight x Oxygen Spearman: Fisher [-0.4241, 0.3059], Bonett-Wright [-0.4245, 0.3063]; Kendall Fieller [-0.2627, 0.2442].
Additional output: Descriptives and N
Concept: Gives each variable's number of observations, mean and standard deviation, together with the number of observations for each pair. These are the basic details expected alongside a correlation table in academic reports.
Everyday example: In the club's report, details such as 'members run an average of 32 km a week (SD 12) and race times average 52 minutes (SD 6)' help readers see what data the correlation was computed on.
What it does: N, mean and SD per variable and N per pair; for an APA correlation table.
Effect on the result: An additional table.
On the validation data: Fitness Weight N = 31, mean 77.4445, SD 8.3286; hsb2 read 52.23 / 10.2529.
Additional output: Bootstrap CI
Concept: Finds the confidence interval for the correlation by resampling the observations with replacement thousands of times and computing the coefficient each time, instead of using a formula. It is useful when the data are not normal or the formula's assumptions are doubtful; in very small samples this interval is unstable too.
Everyday example: It is like building thousands of new 'clubs' of 40 drawn at random from the 40 members' records, some members picked more than once, and computing the correlation in each. The middle 95% of those coefficients gives the confidence interval.
What it does: For each pair, gives percentile and BCa (jackknife-accelerated) intervals from 2000 resamples (seed 42); for the r interval in non-normal data; BCa is unreliable at very small n.
Effect on the result: An additional table.
On the validation data: Fitness Oxygen x RunTime percentile [-0.9401, -0.7408], BCa [-0.9350, -0.7321]. For tuna (n = 9) the BCa lower limit is very unstable across seeds.
Additional output: Assumption checks
Concept: The significance test and confidence interval of Pearson's correlation assume that the two variables are jointly normal. Normality tests and the scatter-plot matrix let this assumption, and linearity, be checked visually and statistically.
Everyday example: If the scatter plot shows the training-time relationship not as a straight line but as a curve that flattens beyond a certain distance, Pearson describes the relationship only partly; Spearman may then be more suitable.
What it does: Per-variable Shapiro-Wilk, the Mardia multivariate skewness/kurtosis test and a scatterplot matrix; to examine Pearson's bivariate normality assumption.
Effect on the result: An additional table and chart.
On the validation data: Fitness Weight W = 0.9799, p = 0.8106; Mardia skewness 8.841 (df 10, p 0.547), kurtosis z = -0.791.
Additional output: Polychoric / biserial
Concept: Correlations used when one or both variables are ordinal or binary but can be assumed to reflect an underlying continuous, normally distributed trait. Polychoric (tetrachoric in a 2x2 table) measures the association between two ordinal variables; biserial and point-biserial measure it between a binary and a continuous variable.
Everyday example: If the club rated members' form as 'poor, fair, good' and their sleep quality on a similar three-level scale, the polychoric correlation estimates the relationship between the continuous traits beneath these two ordinal variables. For the relationship between 'injured this season?' (yes/no) and training distance, the point-biserial correlation is used.
What it does: For two variables with ≤ 10 levels gives the two-step polychoric (tetrachoric in 2x2) correlation, and for binary x continuous the biserial and point-biserial correlations; for when a normal latent variable can be assumed under the ordinal/binary variable.
Effect on the result: An additional table; an information note if there is no suitable pair.
On the validation data: hsb2 female x schtyp tetrachoric 0.0291, ses x prog polychoric 0.0198; write x female biserial 0.3222 (point-biserial 0.2565).
Control variables (partial r)
Concept: Partial correlation is the relationship that remains after the effect of one or more control variables has been removed from both variables. In semi-partial correlation, the control variable's effect is removed from only one of them.
Everyday example: The club's r = −0.70 between training distance and race time might fall to −0.55 once age is controlled. This shows that part of the relationship comes from younger members both training more and running faster, but that a strong relationship independent of age remains.
What it does: Computes partial and semi-partial (Z removed from the second variable only) correlation holding the selected variables constant; for the association purged of third variables.
Effect on the result: An additional table (r_partial, r_semi, t/z, df, n, p).
On the validation data: Fish1 Height x Width r = 0.9267; with Length3 and Weight3 held constant, partial r = 0.2569, p = 0.1558; semi-partial 0.0648.
Example on real data
Data: SAS/STAT PROC CORR Example 2.1 (Fitness)
Variables: variables Weight, Oxygen (oxygen uptake), RunTime (running time)
- Question: Is there a linear association among weight (Weight), oxygen uptake (Oxygen) and running time (RunTime) in the Fitness data?
- Method: Pearson correlation with pairwise deletion (n = 28 for Oxygen with RunTime, n = 29 for the other pairs); confidence intervals by the Fisher z transformation.
- Result: There is a strong negative association between Oxygen and RunTime: r = -0.868, p < .001, 95% CI [-0.938, -0.733]. Weight is not significantly associated with the other two variables (Weight x Oxygen r = -0.154, p = .426; Weight x RunTime r = 0.201, p = .297).
- Effect size: r² = 0.75; about three quarters of the variability in running time is shared with oxygen uptake: those with higher oxygen capacity run in a shorter time.
- Limitation: Correlation does not show causation; the intervals for weight containing zero also reflect the small sample.
- APA: A strong negative association was found between oxygen uptake and running time, r(26) = -.87, p < .001, 95% CI [-.94, -.73].
Related concepts
Fisher z transformation (correlation confidence interval)Partial and semi-partial correlationSpearman rank correlationMultiple comparisons and the familywise error rate (FWER)Polychoric and tetrachoric correlationOne-sided and two-sided tests (hypothesis direction)Listwise and pairwise deletionKendall's tau
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.