Professional Documents
Culture Documents
Introduction To Summary Statistics: The Sample Mean and Median
Introduction To Summary Statistics: The Sample Mean and Median
summary statistics:
The sample mean
and median
S TAT I S T I C A L T H I N K I N G I N P Y T H O N ( PA R T 1 )
Justin Bois
Lecturer at the California Institute of
Technology
2008 US swing state election results
45.476417910447765
n
1
mean = x̄ = ∑ xi
n
i=1
22.469999999999999
Justin Bois
Lecturer at the California Institute of
Technology
Percentiles on an ECDF
Justin Bois
Lecturer at the California Institute of
Technology
2008 US swing state election results
n
1
variance = ∑(xi − x̄)2
n
i=1
12.142602117687158
np.sqrt(np.var(dem_share_FL))
12.142602117687158
Justin Bois
Lecturer at the California Institute of
Technology
2008 US swing state election results
n
1
covariance = ∑(xi − x̄)(yi − ȳ )
n i=1