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. |
Authors: | Ravi Varadhan[aut, cre], Wenliang Yao[aut] |
Maintainer: | Ravi Varadhan <[email protected]> |
License: | GPL (>= 2) |
Version: | 2023.1.0 |
Built: | 2024-11-08 03:26:02 UTC |
Source: | https://github.com/cran/DSBayes |
Calculate posterior modes and credible intervals of parameters of the Dixon-Simon model for subgroup analysis (with binary covariates) in clinical trials.
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.
Ravi Varadhan <[email protected]> and Wenliang Yao <[email protected]>
Dixon D. and Simon R. (1991). Bayesian Subset Analysis. Biometrics, 47, 871-881
Calculate posterior modes and credible intervals of parameters of the Dixon-Simon model for subgroup analysis (with binary covariates) in clinical trials.
DSBayes(obj, thetahat, C, lvector, control=list(), ...)
DSBayes(obj, thetahat, C, lvector, control=list(), ...)
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. |
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.
Ravi Varadhan <[email protected]> and Wenliang Yao (maintainer) <[email protected]>
Dixon D. and Simon R. (1991). Bayesian Subset Analysis. Biometrics, 47, 871-881
# 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)
# 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)
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.
data(simsolvd)
data(simsolvd)
A data frame with 2569 observations on the following 12 variables.
indicator for enalapril group
age at baseline (centered and scaled)
pulse at baseline (centered and scaled)
lymphocyte count at baseline (centered and scaled)
left ventricular ejection fraction at baseline (centered and scaled)
simulated vector of random uniform variables
indicator whether New York Heart Association score greater than 2
indicator whether cardiothoracic ratio is greater than 0.5
creatinine at baseline (centered and scaled)
sodium at baseline (centered and scaled)
time to death or hospitalization in days
indicator whether censored (1) or an event (0)
indicator whether current smoker
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.