This function relies upon the standard power.t.test
function to calibrate and then calculate the power curve according to the relevant non-central t-distribution. The Plot
function from this package, which in turn relies upon the standard plot
function, plots the power curve. As such, parameters in Plot
for controlling the different colors and other aspects of the display are also available, as are many of the more basic parameters in the usual plot
function.Also plotted, if provided, is the minimal meaningful difference, mmd
, as well as the minimal desired power, mdp
, provided by default. Relevant calculations regarding these values are also displayed at the console. One or both concepts can be deleted from the analysis. Not providing a value mmd
implies that the concept will not be considered, and similarly for setting mdp
to 0.
Invoke the function with the either the within-group (pooled) standard deviation, s
, or the two separate group standard deviations, s1
and s2
, from which s
is computed. If the separate standard deviations are provided, then also provide the sample sizes, either as a single value of n
or as two separate sample sizes, n1
and n2
. If separate sample sizes n1
and n2
are entered, their harmonic mean serves as the value of n
.
For power analysis of the two-sample t-test, the null hypothesis is a zero population mean difference. For a one-sample test, the null hypothesis is specified, and it is this non-null specification of mu0 that triggers the one-sample analysis. Only non-directional or two-tailed tests are analyzed.
The effect size that achieves a power of 0.8 is displayed. If a minimal meaningful difference, mmd
, is provided, then the associated power is also displayed, as well as the needed sample size to achieve a power of 0.8.
If the function is called with no parameter values, that is, as ttp()
, then the values of n1
, n2
and sw must already exist before the function call. If they do, these values are used in the power computations.