# NOT RUN {
# example from JBS paper p.651
doses <- c(0,10,25,50,100,150)
models <- list(linear = NULL, emax = c(25),
logistic = c(50, 10.88111), exponential=c(85),
betaMod=matrix(c(0.33,2.31,1.39,1.39), byrow=TRUE, nrow=2))
sampSize(models, doses, base = 0, maxEff = 0.4, sigma = 1,
upperN = 80, scal = 200, alpha = 0.05)
# with different summary function
sampSize(models, doses, base = 0, maxEff = 0.4, sigma = 1,
upperN = 90, scal = 200, sumFct = median, alpha = 0.05)
# with unbalanced allocations (twice as many patients in placebo group
# than in active dose groups)
sampSize(models, doses, base = 0, maxEff = 0.4, sigma = 1,
alpha = 0.05, upperN = 80, scal = 200, alRatio=c(2,1,1,1,1,1))
# iterates total sample size instead of sample size in smallest arm
# in this case no big difference
sampSize(models, doses, base = 0, maxEff = 0.4, sigma = 1,
alpha = 0.05, upperN = 500, scal = 200, typeN = "total",
alRatio=c(2,1,1,1,1,1))
# sample size calculation for general matrix of means
dvec <- c(0, 10, 50, 100)
mu1 <- c(1, 2, 2, 2)
mu2 <- c(1, 1, 2, 2)
mu3 <- c(1, 1, 1, 2)
mMat <- cbind(mu1, mu2, mu3)
dimnames(mMat)[[1]] <- dvec
sampSize(muMat = mMat, doses = dvec, sigma = 1,
alpha = 0.05, upperN = 10, alRatio=c(2,2,1,1))
# }
Run the code above in your browser using DataLab