Biomedical Image Analysis in Python
Stephen Bailey
Instructor
df.shape
(400, 5)
df.sample(5)
age sex alzheimers brain_vol skull_vol
ID
OAS1_0272 75 F True 851.451 1411.125695
OAS1_0112 69 F False 894.801 1434.146892
OAS1_0213 48 F False 925.859 1412.781004
OAS1_0311 22 F False 980.163 1363.413762
OAS1_0201 85 F False 904.104 1420.631447
Null hypothesis: two populations' mean brain volumes ($\mu_{m}, \mu_{w}$) are equal.
$$ H_{null}: \mu_{w} = \mu_{m} $$ $$ H_{alt}\ : \mu_{w} \ne \mu_{m} $$
$$ t = \frac{\bar X - \mu}{s / \sqrt{n}} $$
Implemented in scipy.stats.ttest_ind()
brain_m = df.loc[df.sex == 'M', 'brain_vol']
brain_f = df.loc[df.sex == 'F', 'brain_vol']
from scipy.stats import ttest_ind results = ttest_ind(brain_m, brain_f)
results.statistic
results.pvalue
10.20986
5.03913e-22
A large $t$-statistic and low $p$-value suggests that there is a significant difference!
df[['brain_vol', 'skull_vol']].corr()
'brain_vol' 'skull_vol'
'brain_vol' 1.000 0.736
'skull_vol' 0.736 1.000
df['brain_norm'] = df.brain_vol / df.skull_vol
brain_norm_m = df.loc[df.sex == 'M', 'brain_norm'] brain_norm_f = df.loc[df.sex == 'F', 'brain_norm'] results = ttest_ind(brain_norm_m, brain_norm_f)
results.statistic
results.pvalue
-0.94011
0.34769
Size, not gender likely drove original results.
Image acquisition
Subject / object
Context
Data Quality
Biomedical Image Analysis in Python