Confidence inter v als P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON Conor De w e y Data Scientist , Sq u arespace
Intro to sampling 1 Wikimedia PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
What is a confidence inter v al ? 1 Wikimedia PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Calc u lating confidence inter v als PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Calc u lating confidence inter v als PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E x ample : means import scipy.stats as st a = range(10,14) st.t.interval(0.95, len(a) - 1, loc = np.mean(a), scale = st.sem(a)) (9.446, 13.554) PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E x ample : proportions from sm.stats.proportion import proportion_conf proportion_confint(4, 10, .05) (0.0964, 0.7036) PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
S u mmar y Sampling Con � dence inter v als E x ample PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Let ' s prepare for the inter v ie w! P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON
H y pothesis testing P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON Conor De w e y Data Scientist , Sq u arespace
Q u ick re v ie w 1 x kcd PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Ass u mptions Random sampling Independent obser v ations Normall y distrib u ted Constant v ariance PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Generating h y potheses PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Which test to u se PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E v al u ating res u lts 0,4 0,4 0,3 0,3 0,2 0,2 0,1 0,1 x -4 -4 -3 -3 -2 -2 -1 -1 0 1 2 3 4 1 Wikimedia PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
T y pes of errors 1 AB Tast y PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
S u mmar y Q u ick re v ie w Ass u mptions Testing process T y pes of errors PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Let ' s prepare for the inter v ie w! P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON
Po w er and sample si z e P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON Conor De w e y Data Scientist , Sq u arespace
Po w er anal y sis Many Few 1 P u blic domain v ectors PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Mo v ing parts E � ect si z e Signi � cance le v el Po w er Sample si z e PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Calc u lating sample si z e zt_ind_solve_power() tt_ind_solve_power() proportion_effectsize() PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E x ample : con v ersion rates from statsmodels.stats.power import zt_ind_solve_power import statsmodels.stats.proportion as prop std_effect = prop.proportion_effectsize(.20, .25) zt_ind_solve_power(effect_size=std_effect, nobs1=None, alpha=.05, power=.80) 1091.8962 PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E x ample : con v ersion rates from statsmodels.stats.power import zt_ind_solve_power import statsmodels.stats.proportion as prop std_effect = prop.proportion_effectsize(.20, .25) zt_ind_solve_power(effect_size=std_effect, nobs1=None, alpha=.05, power=.95) 1807.76215 PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
S u mmar y Po w er anal y sis Mo v ing parts E x ample PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Let ' s prepare for the inter v ie w! P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON
M u ltiple testing P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON Conor De w e y Data Scientist , Sq u arespace
M u ltiple comparisons problem 1 x kcd PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Correcting for m u ltiple comparisons 1 GraphPad PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Common approaches Bonferroni correction Sidak correction Step - based proced u res T u ke y’ s proced u re D u nnet ’ s correction PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Bonferroni correction 1 Wikimedia PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
E x ample from statsmodels.sandbox.stats.multicomp import multipletests p_adjusted = multipletests(pvals, alpha=.05, method='bonferroni') print(p_adjusted[0]) print(p_adjusted[1]) [ True False False False False] [0.05 0.25 0.5 1. 1. ] PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Side effects 1 What ’ s w rong w ith Bonferroni adj u stments PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
S u mmar y M u ltiple comparisons problem Common correction approaches Bonferroni correction PRACTICING STATISTICS INTERVIEW QUESTIONS IN PYTHON
Let ' s prepare for the inter v ie w! P R AC TIC IN G STATISTIC S IN TE R VIE W QU E STION S IN P YTH ON
Recommend
More recommend