Skip to content

Instantly share code, notes, and snippets.

@eustin
Created May 15, 2023 22:53
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 eustin/68c32020c58f9eb7770dfa1e6fc7ace4 to your computer and use it in GitHub Desktop.
Save eustin/68c32020c58f9eb7770dfa1e6fc7ace4 to your computer and use it in GitHub Desktop.
stat_sig_random_13
OBSERVED_DIFF_IN_RATES = 0.167 # this is our experiment result
num_diffs_gte_observed = (simulated_diffs_in_rates >= OBSERVED_DIFF_IN_RATES).sum()
num_samples = simulated_diffs_in_rates.shape[0]
print(f"{num_diffs_gte_observed:,} out of {num_samples:,} random samples show differences in rates greater than or equal to {OBSERVED_DIFF_IN_RATES:.1%}")
print(f"percentage of random noise distribution with difference in rates greater than or equal to {OBSERVED_DIFF_IN_RATES:.1%}: {num_diffs_gte_observed / num_samples:.2%}")
#> 1,267 out of 10,000 random samples show differences in rates greater than or equal to 16.7%
#> percentage of random noise distribution with difference in rates greater than or equal to 16.7%: 12.67%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment