Skip to content

Instantly share code, notes, and snippets.

@wfaria
Created March 10, 2019 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfaria/94f3db146c7a0fa586c1bbe3caf7b00a to your computer and use it in GitHub Desktop.
Save wfaria/94f3db146c7a0fa586c1bbe3caf7b00a to your computer and use it in GitHub Desktop.
x = []
y = []
y1 = []
y2 = []
fig, axes = plt.subplots(1, 2, figsize = (10, 6))
axes = axes.ravel()
for power_of_ten in range(1, 8):
x.append(power_of_ten)
y.append(get_margin_of_error_interval(10 ** power_of_ten, 2))
for y_aux in y:
y1.append(y_aux["error"])
y2.append(y_aux["mean"])
axes[0].set_title("Margin of error X Log of Sample Size (Smaller is better)")
axes[0].set_ylabel("Margin of error")
axes[0].set_xlabel("Sample Size = 10^x")
axes[0].plot(x, y1)
axes[1].set_title("Sample Mean X Log of Sample Size")
axes[1].set_ylabel("Sample Mean")
axes[1].set_xlabel("Sample Size = 10^x")
axes[1].plot(x, y2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment