Package 'DSBayes'

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

Help Index


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 <[email protected]> and Wenliang Yao <[email protected]>

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 obj is specified, then thetahat and C should be set to NULL.

thetahat

A vector of regression coefficients without the intercept. If thetahat is specified, then C should be provided as well, and obj should be set at NULL.

C

A variance covariance matrix of regression. If C is given, then thetahat should also be provided, and obj should be set at NULL.

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 lvector should be as follows: the first parameter should always be the treatment indicator, then a set of binary covariates, and then the interactions between the treatment with covariates. See *Examples*.

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 <[email protected]> and Wenliang Yao (maintainer) <[email protected]>

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.