AB_t2n {pwrAB} | R Documentation |
Two-Sample t-Test Power Analysis
Description
AB_t2n
performs the power analysis for AB testing. It uses the Welch's t-test,
which allows for the standard deviation to vary across groups.
Usage
AB_t2n(N = NULL, percent_B = NULL, mean_diff = NULL, sd_A, sd_B,
sig_level = NULL, power = NULL, alternative = c("two_sided", "less",
"greater"), max_sample = 1e+07)
Arguments
N |
Total number of observations (sum of observations for groups A and B) |
percent_B |
Percentage of total observations allocated to group B (between 0 and 1 - e.g. input .5 for 50%) |
mean_diff |
Difference in means of the two groups, with mean_B - mean_A |
sd_A |
Standard deviation of group A |
sd_B |
Standard deviation of group B |
sig_level |
Significance level (Type I error probability) |
power |
Power of test (1 minus Type II error probability) |
alternative |
Character string specifying the alternative hypothesis, must be one of "two_sided" (default), "greater" or "less" |
max_sample |
Maximum sample size that is searched for |
Details
Exactly one of the parameters 'N', 'percent_B', 'mean_diff', 'sig_level', and 'power' must be passed as NULL, and the omitted parameter is determined from the others. sd_A and sd_B must be specified. When 'percent_B' is the parameter omitted, two solutions may exist, in which case the smaller value will be returned
Value
Object of class "power.htest", a list of the arguments (including the computed one).
Examples
# Search for power given other parameters
AB_t2n(N = 3000, percent_B = .3, mean_diff = .15, sd_A = 1,
sd_B = 2, sig_level = .05, alternative = 'two_sided')
# Search for sample size required to satisfy other parameters
AB_t2n(percent_B = .3, mean_diff = .15, sd_A = 1,
sd_B = 2, sig_level = .05, power = .8, alternative = 'two_sided')