ssp_power_curve.Rd
The power curve shows how changes in effect size modify
the statistical power of a test. It is is similar to a
classical power analysis but instead of calculating the
appropriate sample size for one hypothesized population effect
size, the method calculates the required sample size for a range
of plausible population effect sizes. To plot the results use the
plot_power_curve
function.
ssp_power_curve(delta, tpr, max_n = 5000, alpha = 0.05)
delta | Numeric. A range of hypothetical population effect sizes. |
---|---|
tpr | Numeric. The desired long-run probabilities of obtaining a significant result with a one-sided t-test, given each value of Delta. |
max_n | Integer. The maximum number of participants per group (both groups are assumed to have equal sample size). |
alpha | Numeric. The level of significance. |
The function returns a list of three named numeric vectors. The first `delta` is the range of deltas provided for the function. The second `n1` the determined sample size per group. The third `tpr_out` is the TPR corresponding to the determined sample sizes with the given delta.
if (FALSE) { SampleSizePlanner::ssp_power_curve(tpr = 0.8, delta = seq(0.1, 0.9, 0.01), max_n = 5000) }