Skip to content

Instantly share code, notes, and snippets.

@marknagelberg
Created July 22, 2018 17:40
Show Gist options
  • Save marknagelberg/2ace5e06f7012c76936887d82eff6aaf to your computer and use it in GitHub Desktop.
Save marknagelberg/2ace5e06f7012c76936887d82eff6aaf to your computer and use it in GitHub Desktop.
Code to support post on significance levels required for two sample z test of proportions.
from matplotlib import pyplot
fig, ax = pyplot.subplots(figsize=(9, 9))
sns.set(style='darkgrid')
plot = sns.pointplot(x='Initial Probability',
y='Sample Size to Detect Difference',
hue='Confidence Level', ax = ax,
data=df)
labels = []
for i in range(0, 101):
if i % 5 == 0:
labels.append(str(i))
else:
labels.append('')
plot.set_xticklabels(labels=labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment