success.frac: Average Fraction of Favorable Outcomes of Two-armed...

Description Usage Arguments Details Value Examples

View source: R/manual R codes.r

Description

Calculate the average success fraction of two arms for every 2X2 table numerated in the serialTables () when N patients to be treated.

Usage

1

Arguments

x

a vector of 4 elements inlcuding A$Success, A$Failure, B$Success, and B$Failure.

Details

A and B are examples of two arms, which resulting in favorable outcomes (success) and unfavorable outcomes (failures).

Value

average of success fraction

Examples

 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

ryamada22/SelfDecABP documentation built on May 28, 2019, 10:44 a.m.