pow: Simulation of the type I error rate and the power

Description Usage Arguments Value Author(s) See Also


This is an auxiliary function. It calculates the type I error rate and the power of the design with an internal pilot study for different timings of the pilot study and for multiple actual differences in expected differences. The originally planned sample size is calculated on the basis of an assumed standard deviation. A distinction is made between one-sided and two-sided tests.


pow(delta = 0, Delta, sd, test = 1, alpha = 0.05, beta = 0.2, prop = seq(0.1, 1, 0.05),
    adj = F, rule = F, nbound = 500, simu = 10000)



Number. Expectation difference of two samples.
If you select a Test for superiority/ difference then select 'delta = 0'.
Only if you select a Test for non-inferiority you can select 'delta != 0'.
Attention: If you chose 'test = 1' and 'delta != 0', the test for non-inferiority will
automatically be applied.
If not specified, delta is set to 0.


Number/ Vector of numbers. Relevant difference of expected values in the alternative hypothesis.


Number. Assumed standard deviation of the data.
Used to calculate the originally planned number of cases.


Number. What type of hypothesis test should be performed. One-sided (Superiority/
Non-Inferiority test) or two-sided (Test for difference).
One-sided (test = 1): Superiortity H0: mu_x - mu_y <= 0 vs. H1: mu_x - mu_y > 0
Non-Inferiority H0: mu_x - mu_y >= delta vs. H1: mu_x - mu_y < delta
Two-sided (test = 2): Difference H0: |mu_x - mu_y| = 0 vs. H1: |mu_x - mu_y| != 0
Attention: Choice of delta. (see delta)
If not specified, the one-Sided Test (Superiority/ Non-Inferiority Test) is used.


Number. Desired alpha-level of the test.
If not specified, alpha is set to 0.05.


Number. Acceptable beta error of the test.
If not specified, beta is set to 0.2.


Number/ sequence of numbers.
Timing of the internal pilot study depending on the originally planned sample size.


Logical. Should the one-sample variance, calculated in the internal pilot study, be adjusted?


Logical. Should the sample size adjustment rule be applied by Wittes and Brittain?


Number. Upper limit of the sample size.
Attention: Only if you choose nbound can a suitable standard deviation range for the plots
be calculated automatically.
If no nbound are defined then a standard deviation range must be chosen (see sd_ber).


Number. How many simulations should be performed?
If not specified, simu is set to 10000.


This function only creates the power values for multiple timings of the internal pilot studies.
The output is used in the function pow_prop to visualize the power depending on the
timing for different true expected value differences.


Csilla van Lunteren

See Also


vanLunteren/plan_norm documentation built on May 20, 2019, 12:32 p.m.