Type: | Package |
Title: | Bayesian Subgroup Analysis in Clinical Trials |
Description: | Calculate posterior modes and credible intervals of parameters of the Dixon-Simon model for subgroup analysis (with binary covariates) in clinical trials. For details of the methodology, please refer to D.O. Dixon and R. Simon (1991), Biometrics, 47: 871-881. |
Version: | 2023.1.0 |
Date: | 2023-10-14 |
Copyright: | Ravi Varadhan |
Author: | Ravi Varadhan[aut, cre], Wenliang Yao[aut] |
Maintainer: | Ravi Varadhan <ravi.varadhan@jhu.edu> |
Depends: | R (≥ 2.15.1) |
Imports: | BB |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | no |
Repository: | CRAN |
Packaged: | 2023-10-14 13:35:27 UTC; raviv |
Date/Publication: | 2023-10-14 14:10:08 UTC |
Bayesian subgroup analysis in clinical trials
Description
Calculate posterior modes and credible intervals of parameters of the Dixon-Simon model for subgroup analysis (with binary covariates) in clinical trials.
Details
Package: | DSBayes |
Version: | 1.1 |
Date: | Dec 27, 2013 |
Depends: | R (>= 2.15.1) |
Imports: | BB |
License: | GPL Version 2 |
The main functions in this package are:
DSBayes: A function to calculate the posterior mode and credible interval of the parameters in the Dixon-Simon model, as well as the MLE regression coefficients.
Author(s)
Ravi Varadhan <rvaradhan@jhmi.edu> and Wenliang Yao <yaow080@gmail.com>
References
Dixon D. and Simon R. (1991). Bayesian Subset Analysis. Biometrics, 47, 871-881
Bayesian subgroup analysis in clinical trials
Description
Calculate posterior modes and credible intervals of parameters of the Dixon-Simon model for subgroup analysis (with binary covariates) in clinical trials.
Usage
DSBayes(obj, thetahat, C, lvector, control=list(), ...)
Arguments
obj |
The object from a regression model, for example,
linear regression or Cox proportional-hazards regression.
If |
thetahat |
A vector of regression coefficients without the intercept.
If |
C |
A variance covariance matrix of regression.
If |
lvector |
A vector or a matrix that denotes linear combination of the
parameters for which posterior estimates are desired.
Note that, the order of the |
control |
A list of control parameters. See *Details*. |
... |
Additional arguments. |
Details
The control
argument is a list that can supply any of the following components:
tol
A relative accuracy for numerical quadrature. Default is
tol = 1.e-03
.epsilon
A small positive quantity to ensure proper posterior resulting from Jeffreys' prior. Default is
epsilon = 0.005
.ci
Level of the credible interval. Default is
ci = 0.95
.k
A constant value to determine the interval width for searching the Bayesian credible interval, from lower to upper for a maximum of the density function. Default value for
k
is, k = qnorm((6+ci)/7) = 2.45.transform
= NULL, then no transformation is performed. If
transform = "logit"
, which is at default, then logit transformation is applied for posterior density function to find the credibile interval,logit(x) = log(x/(1-x))
.print
= TRUE or FALSE, indicating whether or not we want to print
control
parameters and progress. Default is FALSE.
Author(s)
Ravi Varadhan <rvaradhan@jhmi.edu> and Wenliang Yao (maintainer) <yaow080@gmail.com>
References
Dixon D. and Simon R. (1991). Bayesian Subset Analysis. Biometrics, 47, 871-881
Examples
# ex1 - use given thetahat and C matrix, and set "obj=NULL".
# an example from the clinical trial reported by Fisher(1988)
thetahat <- c(-1.57,-0.52,-0.39,.68, 1.09, 0.68, 0.91)
names(thetahat) <- c("trt","Sex","Age","Stage","trt*sex","trt*age","trt*stage")
p <- length(thetahat)
C <- matrix(NA, p, p)
C[upper.tri(C, diag=TRUE)] <- c( .1502, .0141, .0505, .0198, .0042, .0506,
.0389, -.0038, .0041, .0538, -.0361, -.0505, -.0042, .0039, .1037, -.0445,
-.0042, -.0507, -.0041, -.0046, .1066,-.1209, .0037, -.0041, -.0536, -.0025,
.0120, .1474)
C[lower.tri(C)] <- t(C)[lower.tri(t(C))]
# define lvector
trt <- rep(1,8)
cov <- as.data.frame(matrix(rep(0,24), ncol=3))
lmatrix<-as.matrix(cbind(trt,cov,rep(1:0,each=4),rep(rep(0:1,each=2),2), rep(0:1,4)))
dimnames(lmatrix)[[2]]<-c("trt","Sex","Age","Stage","trt*sex","trt*age","trt*stage")
lvector <- lmatrix[2,] # for 1 subset
#> lvector
# trt Sex Age Stage trt*sex trt*age trt*stage
# 1 0 0 0 1 0 1
# treatment effect for the subset of Female under 65 at stage C.
# in this case the reference group is Male, under 65 years, at stage B.
#lvector <- lmatrix # for all 8 subsets
result <- DSBayes(NULL, thetahat, C, lvector)
################################################################################
# ex2 - use "obj" option, and set "thetahat=NULL" and "C=NULL"
# To run ex2, you need to remove hashmark(#).
#data(simsolvd)
#simsolvd$event <- 1-simsolvd$censor
#obj <- glm(event~trt*(age+beat+lvef+cardratio+sodium),
# family = "binomial", data = simsolvd)
#
#para <- as.data.frame(matrix(rep(rep(0,5),5), ncol=5))
#lmatrix <- as.matrix(cbind(rep(1,5),para[1:5,],diag(1,5)))
#dimnames(lmatrix)[[2]] <- c("trt","age","beat","lvef","cardratio","sodium",
#"trt*age","trt*beat","trt*lvef","trt*cardratio","trt*sodium")
#lvector <- lmatrix[2,] # for 1 subset
#out <- DSBayes(obj, NULL, NULL, lvector)
Simulated SOLVD-Trial data set
Description
A simulated clinical trial based on the design of the Studies of Left Ventricular Dysfunction Trial (SOLVD-T), a placebo-controlled trial of the angiotensin-converting-enzyme inhibitor enalapril for patients with congestive heart failure.
Usage
data(simsolvd)
Format
A data frame with 2569 observations on the following 12 variables.
- trt
indicator for enalapril group
- age
age at baseline (centered and scaled)
- beat
pulse at baseline (centered and scaled)
- lymphocyte
lymphocyte count at baseline (centered and scaled)
- lvef
left ventricular ejection fraction at baseline (centered and scaled)
- noise
simulated vector of random uniform variables
- nyha
indicator whether New York Heart Association score greater than 2
- cardratio
indicator whether cardiothoracic ratio is greater than 0.5
- creatinine
creatinine at baseline (centered and scaled)
- sodium
sodium at baseline (centered and scaled)
- ttodthorchfhosp
time to death or hospitalization in days
- censor
indicator whether censored (1) or an event (0)
- current
indicator whether current smoker
Source
Simulated data set based on the clinical study reported by: Yusuf, S. et al. (1991). Effect of Enalapril on Survival in Patients with Reduced Left-Ventricular Ejection Fractions and Congestive-Heart-Failure. NEJM 325:293-302.