+10 XP

p-values & Statistical Significance

A p-value answers: 'If there were NO real effect, how likely would I see data this extreme?' Small p-value (< 0.05) → reject the null hypothesis.

The null hypothesis (H₀) is your boring assumption — usually 'no difference' or 'no effect'. The alternative (H₁) is what you hope to prove.

python
from scipy import stats
import numpy as np

# Did the neuron respond to stimulus A vs baseline?
baseline = np.random.normal(5, 2, 50)   # 50 baseline trials
stimulus = np.random.normal(8, 2, 50)   # 50 stimulus trials

t_stat, p_value = stats.ttest_ind(baseline, stimulus)
print(f'p = {p_value:.4f}')
if p_value < 0.05:
    print('Significant response!')

scipy.stats.ttest_ind: the standard NMA significance test.

🦌 Ilya says: NMA uses p < 0.05 as a threshold, but always think about effect size too — a tiny but 'significant' effect may not matter biologically.