Statistical note
Correlation: Pearson, Spearman, and Kendall
Linear, monotonic, and concordance-based association, with confidence intervals and microscopy examples.
Pearson’s coefficient measures linear association:
Spearman’s applies Pearson correlation to ranks; Kendall’s compares concordant and discordant pairs.
from scipy import stats
phase_mass = [11, 14, 18, 22, 27, 31]
fluorescence = [8, 12, 17, 21, 26, 35]
pearson = stats.pearsonr(phase_mass, fluorescence)
print(pearson.statistic, pearson.pvalue, pearson.confidence_interval())
print(stats.spearmanr(phase_mass, fluorescence))
print(stats.kendalltau(phase_mass, fluorescence))
Case study: QPI and fluorescence
Correlating dry mass with fluorescence per cell can reveal association, but cells nested within fields violate ordinary independence. Correlation does not establish agreement, calibration, or causality. Plot the relationship, inspect nonlinear structure and influential points, and consider hierarchical modelling.
Functions: scipy.stats.pearsonr, spearmanr, and kendalltau.