Atlas
statminds
Bivariate GLM (Residual-Adjustment Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Partial Correlation

The engine for Association Purification. Partial Correlation isolates the unique bond between two variables by mathematically neutralizing the influence of confounding third factors.

Model familyBivariate GLM (Residual-Adjustment Model)
Hypothesistwo-tailed
AliasesControlled Correlation · Partialling Out · Association Purification
G1
Confounding Neutralization
Strip away the overlapping variance from a third variable to reveal the pure relationship.
G2
Spurious Relationship Audit
Identify if an association disappears after controlling for an underlying cause.
G3
Incremental Discovery
Quantify the 'residual bond' that remains after account for established demographic or clinical factors.
1

What is it?

Partial Correlation measures the linear relationship between two variables (X and Y) while programmatically holding constant the effects of one or more confounding variables (Z).

2

When to use it

  • Third Confounder: A third variable Z is known to correlate with both X and Y.
  • Spurious Checks: Confirm if a raw correlation is real or just a shared reflection of Z.
  • Suppressed Links: Reveal hidden correlations that are masked by Z.
3

Core Idea

It removes the shared variance of Z from both X and Y, then correlates the remaining residuals (what is left of X vs. what is left of Y):

XYZShared Z removed

By correlating residuals, it evaluates the direct pathway of association rather than the indirect path through Z.

4

Hypotheses

H₀: ρ_xy.z = 0 (Direct linear correlation is zero)
Hₐ: ρ_xy.z ≠ 0 (Direct linear correlation is significant)
5

How it works

  1. Run linear regression of X on Z; collect residuals (X_res).
  2. Run linear regression of Y on Z; collect residuals (Y_res).
  3. Correlate X_res with Y_res.
  4. Degrees of freedom decreases to N - 3 due to Z's constraint.
6

Assumptions

📊 Linearity: All pairwise relations (X-Y, X-Z, Y-Z) are linear.
📉 Normality: Residuals are normally distributed.
⚖️ Homoscedasticity: Consistent variance of residuals.
7

Important Note

🔍 Spurious Trap: Ice cream sales (X) and drowning rates (Y) correlate strongly (r ≈ 0.60). But when temperature (Z) is partialed out, the correlation drops to exactly zero!

8

Quick Example

PairingsRaw Correlation
Raw X vs Y0.65
X vs Z (confounder)0.70
Y vs Z (confounder)0.80
Interactive Sandbox

Partial Correlation Live Laboratory

Adjust raw correlations to see how the Venn diagram overlaps and isolates the direct r_xy.z pathway.

Presets
Raw X vs Y Correlation0.60
Confounding X vs Z0.70
Confounding Y vs Z0.70
Sample Size (N)25
Residual Scatter Space (Residual X vs. Residual Y)Plotted after Z's linear variance is completely subtracted
Calculations Output
MetricRaw ScoreControlled (Partial)
Correlation (r)0.60000.2157
Degrees of Freedom2322
t-statistic3.5971.036
Statistical Verdict
❌ Confounding Dominance
The direct relationship remains active at r_xy.z = 0.22 even after removing Z's variance.
The 12-Stage Precision Workflow
01Residual Signal
Hypotheses
We test the Null (Partial r = 0) against the discovery of a bond that persists despite the removal of confounding noise.
02Tri-Variate Normality
Assumptions
Ensuring the outcome, predictor, and covariate cluster together in a way that allows for valid residual partitioning.
03The Zero-Order Audit
Diagnostics
Comparing the raw correlation to the partial correlation to see if the relationship strengthens, weakens, or evaporates.
04focus
Correlating FlowMotion intensity with Pain Reduction while controlling for the confounding influence of Patient Motivation.
05Non-parametric Pivot
Alternatives
Knowing when to switch to Partial Spearman Rank Correlation if the residuals are skewed or the relationship is non-linear.
06Degree of Freedom Loss
Significance
Accounting for the 'Statistical Cost' of each covariate, which reduces the degrees of freedom and requires higher precision.
07Unique Variance
Effect Size
Interpreting Partial r² as the percentage of the 'Outcome Pie' uniquely shared by the two primary variables.
08Precision Buffer
Sample Size
Determining the N required to maintain power while controlling for multiple background variables.
09The Controlled Statement
Reporting
Crafting the sentence: 'The association remained significant after controlling for Age and BMI (r_p = .XX, p = .XXX).'
10Residual Logic
Software
Executing the 'ppcor' or 'statsmodels' commands, ensuring the 'z' vector correctly represents all control variables.
11The Over-control Sin
Common Mistakes
Avoiding the 'Mediation Trap': controlling for a variable that is actually on the causal path, which inadvertently strangles the effect.
12focus
Tracing the logic back to the development of partial regression coefficients and the General Linear Model.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

A hypothesis is a question sharpened to a point. Ambiguity is the enemy of inference.
Logic Core
Null · H₀

H₀: ρXY·Z = 0 (partial correlation is zero after controlling for Z)

Alternative · Hₐ

Hₐ: ρXY·Z ≠ 0 (partial correlation is non-zero after controlling for Z)

Why it matters two-tailed

Tests correlation between X and Y after removing linear effects of control variable(s) Z from both X and Y. If controlling for multiple variables, notation is ρXY·Z₁Z₂...Zₖ.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Build your analysis on rock, not sand. Verify the mathematical foundation before building the model.
Integrity Shield
6
Assumptions
3
Critical / High Severity
How to check
Quick
Create scatterplot matrix (pairs plot) for all variables; look for linear patterns. Check zero-order correlations: if r ≈ 0 but obvious curved pattern exists, linearity violated
Rigorous
Lowess/loess smoothed curves on scatterplots (should be approximately straight). Component+residual plots from regression of Y~Z and X~Z. Test for quadratic terms: if β₂ significant in Y = β₀ + β₁Z + β₂Z², linearity violated
If violated
If nonlinear relationships detected: (1) Transform variables (log, sqrt, inverse) to linearize relationships; (2) Use Spearman partial correlation (rank-based, captures monotonic nonlinear); (3) Use semi-parametric partial correlation with GAM for nonlinear control; (4) Include polynomial terms (X², Z²) in multiple regression framework instead. If X-Y nonlinear conditional on Z → partial correlation inappropriate, use regression with interactions/polynomials
spearman correlationgeneralized additive models
How to check
Quick
Univariate normality for each variable (Shapiro-Wilk test, Q-Q plots). Visual: create Q-Q plots for X, Y, and all Z variables. If all univariate normal, often (but not always) multivariate normal
Rigorous
Mardia's test for multivariate skewness and kurtosis (p > .05 indicates multivariate normality). Henze-Zirkler test. Mahalanobis distance plot: χ² Q-Q plot of squared Mahalanobis distances should be linear
If violated
If mild violation with n > 50: partial correlation is relatively robust via asymptotic normality, proceed with caution and report. If moderate violation: (1) Transform variables to normality (Box-Cox, Yeo-Johnson); (2) Use Spearman partial correlation (nonparametric, rank-based); (3) Bootstrap confidence intervals for r_partial (resampling-based inference, distribution-free); (4) Use permutation tests for significance. If severe violation with categorical/ordinal data → use different method entirely
spearman correlation
How to check
Quick
Mahalanobis distance for each observation: flag cases with D² > χ²(df=p, α=.001), where p = number of variables. Rule of thumb: D² > 3-4 SDs from centroid. 3D scatterplot matrix to visually inspect outliers in multivariate space
Rigorous
Cook's distance from regression (D > 4/n or D > 1). Leverage (hat values > 2p/n or 3p/n). DFFITS (|DFFITS| > 2√(p/n)). Influence plots combining leverage and residuals. Robust Mahalanobis distance using minimum covariance determinant (MCD)
If violated
First: verify outliers are not data entry errors (check original data). If legitimate outliers: (1) Report results with and without outliers (sensitivity analysis); (2) Use robust partial correlation with Spearman or Kendall (rank-based, less sensitive to outliers); (3) Winsorize extreme values to 5th/95th percentiles; (4) Use robust regression for residualization step (M-estimators, MM-estimators); (5) Bootstrap confidence intervals. Never remove outliers just to achieve significance without transparency
spearman correlationrobust regression
How to check
Quick
Scatterplots of Y vs Z and X vs Z: look for funnel/cone shapes (heteroscedasticity). Residual plots from Y~Z and X~Z regressions: plot residuals vs fitted values, should show constant spread
Rigorous
Breusch-Pagan test on Y~Z and X~Z regressions (p > .05 indicates homoscedasticity). White's test for heteroscedasticity. ncvTest in R car package. Scale-location plot: square root of standardized residuals vs fitted values should be flat
If violated
If heteroscedasticity detected: (1) Transform variables (log if variance increases with mean, sqrt for count-like data); (2) Use weighted partial correlation (weight by inverse variance); (3) Use robust standard errors for significance test; (4) Spearman partial correlation (rank-based, unaffected by heteroscedasticity); (5) Report Spearman alongside Pearson as sensitivity check. Note: heteroscedasticity affects significance test more than point estimate
spearman correlation
How to check
Quick
Design review: check for repeated measures (same subject multiple times), clustering (students in schools, patients in clinics), time series structure. Examine participant IDs: no ID should appear multiple times unless intentional repeated measures
Rigorous
Durbin-Watson test if sequential data (DW ≈ 2 indicates no autocorrelation, <1.5 or >2.5 problematic). Intraclass correlation (ICC) to detect clustering. Moran's I for spatial autocorrelation. Check residual autocorrelation function (ACF) plot
If violated
If repeated measures: (1) Use multilevel/mixed models with random effects for subjects; (2) Aggregate within-subject data before analysis; (3) Use cluster-robust SEs. If time series: (1) Detrend data before correlation; (2) Use time series methods (VAR, ARIMA); (3) Control for time/lagged values. If clustered: (1) Use multilevel partial correlation with random intercepts for clusters; (2) Cluster-robust SEs; (3) Aggregate to cluster level if appropriate. Never ignore dependence structure
linear mixed model
How to check
Quick
Draw directed acyclic graph (DAG) of hypothesized causal relationships. Ensure Z is a confounder (causes both X and Y), not a mediator (X→Z→Y) or collider (X→Z←Y). Domain expertise and theory review: are there known confounders not controlled?
Rigorous
Conduct sensitivity analysis: compute partial correlations with different sets of controls. Compare to zero-order correlation: if r_partial reverses sign or changes dramatically, investigate Simpson's paradox or collider bias. Use causal inference frameworks (Pearl's backdoor criterion) to validate control set
If violated
If omitted confounders: (1) Add all known confounders to control set (use multiple partial correlation); (2) Use instrumental variables if unmeasured confounding suspected; (3) Report as associational, not causal. If collider controlled: (1) Remove collider from control set; (2) Recompute partial correlation; (3) Consult DAG. If mediator controlled: (1) Report zero-order correlation for total effect; (2) Report partial correlation for direct effect; (3) Consider mediation analysis. Never control for post-treatment variables in causal analysis
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. The outliers often hold more truth than the averages.
System Health
Essential checks
  1. Scatterplot matrix for all variables to assess linearity
  2. Mahalanobis distance to identify multivariate outliers
  3. Univariate Q-Q plots for X, Y, and Z to check normality
  4. Compare zero-order correlation r_XY with partial correlation r_XY·Z to quantify control effect
