Description Usage Arguments Details Value Examples
View source: R/manual R codes.r
Calculate the fraction of A_armed for every 2X2 table numerated in the serialTables () when N patients to be treated.
1 | A.frac(x)
|
x |
a vector of 4 elements including 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 (failure).
the fraction of A-arm selected
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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
A.frac(x=c(AS,AF,BS,BF))
library(combinat)
N <- 10
out <- serialTables(N)
ABSF<-sapply(out$Z, unlist)
A.fraction<-apply(ABSF,1,A.frac)
# the fraction of A-arm selected per table.
A.fraction
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.