Correlation coefficient

Descriptive statistics · Method and input reference

Paired observations of equal length. Pearson, Spearman and Kendall correlations; covariance uses n−1. Synthetic example: 120 matched baseline and week-12 blood pressures (mmHg). Row positions identify the same person; responses vary and some worsen.

Open calculator · Compare methods in the decision matrix

When to consider it

  • Estimate monotonic association using rank correlation.
  • Estimate a linear association between two numeric variables.
  • Estimate concordance using Kendall’s tau-b, which accounts for tied ranks.

Assumptions and scope

  • Independent paired observations; inspect the relationship for monotonicity and influential points.
  • Rank correlation does not establish causation.
  • Independent paired observations; inspect linearity, outliers and sampling assumptions for inference.
  • Correlation does not establish causation.
  • Independent paired observations. Small sample size alone does not determine the right correlation measure.

Shares the correlation calculator.

Required inputs

  • Observations — Numeric observations; preserve the row and column structure described above.
  • Second sample — Numeric observations; preserve the row and column structure described above.

Review missing values and data coding before running. Sample inputs are synthetic teaching examples.

Implementation

Lifescio validates inputs and formats results; listed functions are the principal calculation routines, not an exhaustive transitive dependency list.

  • scipy 1.15.3: scipy.stats.pearsonr, scipy.stats.spearmanr, scipy.stats.kendalltau

These are pinned library versions; saved results record the versions actually used at runtime.

Library references