Recommended checks
  1. Mardia's test or Henze-Zirkler test for multivariate normality
  2. Residual plots from Y~Z and X~Z regressions to check homoscedasticity
  3. Variance inflation factor (VIF) if controlling multiple variables (detect multicollinearity)
  4. Bootstrap confidence intervals for r_partial as sensitivity check
  5. Sensitivity analysis with different control sets
  6. Compare Pearson and Spearman partial correlations for robustness
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Meditation and Stress Controlling for Sleep Quality

Research question: Is meditation practice duration associated with perceived stress, controlling for sleep quality? Design: Cross-sectional survey (N=120) measuring weekly meditation minutes (X, continuous 0-300), Perceived Stress Scale score (Y, continuous 0-40), and Pittsburgh Sleep Quality Index (Z, continuous 0-21, higher=worse sleep). Rationale: Sleep quality is a known confounder that affects both meditation adherence and stress levels. We test whether meditation-stress correlation persists after removing sleep's influence.

DesignCross-sectional with potential confounder
# Partial Correlation: Meditation-Stress controlling for Sleep
# Research: Does meditation predict stress after accounting for sleep quality?

# Install/load packages
library(ppcor)        # For partial correlation
library(psych)        # For pairs.panels
library(car)          # For vif
library(MVN)          # For multivariate normality tests
library(tidyverse)

# Simulate realistic data (or load: data <- read.csv("meditation_stress.csv"))
set.seed(2025)
library(MASS)

# Create correlated variables with known structure:
# Sleep (Z) causes both Meditation (X) and Stress (Y)
# Meditation (X) causes Stress (Y)
mu <- c(150, 20, 10)  # Means: meditation=150min, stress=20, sleep=10
Sigma <- matrix(c(
  2500,  -30,  -50,   # Meditation variance & covariances
   -30,   64,   15,   # Stress variance & covariances  
   -50,   15,   25    # Sleep variance & covariances
), nrow=3, byrow=TRUE)

data_matrix <- mvrnorm(n=120, mu=mu, Sigma=Sigma)
data <- data.frame(
  meditation_min = pmax(0, pmin(300, data_matrix[,1])),  # Bounded 0-300
  stress_score = pmax(0, pmin(40, data_matrix[,2])),     # Bounded 0-40
  sleep_quality = pmax(0, pmin(21, data_matrix[,3]))     # Bounded 0-21
)

# === STEP 1: Check Assumptions ===

# 1. Linearity: Scatterplot matrix
pairs.panels(data, 
             method = "pearson",
             hist.col = "steelblue",
             density = TRUE,
             ellipses = TRUE,
             main = "Scatterplot Matrix: Linearity Check")
