# NOT RUN {
library(data.table)
#### Using simBuyseTest ####
## only point estimate
powerBuyseTest(sim = simBuyseTest, sample.size = c(10, 50, 100), n.rep = 10,
formula = treatment ~ bin(toxicity), seed = 10,
method.inference = "none", trace = 4)
## point estimate with rejection rate
powerBuyseTest(sim = simBuyseTest, sample.size = c(10, 50, 100), n.rep = 10,
formula = treatment ~ bin(toxicity), seed = 10,
method.inference = "u-statistic", trace = 4)
#### Using user defined simulation function ####
## Example of power calculation for Wilcoxon test
simFCT <- function(n.C, n.T){
out <- rbind(cbind(Y=stats::rt(n.C, df = 5), group=0),
cbind(Y=stats::rt(n.T, df = 5), group=1) + 1)
return(data.table::as.data.table(out))
}
# }
# NOT RUN {
powerW <- powerBuyseTest(sim = simFCT, sample.size = c(5, 10,20,30,50,100),
n.rep = 1000, formula = group ~ cont(Y), cpus = "all")
summary(powerW)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab