29 Sample survivorships study
0.70
esurvival <- 0.05 type1pval =
- The expected survival rate for the selected patient population is 70%.
- The survivorship outcome follows a binomial distribution.
- The patient safety monitoring team will evaluate survivorship after every cohort of 5 patients.
- The study will be suspended if there exists less than 5% likelihood that the observed number of mortalities occurred by chance (given the expected survivorship).
- The minimum number of patient survivals for continuation is to be determined.
The binomial distribution is a discrete probability distribution. It describes the outcome of n independent trials in an experiment. Each trial is assumed to have only two outcomes, either success or failure. If the probability of a successful trial is p, then the probability of having x successful outcomes in an experiment of n independent trials is as follows.
The probability of getting exactly ‘’k’’ successes in ‘’n’’ independent Bernoulli trials is given by the [[probability mass function]]:
\[f(k,n,p) = \Pr(k;n,p) = \Pr(X = k) = \binom{n}{k}p^k(1-p)^{n-k}\]
for ‘’k’‘ = 0, 1, 2, …, ’‘n’’, where
\[\binom{n}{k} =\frac{n!}{k!(n-k)!}\]
is the [[binomial coefficient]], hence the name of the distribution. The formula can be understood as follows. ‘’k’’ successes occur with probability ‘’p’‘’‘k’‘ and’‘n’‘ − ’‘k’’ failures occur with probability (1 − ‘’p’‘)’‘n’‘ − ’‘k’‘. However, the’‘k’’ successes can occur anywhere among the ‘’n’’ trials, and there are different ways of distributing ‘’k’’ successes in a sequence of ‘’n’’ trials.
Create some empty lists:
NULL
Mortalities <- NULL
Survivals <- NULL
Study.Patients <- NULL
Cumulative <- NULL
CumVal <- NULL
Type1.P.Value <- NULL Type2.P.Value <-
Fill in the lists based on the binomial distribution.
## Loop over groups of patience of a give size
for (i in 1:10){
*50 ## Number of patience at the conclusion of this group
n=i pbinom(0:n, n, esurvival) ## Calculated the cumulative binomial distribution of survival
pdist <- (pdist > type1pval) ## Cumulative survival is acceptable risk
Cumulative <- min(which (Cumulative))-1 ## Minimum survivals acceptable risk
Survivals[i] <- pdist[Survivals[i]] ## Cumulative probability at that number of survivals
CumVal[i] <- n-Survivals[i] ## Number of mortalities at that number of survivals
Mortalities[i] <- n ## The number of patients having gone through the study
Study.Patients[i] <-## 95% confindence interval that the identified number of survivals differs from random at the assumed survival rate
binom.test(x=Survivals[i], n=n, p = esurvival, alternative = "less", conf.level = 0.95)
bt <- (bt$p.value)
Type1.P.Value[i] <-## 95% confindence interval that the identified number of mortalities differs from random at the assumed survival rate
binom.test(x=(Survivals[i]-1), n=n, p = esurvival, alternative = "less", conf.level = 0.95)
bt <- (bt$p.value)
Type2.P.Value[i] <- }
Make sure the lists are treated appropriately
as.integer(Study.Patients)
Study.Patients <- as.integer(Survivals)
Survivals <- as.integer(Mortalities)
Mortalities <-
CumVal*100
CumVal = as.integer(Mortalities+1)
Suspension <-
data.frame(Study.Patients, Suspension, Type1.P.Value, Type2.P.Value)
result <-colnames(result) <- c("# of Patients",
"# of Mortalities Requiring Suspension",
"Likelihood of Error (Type 1)",
"Likelihood of Error (Type 2)")