# Look for: linear patterns (not curved), correlation ellipses

# 2. Multivariate normality
cat("\n=== Multivariate Normality Tests ===\n")
mvn_test <- mvn(data, mvnTest = "mardia")
print(mvn_test$multivariateNormality)
# Mardia skewness and kurtosis p > .05 → multivariate normal

# Univariate normality for each variable
cat("\n=== Univariate Normality(Shapiro-Wilk) ===\n")
shapiro.test(data$meditation_min)
shapiro.test(data$stress_score) 
shapiro.test(data$sleep_quality)

# Q-Q plots
par(mfrow=c(1,3))
qqnorm(data$meditation_min, main="Meditation Q-Q Plot")
qqline(data$meditation_min)
qqnorm(data$stress_score, main="Stress Q-Q Plot")
qqline(data$stress_score)
qqnorm(data$sleep_quality, main="Sleep Q-Q Plot")
qqline(data$sleep_quality)

# 3. Multivariate outliers (Mahalanobis distance)
mahal <- mahalanobis(data, colMeans(data), cov(data))
mahal_cutoff <- qchisq(0.999, df=3)  # χ² critical value, df = # variables
outliers <- which(mahal > mahal_cutoff)
cat("\n=== Multivariate Outliers ===\n")
cat("Number of outliers(p < .001):", length(outliers), "\n")
if(length(outliers) > 0) {
  cat("Outlier cases:", outliers, "\n")
}

# 4. Homoscedasticity: residual plots from Y~Z and X~Z
par(mfrow=c(1,2))
fit_yz <- lm(stress_score ~ sleep_quality, data=data)
plot(fit_yz, which=1, main="Y~Z Residuals(Stress~Sleep)")

fit_xz <- lm(meditation_min ~ sleep_quality, data=data)
plot(fit_xz, which=1, main="X~Z Residuals(Meditation~Sleep)")
# Look for: constant spread (no funnel shape)

# === STEP 2: Compute Zero-Order (Bivariate) Correlation ===
cat("\n=== Zero-Order Correlation(before controlling) ===\n")
zero_order <- cor.test(data$meditation_min, data$stress_score)
print(zero_order)
# r_XY = correlation ignoring sleep

# === STEP 3: Compute Partial Correlation ===
cat("\n=== Partial Correlation(controlling for Sleep) ===\n")

