Power and sample size

Practicing Statistics Interview Questions in Python

Conor Dewey

Data Scientist, Squarespace

Power analysis

Power analysis car

1 Public domain vectors
Practicing Statistics Interview Questions in Python

Moving parts

  • Effect size
  • Significance level
  • Power
  • Sample size
Practicing Statistics Interview Questions in Python

Calculating sample size

  • zt_ind_solve_power()
  • tt_ind_solve_power()
  • proportion_effectsize()
Practicing Statistics Interview Questions in Python

Example: conversion 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

Example: conversion 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

Summary

  • Power analysis
  • Moving parts
  • Example
Practicing Statistics Interview Questions in Python

Let's prepare for the interview!

Practicing Statistics Interview Questions in Python

Preparing Video For Download...