Simulate Rejection Probability and Sample Size for Student's t-Test
This function simulates the probability that a test defined by
setupStudent
rejects the null hypothesis.
Note that here the nuisance parameter nuisance
is the variance
of the outcome variable sigma^2.
simulation( design, n1, nuisance, recalculation = TRUE, delta_true, iters = 1000, seed = NULL, allocation = c("approximate", "exact"), ... )
design |
Object of class |
n1 |
Either the sample size of the first stage (if
|
nuisance |
Value of the nuisance parameter. For the Student's t-test this is the variance. |
recalculation |
Should the sample size be recalcuated after n1 patients are recruited? |
delta_true |
effect measure under which the rejection probabilities are computed |
iters |
Number of simulation iterations. |
seed |
Random seed for simulation. |
allocation |
Whether the allocation ratio should be preserved
exactly ( |
... |
Further optional arguments. |
The implementation follows the algorithm in Lu (2019):
Distribution of the two-sample t-test statistic following blinded
sample size re-estimation.
Pharmaceutical Statistics 15: 208-215.
Since Lu (2019) assumes negative non-inferiority margins, the non-inferiority
margin of design
is multiplied with -1 internally.
Simulated rejection probabilities and sample sizes for each nuisance parameter.
d <- setupStudent(alpha = .025, beta = .2, r = 1, delta = 3.5, delta_NI = 0, alternative = "greater", n_max = 156) simulation(d, n1 = 20, nuisance = 5.5, recalculation = TRUE, delta_true = 3.5)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.