# Method 1: Using ppcor package (easiest)
partial_result <- pcor.test(data$meditation_min, 
                             data$stress_score, 
                             data$sleep_quality)
print(partial_result)
# r_XY·Z = partial correlation after removing sleep effects

# Method 2: Manual calculation (for understanding)
# Step 1: Regress Y on Z, get residuals (Y with Z removed)
resid_y <- residuals(lm(stress_score ~ sleep_quality, data=data))

# Step 2: Regress X on Z, get residuals (X with Z removed)  
resid_x <- residuals(lm(meditation_min ~ sleep_quality, data=data))

# Step 3: Correlate the residuals
partial_manual <- cor.test(resid_x, resid_y)
cat("\nManual partial correlation(residual method):\n")
print(partial_manual)

# Visualize residual correlation
ggplot(data.frame(resid_x, resid_y), aes(x=resid_x, y=resid_y)) +
  geom_point(alpha=0.5) +
  geom_smooth(method="lm", se=TRUE, color="red") +
  labs(title="Partial Correlation Visualization",
       subtitle="Meditation-Stress residuals after controlling Sleep",
       x="Meditation residuals(sleep removed)",
       y="Stress residuals(sleep removed)") +
  theme_classic()

# === STEP 4: Compare Zero-Order vs Partial ===
cat("\n=== Comparison ===\n")
cat(sprintf("Zero-order r_XY:        %.3f (p = %.4f)\n", 
            zero_order$estimate, zero_order$p.value))
cat(sprintf("Partial r_XY·Z:         %.3f (p = %.4f)\n", 
            partial_result$estimate, partial_result$p.value))
cat(sprintf("Change in r:            %.3f\n", 
            partial_result$estimate - zero_order$estimate))
cat(sprintf("Proportion explained by sleep: %.1f%%\n",
            100 * (zero_order$estimate - partial_result$estimate) / zero_order$estimate))

# === STEP 5: Effect Size ===
cat("\n=== Effect Sizes ===\n")
cat(sprintf("Partial r²:             %.3f (%.1f%% unique variance)\n",
            partial_result$estimate^2, 
            100*partial_result$estimate^2))

# Interpret partial r (Cohen's guidelines)
if(abs(partial_result$estimate) < 0.1) {
  interpretation <- "negligible"
} else if(abs(partial_result$estimate) < 0.3) {
  interpretation <- "small"  
} else if(abs(partial_result$estimate) < 0.5) {
  interpretation <- "medium"
} else {
  interpretation <- "large"
}
cat(sprintf("Interpretation:         %s effect\n", interpretation))

# === STEP 6: Bootstrap 95% CI (sensitivity check) ===
library(boot)

boot_partial <- function(data, indices) {
  d <- data[indices,]
  pcor.test(d$meditation_min, d$stress_score, d$sleep_quality)$estimate
}

set.seed(2025)
boot_results <- boot(data, boot_partial, R=1000)
boot_ci <- boot.ci(boot_results, type="perc")
cat("\n=== Bootstrap 95% CI ===\n")
print(boot_ci)

# === APA-Style Reporting ===
cat("\n=== APA-Style Report ===\n")
cat(sprintf(
  "A partial correlation was computed to assess the relationship between\nmeditation practice and perceived stress while controlling for sleep quality.\nAssumptions were checked: multivariate normality was satisfied(Mardia test\np > .05), linearity was confirmed via scatterplot matrix, and no extreme\nmultivariate outliers were detected(Mahalanobis D² < χ²_critical).\n\nThe zero-order correlation between meditation and stress was r = %.3f, p = %.3f.\nAfter controlling for sleep quality, the partial correlation was r_partial = %.3f,\np = %.3f, 95%% CI [%.3f, %.3f]. Sleep quality accounted for %.1f%% of the\noriginal correlation. The partial correlation r² = %.3f indicates that meditation\nexplains %.1f%% of unique variance in stress, beyond sleep quality. This represents\na %s effect size(Cohen, 1988).\n",
  zero_order$estimate, zero_order$p.value,
  partial_result$estimate, partial_result$p.value,
  boot_ci$percent[4], boot_ci$percent[5],
  100 * (zero_order$estimate - partial_result$estimate) / zero_order$estimate,
  partial_result$estimate^2,
  100 * partial_result$estimate^2,
  interpretation
))
Interpretation Blueprint

