View source: R/multiple_endpoints.R
me_atleastone_among_two | R Documentation |
A stripped down version of mpe::at.least.one.endpoint, focused on double primary outcome, with starting sig_level = 0.025 by default (not 0.05, as done in sozu) in order to be comparable to a two-tailed's 0.05 returns the number of patients per group: that is has to be multiplied by two
me_atleastone_among_two(
deltas = c(0.2, 0.2),
sds = c(1, 1),
corr = 0.5,
sig_level = 0.025/length(deltas),
power = 0.8
)
## example page 66 sozu, sugimoto, hamasaki evans (sample size determination
## in clinical tirals with multiple endpoint)
me_atleastone_among_two(deltas = c(0.47, 0.48), corr = 0) # 50 in the book
me_atleastone_among_two(deltas = c(0.47, 0.48), corr = 0.3) # 56 in the book
me_atleastone_among_two(deltas = c(0.47, 0.48), corr = 0.8) # 70 in the book
me_atleastone_among_two(deltas = c(0.47, 0.48), corr = 1) # 83 in the book
## table 5.1 pag 64 (for power = 0.8)
d1 <- d2 <- seq(0.2, 0.4, by = 0.05)
corrs <- c(0, 0.3, 0.5, 0.8, 1)
cases <- expand.grid("d1" = d1, "d2" = d2, "rho" = corrs)
cases <- cases[with(cases, d1 <= d2), ]
cases <- cases[with(cases, order(d1, d2, rho)), ]
cases$sample_size <- apply(cases, 1, function(row){
me_atleastone_among_two(deltas = c(row[1], row[2]), corr = row[3])
})
tab51 <- reshape(cases, timevar = "rho", direction = "wide", idvar = c("d1", "d2"))
tab51$E1 <- apply(tab51, 1, function(row){
round(power.t.test(delta = row[1], sig.level = 0.025 / 2, power = 0.8,
alternative = 'one.sided')$n)
})
tab51$E2 <- apply(tab51, 1, function(row){
round(power.t.test(delta = row[2], sig.level = 0.025 / 2, power = 0.8,
alternative = 'one.sided')$n)
})
tab51
## check of not standardized effects measures: all must be equal
me_atleastone_among_two(deltas = c(0.5, 0.5), sds = c(1,1))
me_atleastone_among_two(deltas = c(1, 1), sds = c(2,2))
me_atleastone_among_two(deltas = c(2, 2), sds = c(4,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.