pgreater_NIX: Calculate the Futility Stopping Probability for Continuous...

View source: R/pgreater_NIX.r

pgreater_NIXR Documentation

Calculate the Futility Stopping Probability for Continuous Endpoint with Unknown Variances Using a Normal-Inverse-Chi-Squared Distribution

Description

Calculate the futility stopping probability in Bayesian response-adaptive randomization with a control group using the Thall \& Wathen method for continuous outcomes with unknown variances. The prior distributions follow Normal-Inverse-Chi-Squared (NIX) distributions and can be specified individually for each treatment group.

Usage

pgreater_NIX(par1, par2, delta = 0, side, ...)

Arguments

par1

current parameters including mu, kappa, nu, sigsq of a Normal-Inverse-Chi-Squared distribution from the control group.

par2

current parameters including mu, kappa, nu, sigsq of a Normal-Inverse-Chi-Squared distribution from the compared treatment group.

delta

pre-specified minimal effect size expected to be observed between the control group and the compared treatment group.

side

direction of a one-sided test, with values 'upper' or 'lower'.

...

additional arguments to be passed to stats::integrate() (such as rel.tol) from this function.

Details

This function calculates the results of Pr(\mu_k>\mu_{{\sf control}}+\delta|{\sf data}) for side equals to 'upper' and the results of Pr(\mu_{{\sf control}}>\mu_k+\delta|{\sf data}) for side equals to 'lower'. The result indicates the posterior probability of stopping a treatment group due to futility around 1\% in Bayesian response-adaptive randomization with a control arm using Thall \& Wathen method, with accumulated results during the conduct of trials. Parameters used in a Normal-Inverse-Gamma ((\mu,\sigma^2) \sim NIG({\sf mean}=m,{\sf variance}=V \times \sigma^2,{\sf shape}=a,{\sf rate}=b)) distribution should be converted to parameters equivalent in a Normal-Inverse-Chi-Squared ((\mu,\sigma^2) \sim NIX({\sf mean}=\mu,{\sf effective sample size}=\kappa,{\sf degrees of freedom}=\nu,{\sf variance}=\sigma^2/\kappa)) distribution using convert_gamma_to_chisq before applying this function.

Value

a posterior probability of Pr(\mu_k>\mu_{control}+\delta|data) with side equals to 'upper'; a posterior probability of Pr(\mu_{control}>\mu_k+\delta|data) with side equals to 'lower'.

References

\insertRef

Wathen2017RARtrials

\insertRef

Kevin2007RARtrials

Examples

para<-list(V=1/2,a=0.5,m=9.1/100,b=0.00002)
par<-convert_gamma_to_chisq(para)
set.seed(123451)
y1<-rnorm(100,0.091,0.009)
par1<-update_par_nichisq(y1, par)
set.seed(123452)
y2<-rnorm(90,0.09,0.009)
par2<-update_par_nichisq(y2, par)
pgreater_NIX(par1=par1,par2=par2, side='upper')
pgreater_NIX(par1=par1,par2=par2, side='lower')

RARtrials documentation built on April 4, 2025, 1:21 a.m.