bayes_min_n | R Documentation |
This function searches over the range specified by min_n to max_n for the smallest sample size that achieves a desired power (e.g. .8). If desired power is not reached, function defaults to returning the maximum allowable sample size.
bayes_min_n( req_p = 0.995, true_p = 0.995, gamma = 0.8, power = 0.8, alpha = 0.05, prior_alpha = 0.5, prior_beta = 0.5, min_n = 500, max_n = 1800, step_size = 10 )
req_p |
observed count |
true_p |
total count |
gamma |
posterior probability threshold needed to reject, defaults to .8 |
power |
Desired power, defaults to .8 |
prior_alpha |
alpha parameter of beta prior, defaults to .5 (Jeffrey's prior) |
prior_beta |
beta parameter of beta prior, defaults to .5 (Jeffrey's prior) |
min_n |
smallest n to search |
max_n |
maximum possible n to search |
n1 |
first stage sample size, defaults to 200 |
n2 |
second stage sample size, defaults to 800 |
list containing minimum selected sample size and associated probability of rejection
bayes_min_n(true_p = .994, gamma = .6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.