The zero-order correlation (r = -0.12, ignoring sleep) was attenuated after controlling for sleep quality (r_partial = -0.08, p = .38). Sleep quality explained 33% of the original meditation-stress correlation, suggesting sleep is a substantial confounder. The partial correlation was non-significant, indicating meditation's unique association with stress (beyond sleep) is weak. This highlights the importance of controlling for sleep when studying meditation-stress relationships.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Ratio / Interval
Ratio
Maintain Partial Correlation. Isolate the unique bond between variables with maximum precision.
Peak Signal
Interval
Ideal for Primary Scales. Ensure the residual variance isn't dominated by measurement noise.
Standard Precision
Ordinal
Pivot to Partial Spearman Correlation to account for rank-order residuals and non-linearity.
Rank Compression
Nominal
Abandon Correlation. Use Mantel-Haenszel or Logistic Regression to model controlled categorical bonds.
Information Suicide
Temporal Trajectory Audit Static Controlled Audit
Static Purified
Single point audit.
Stay with Partial r. Neutralize confounding third factors mathematically.
Longitudinal
Repeated measures.
Pivot to Linear Mixed Models (LMM) to control for time while modeling the association.
Adaptive Technical Safeguards · adaptive safeguards
non linearity detected
  • Partial Spearman Rho — The robust rank-based equivalent for controlled associations.
  • Polynomial Residualization — Model the confounder using squared terms before partialling.
multicollinearity
  • Semipartial Correlation — Isolate the unique variance of ONLY one variable, not both.
  • Ridge-Augmented Correlation — Apply L2 penalties to stabilize the purified bond.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons
  • Compare Pearson vs Spearman partial correlations
  • Bootstrap confidence intervals
  • Test with different control variable sets
  • Examine change from zero-order to partial correlation
Interpretation Guidelines

Partial correlation is typically a single test, not omnibus. Post-hoc considerations:

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Significance is noise. Magnitude is the signal. Measure the impact, not just the probability.
Impact Magnitude

Same as Pearson r: Small: .10, Medium: .30, Large: .50 (Cohen, 1988). Represents correlation after removing control variables from both X and Y

Proportion of variance in Y (after removing Z) explained by X (after removing Z). Example: r_partial = .30 → r² = .09 → 9% unique variance explained

If |r_partial| << |r_zero-order|, control variable is substantial confounder. If |r_partial| ≈ |r_zero-order|, control variable has minimal confounding

Recommended Metric: partial r with 95% CI (report both zero-order and partial for comparison)
Small
0.2
Medium
0.5
Large
0.8
0.50
partial r with 95% CI (report both zero-order and partial for comparison)
Recommended Measure
3
Available Metrics
ReportUse partial r with 95% CI (report both zero-order and partial for comparison) to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

At least 30 observations for stable correlation estimates. For multiple controls, n > 20 + 8*k where k = number of control variables

Effect SizeParametersRequired n
Small Effectα=.05, power=.80n ≈ 783
Medium Effectα=.05, power=.80n ≈ 84
Large Effectα=.05, power=.80n ≈ 28
G*Power StrategyUse G*Power: Exact → Correlation: Point biserial model. Input: effect size ρ (use expected partial r), α, power. Adjust for df lost to controls: effective n = n - k - 2
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Data does not speak for itself. It requires a translator. Be clear, be precise, be honest.
Narrative Arc
Worked APA paragraph example
A Pearson partial correlation was computed to assess the relationship between meditation practice duration and perceived stress while controlling for sleep quality (N=120). Assumptions were verified: multivariate normality was confirmed via Mardia's test (p = .18), linearity was evident in scatterplot matrices, and no extreme multivariate outliers were detected (Mahalanobis D² < χ²_critical). The zero-order correlation between meditation and stress was r = -.12, p = .19. After controlling for sleep quality, the partial correlation was r_partial = -.08, p = .38, 95% CI [-.26, .10]. Sleep quality accounted for 33% of the original correlation, suggesting it is a notable confounder. The partial r² = .006 indicates that meditation explains less than 1% of unique variance in stress beyond sleep quality. This represents a negligible effect size (Cohen, 1988), suggesting the meditation-stress association is largely mediated by improved sleep.
Reusable template

A Pearson/Spearman partial correlation was computed to assess the relationship between X variable and Y variable while controlling for Z variable(s). State assumption checks: 'Assumptions of linearity, multivariate normality, and absence of extreme outliers were met' or describe violations and remedies. The zero-order correlation between X and Y was r = .XX, p = .XXX. After controlling for Z, the partial correlation was r_partial = .XX, p = .XXX, 95% CI .XX, .XX. Control variable(s) accounted for XX% of the original correlation. The partial r² = .XX indicates that X explains XX% of unique variance in Y beyond Z, representing a small/medium/large effect size (Cohen, 1988). Interpret in research context.

Essential statistics to report
  • Zero-order correlation r_XY with p-value
  • Partial correlation r_XY·Z with p-value
  • 95% confidence interval for partial r
  • df (n - k - 2, where k = number of controls)
  • partial r² (unique variance explained)
  • List all control variables
  • Statement about assumption checks
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Partial Correlation Analysis (Controlling for Age)
RelationshipZero-Order rPartial r (pr)Changep (Partial)
Income ↔ Health.65.25-.40 (Spurious).004
Exercise ↔ Health.45.42-.03 (Robust)< .001
Note. Examining the link between Income and Health, removing the influence of Age. N = 500.
Change (-.40)The massive drop reveals that Age was the 'Confounder'. Older people have more money and worse health, creating a misleading raw link.
Header glossary

The Raw Link. The simple correlation before any controlling/adjusting.

The True Link. The correlation that remains after the 'noise' of the control variable (Age) is mathematically removed.

False Connection. When the raw correlation collapses after adjustment, the original link was driven by the third variable.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Execute Partial Correlation
ppcor::pcor.test(x, y, z)

# 2. Full Partial Matrix
psych::partial.r(df, x=c('var1','var2'), y='control_var')
Library stack
R
ppcorpsych
Python
pingouin
Elite Forensic Strike

Partial correlation is the foundation of Causal Inference. Use it to destroy 'Spurious Correlations' (e.g., Ice Cream Sales vs. Shark Attacks, controlling for Temperature).

