Description Usage Arguments Details Value Examples
View source: R/manual R codes.r
Calculate the average success fraction of two arms for every 2X2 table numerated in the serialTables () when N patients to be treated.
1 | success.frac(x)
|
x |
a vector of 4 elements inlcuding A$Success, A$Failure, B$Success, and B$Failure. |
A and B are examples of two arms, which resulting in favorable outcomes (success) and unfavorable outcomes (failures).
average of success fraction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | AS<-13
# the successful counts of A treatment
AF<-5
# the failures of A treatment
BS<-2
# the successful counts of B treatment
BF<-1
# the failures of B treatment
N<- AS+AF+BS+BF
success.frac(x=c(AS,AF,BS,BF))
library(combinat)
N <- 10
out <- serialTables(N)
ABSF<-sapply(out$Z, unlist)
success.fraction<-apply(ABSF,1,success.frac)
# the average fraction of successes per table.
success.fraction
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.