Learn R Programming

BayesNI (version 0.1)

bayesNI: Semiparametric Bayesian testing procedure for non-inferiority trials with binary endpoints

Description

This function calculates the Bayes factor and the cut-off value for noninfeiority trials with binary endpoints. The prior is constructed based on Bernstein polynomials with options for both informative and non-informative prior. The critical value of the test statistic (Bayes factor) is determined by minimizing total weighted error (TWE) criteria.

Usage

bayesNI(x1, x2, n1, n2, dm = 'OR', rho, m = 10, noninform.prior = TRUE, 
        w1, w2, TWE = 1, zeta = 0.5, plot.prior = FALSE)

Arguments

x1
The number of success events in the group 1
x2
The number of success events in the group 2
n1
The total number of subjects in the group 1
n2
The total number of subjects in the group 2
dm
The dissimilarity measure of two binomial parameters: "RD" risk difference ; "RR" relative risk ; "OR" odds ratio (default value)
rho
Noninferiority boundary
m
The order of Bernstein polynomials (default value m=10)
noninform.prior
"TRUE" (default) for using noninformative prior to determines weights in the mixture prior; "FALSE" user-specified weights in the mixture prior based on prior information
w1
If noninform.prior=FALSE, a user-specified vector of weights for the prior of theta_1. The length of this vector should be m.
w2
If noninform.prior=FALSE, a user-specified vector of weights for the prior of theta_2. The length of this vector should be m.
TWE
1 (default value): total weighted error conditioned on the hypotheses; 2 : total weighted error conditioned on the decisions
zeta
The weight the total weighted criteria
plot.prior
future functionality, under development.

Value

  • logBFthe observed (log) Bayes factor
  • L0the cut-off critical value of (log) Bayes factor for the rejection region
  • w1the weights used in the prior of theta_1
  • w2the weights used in the prior of theta_2

Details

This function gives the Bayes factor and the cut-off value for noninfeiority trials with binary endpoints. The prior is constructed based on Bernstein polynomials with options for both informative and non-informative prior. The weights w1 and w2 are not necessary when using non-informative prior. For informative prior, users can refer to the correspondering section in Osman and Ghosh (2012) on how to construct weights based on historical data. The Bayes factor computed in this function is define in favor of alternative hypothesis. A larger Bayes factor indicates stronger evidence against the null hypothesis. The critical value of the test statistic (Bayes factor) is determined by minimizing total weighted error (TWE) criteria. Users can refer to Theorem 1 in Osman and Ghosh (2012) for specification of the weight zeta. A common approach is to set zeta=alpha=0.05.

References

Osman M. and Ghosh S. K. (2011) Semiparametric Bayesian Testing Procedure for Non-inferiority Trials with Binary Endpoints. Journal of Biopharmaceutical Statistics, 21, 920-937.

See Also

NA

Examples

Run this code
bayesNI(x1=97,x2=98,n1=107,n2=106, dm='OR',rho=0.5, m=20,zeta=0.025, TWE=1)

Run the code above in your browser using DataLab