# Graphical Gaussian Models (Network of Partials)
# Visualizing the 'pure' network structure
qgraph::qgraph(cor(df), graph = 'pcor')
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
Partial correlation removes Z from both X and Y (controls Z in both). Semi-partial removes Z only from X (not Y). They answer different questions and have different formulas. Partial r² is symmetric (r_XY·Z = r_YX·Z). Semi-partial r² is asymmetric (incremental variance X adds beyond Z in predicting Y).
The correction
Use partial correlation when asking: 'What is the X-Y correlation after removing Z's influence from both variables?' Use semi-partial when asking: 'How much additional variance does X explain in Y, beyond Z?' In regression, squared semi-partial r = ΔR² when adding X to model with Z. Report which type you used and why.
Why it's wrong
If Z is a mediator (X → Z → Y), controlling for Z removes the indirect effect you may want to study. This yields the 'direct effect' of X on Y, not the 'total effect'. Example: controlling for self-efficacy when studying exercise→depression may remove the primary mechanism. Collider bias can also occur.
The correction
Draw a directed acyclic graph (DAG) of your causal model. Control only for confounders (Z causes both X and Y). Do NOT control for mediators (X→Z→Y), colliders (X→Z←Y), or outcomes. If interested in mediation, use formal mediation analysis (Baron & Kenny, Sobel test, or modern causal mediation). Report zero-order correlation for total effect, partial for direct effect if theoretically justified.
Why it's wrong
Partial correlation alone doesn't show the full picture. Readers need to know: (1) the original X-Y correlation before controlling, (2) how much it changed after controlling, (3) what proportion is explained by controls. Omitting zero-order correlation makes it impossible to assess confounding magnitude.
The correction
Always report both: 'The zero-order correlation between X and Y was r = .XX, p = .XX. After controlling for Z, the partial correlation was r_partial = .XX, p = .XX. Z accounted for XX% of the original correlation.' This transparency shows whether controls meaningfully affected the relationship.
Why it's wrong
Partial correlation assumes continuous variables. If Z is categorical (e.g., gender, treatment group), you cannot simply enter it as 1,2,3. This treats categories as ordered/interval data, violating assumptions and producing invalid results.
The correction
For categorical controls with 2 levels: dummy code as 0/1, then proceed with partial correlation. For 3+ levels: create k-1 dummy variables (e.g., 3-level factor → 2 dummies), include all dummies as separate controls in multiple partial correlation. Alternatively, use stratified correlations (compute r_XY separately within each level of categorical Z), or use ANCOVA/regression framework which handles categorical predictors properly.
Why it's wrong
If control variables are highly correlated (r > .70 or VIF > 5), they share substantial variance. This makes it unclear which control is 'responsible' for any attenuation in r_XY. It also inflates standard errors, reducing statistical power and making partial correlations unstable (small data changes → large r_partial changes).
The correction
Check variance inflation factors (VIF) for all variables in regression equivalent. If VIF > 5-10, multicollinearity is problematic. Solutions: (1) Remove one of the highly correlated controls (keep the one most theoretically relevant); (2) Create a composite score (average or principal component) of correlated controls; (3) Use ridge regression or partial least squares for stabilization; (4) Report multicollinearity and interpret cautiously. Never ignore VIF > 10.
Why it's wrong
Partial correlation is still correlational. Even after controlling for known confounders, unmeasured confounders, reverse causation, and selection bias can remain. Observational partial correlations cannot establish causality. Example: exercise-cognition r_partial controlling age/education is still vulnerable to health status, genetics, SES confounding.
The correction
Partial correlation reduces confounding but does not eliminate it. For causal claims: (1) Use randomized controlled trials (RCT) with random assignment; (2) Use causal inference methods (instrumental variables, regression discontinuity, propensity score matching); (3) Longitudinal designs with temporal precedence; (4) Report as 'association' not 'effect' unless RCT. Be explicit about residual confounding limitations.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
Classic reference for correlation effect size interpretation: small r = .10, medium r = .30, large r = .50. Applies to partial correlations.
doi: 10.4324/9780203771587
[2]
Kim, S. (2015). ppcor: An R package for a fast calculation to semi-partial correlation coefficients. Communications for Statistical Applications and Methods, 22(6), 665-674.
Description of ppcor R package algorithms for partial and semi-partial correlations. Explains computational methods.
doi: 10.5351/CSAM.2015.22.6.665
[3]
Kendall, M. G., & Stuart, A. (1979). The Advanced Theory of Statistics, Vol. 2: Inference and Relationship (4th ed.). Charles Griffin & Company.
Theoretical foundation for partial correlation, relationship to multiple regression, and distributional properties under normality.
[4]
Pascoe, M. C., Thompson, D. R., Jenkins, Z. M., & Ski, C. F. (2017). Mindfulness mediates the physiological markers of stress: Systematic review and meta-analysis. Journal of Psychiatric Research, 95, 156-178.
Meta-analysis showing meditation reduces stress (d = 0.38). Sleep quality is identified as mediator/confounder. Basis for Example 1.
doi: 10.1016/j.jpsychires.2017.08.004
[5]
Northey, J. M., Cherbuin, N., Pumpa, K. L., Smee, D. J., & Rattray, B. (2018). Exercise interventions for cognitive function in adults older than 50: A systematic review with meta-analysis. British Journal of Sports Medicine, 52(3), 154-160.
Meta-analysis: exercise improves cognitive function (g = 0.29). Age and education are key confounders. Basis for Example 2.
doi: 10.1136/bjsports-2016-096587
If an association dies when the covariate is added, it was never a discovery—it was a shadow. Use Partial Correlation to separate the light from the noise.
The Interpretive Rigor Directive
statminds · PartialMind reference · v2.2 · updated 2026-01-1715 of 15 sections