Skip to content

Instantly share code, notes, and snippets.

@ricardobeat
Created March 8, 2024 09:35
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 ricardobeat/9791598214c6237cdb45cf961b7ef7dc to your computer and use it in GitHub Desktop.
Save ricardobeat/9791598214c6237cdb45cf961b7ef7dc to your computer and use it in GitHub Desktop.
Sequential test based on Evan Miller's
function sequentialTest(control, treatment, sample) {
if (treatment - control >= 2.25 * Math.sqrt(sample)) {
return 'treatment wins'
} else if (control - treatment >= 2.25 * Math.sqrt(sample)) {
return 'control wins'
} else if (treatment + control >= sample) {
return 'stop test. no winner'
}
return 'continue testing'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment