powerBuyseTest {BuyseTest} | R Documentation |
Performs a simulation studies for several sample sizes. Returns estimates, standard errors, confidence intervals and p.values.
powerBuyseTest(sim, sample.size, sample.sizeC = NULL, sample.sizeT = NULL, n.rep, null = c(0, 1), cpus = 1, alternative = NULL, seed = 10, conf.level = NULL, order.Hprojection = NULL, transformation = NULL, trace = 1, ...)
sim |
[function] take two arguments:
the sample size in the control group ( |
sample.size |
[integer vector, >0] the various sample sizes at which the simulation should be perform.
Disregarded if any of the arguments |
sample.sizeC |
[integer vector, >0] the various sample sizes in the control group. |
sample.sizeT |
[integer vector, >0] the various sample sizes in the treatment group. |
n.rep |
[integer, >0] the number of simulations. |
null |
[numeric vector] the null hypothesis to be tested for the net benefit (first element) and the win ratio (second element). |
cpus |
[integer, >0] the number of CPU to use.
Only the permutation test can use parallel computation.
Default value read from |
alternative |
[character] the alternative hypothesis.
Must be one of |
seed |
[integer, >0] the seed to consider for the simulation study. |
conf.level |
[numeric] confidence level for the confidence intervals.
Default value read from |
order.Hprojection |
[integer 1,2] the order of the H-project to be used to compute the asymptotic variance. |
transformation |
[logical] should the CI be computed on the logit scale / log scale for the net benefit / win ratio and backtransformed.
Otherwise they are computed without any transformation.
Default value read from |
trace |
[integer] should the execution of the function be traced? |
... |
parameters from |
## using simBuyseTest powerBuyseTest(sim = simBuyseTest, sample.size = c(100), n.rep = 2, formula = Treatment ~ tte(eventtime, censoring = status), method.inference = "asymptotic", trace = 4) ## using user defined simulation function simFCT <- function(n.C, n.T){ out <- data.table(Y=rnorm(n.C+n.T), T=c(rep(1,n.C),rep(0,n.T)) ) return(out) } powerBuyseTest(sim = simFCT, sample.size = c(100), n.rep = 2, formula = T ~ cont(Y), method.inference = "asymptotic", trace = 4)