Description Usage Arguments Details Value Examples
samplesize.vanElteren
uses the procedure suggested by Zhao et al. [1] to
compute the required overall sample size for a van Elteren test
comparing two groups A and B within strata [2].
1 2 | samplesize.vanElteren(strata_fractions, treatment_fractions,
strata_fractions_alternative, alpha, beta)
|
strata_fractions |
numeric vector of length n_strata with fraction of subjects enrolled to the respective strata |
treatment_fractions |
2-by-n_strata matrix where the first row corresponds to group A and the second to group B. Each column must sum to 1 and the k-th column holds the treatment fractions for the k-th stratum. |
strata_fractions_alternative |
2-by-n_categories-by-n_strata array. I.e. strata_fractions_alternative[g, , k] holds the expected category fractions in group g (= 1 or 2) for stratum k (= 1 ... n_strata); strata_fractions_alternative[g, , k] must sum to 1. |
alpha |
maximal type one error rate |
beta |
maximal type two error rate on specified point alternative |
[1] Zhao et al., (2008), "Sample Size Calculation for the van Elteren Test Adjusting for Ties", Journal of Biopharmaceutical Statistics, 18:1112<e2><80><93>1119.
[2] van Elteren, (1960). "On the combination of independent two sample tests of Wilcoxon", Bulletin of the Institute of International Statistics, 37:351<e2><80><93>361.
N
, single number giving the required overall sample size for the
van Elteren test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # First example from [1], Table 3.
alpha <- 0.05
beta <- 0.2
strata_frac <- c(.78, .22)
n_strata <- length(strata_frac)
treatment_frac <- matrix(.5, nrow = 2, ncol = n_strata)
n_cat <- 3
strata_frac_alt_BIFl28 <- matrix(c(
0.62, 0.31, 0.07, # Duloxetine
0.51, 0.39, 0.1 # Placebo
), nrow = 2, ncol = n_cat, byrow = TRUE)
strata_frac_alt_BIFgeq28 <- matrix(c(
0.67, 0.33, 0.00, # Duloxetine
0.27, 0.55, 0.18 # Placebo
), nrow = 2, ncol = n_cat, byrow = TRUE)
strata_frac_alt <- array(c(
strata_frac_alt_BIFl28, strata_frac_alt_BIFgeq28
), dim = c(2, n_cat, n_strata))
samplesize.vanElteren(strata_frac, treatment_frac, strata_frac_alt, alpha, beta) # should be 228
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.