bayesmixsurv {BayesMixSurv} | R Documentation |
Dynamic Bayesian survival model - with stratification and Lasso shrinkage - for right-censored data using two-component additive mixture-of-Weibull hazards.
Description
Bayesian survival model for right-censored data, using a sum of two hazard functions, each having a power dependence on time, corresponding to a Weibull distribution on event density. (Note that event density function for the mixture model does NOT remain a Weibull distribution.) Each component has a different shape and scale parameter, with scale parameters each being the exponential of a linear function of covariates specified in formula1
and formula2
. Stratification is implemented using a common set of intercepts between the two components. Lasso shrinkage - using Laplace prior on coefficients (Park and Casella 2008) - allows for variable selection in the presence of low observation-to-variable ratio. The mixture model allows for time-dependent (and context-dependent) hazard ratios. Confidence intervals for coefficient estimation and prediction are generated using full Bayesian paradigm, i.e. by keeping all samples rather than summarizing them into mean and sd. Posterior distribution is estimated via MCMC sampling, using univariate slice sampler with stepout and shrinkage (Neal 2003).
Usage
bayesmixsurv(formula1, data, formula2=formula1, stratCol=NULL, weights, subset
, na.action=na.fail, control=bayesmixsurv.control(), print.level=2)
bayesmixsurv.control(single=FALSE, alpha2.fixed=NULL, alpha.boundary=1.0, lambda1=1.0
, lambda2=lambda1, iter=1000, burnin=round(iter/2), sd.thresh=1e-4, scalex=TRUE
, nskip=round(iter/10))
## S3 method for class 'bayesmixsurv'
print(x, ...)
Arguments
formula1 |
Survival formula expressing the time/status variables as well as covariates used in the first component. |
data |
Data frame containing the covariates and response variable, as well as the stratification column. |
formula2 |
Survival formula expressing the covariates used in the second component. No left-hand side is necessary since the response variable information is extracted from |
stratCol |
Name of column in |
weights |
Optional vector of case weights. *Not supported yet* |
subset |
Subset of the observations to be used in the fit. *Not supported yet* |
na.action |
Missing-data filter function. *Not supported yet (only na.fail behavior works)* |
control |
See |
print.level |
Controlling verbosity level. |
single |
If |
alpha2.fixed |
If provided, it specifies the shape parameter of the second component. Default is |
alpha.boundary |
When |
lambda1 |
Lasso Shrinkage parameter used in the Laplace prior on covariates used in the first component. |
lambda2 |
Lasso Shrinkage parameter used in the Laplace prior on covariates used in the second component. Defaults to |
iter |
Number of posterior MCMC samples to generate. |
burnin |
Number of initial MCMC samples to discard before calculating summary statistics. |
sd.thresh |
Threshold for standard deviation of a covariate (after possible centering/scaling). If below the threshold, the corresponding coefficient is removed from sampling, i.e. its value is clamped to zero. |
scalex |
If |
nskip |
Controlling how often to print progress report during MCMC run. For example, if |
x |
Object of class 'bayesmixsurv', usually the result of a call to |
... |
Arguments to be passed to/from other methods. |
Value
The function bayesmixsurv.control
return a list with the same elements as its input parameters. The function bayesmixsurv
returns object of class bayesmixsurv
, with the following components:
call |
The matched call |
formula1 |
Same as input. |
formula2 |
Same as input. |
weights |
Same as input. *Not supported yet* |
subset |
Same as input. *Not supported yet* |
na.action |
Same as input. *Not supported yet* (current behavior is |
control |
Same as input. |
X1 |
Model matrix used for component 1, after potential centering and scaling. |
X2 |
Model matrix used for component 2, after potential centering and scaling. |
y |
Survival response variable (time and status) used in the model. |
contrasts1 |
The contrasts used for component 1 (where relevant). |
contrasts2 |
The contrasts used for component 2 (where relevant). |
xlevels1 |
A record of the levels of the factors used in fitting for component 1 (where relevant). |
xlevels2 |
A record of the levels of the factors used in fitting for component 2 (where relevant). |
terms1 |
The terms object used for component 1. |
terms2 |
The terms object used for component 2. |
colnamesX1 |
Names of columns for |
colnamesX2 |
Names of columns for |
apply.scale.X1 |
Index of columns of |
apply.scale.X2 |
Index of columns of |
centerVec.X1 |
Vector of centering parameters for columns of |
centerVec.X2 |
Vector of centering parameters for columns of |
scaleVec.X1 |
Vector of scaling parameters for columns of |
scaleVec.X2 |
Vector of scaling parameters for columns of |
Xg |
Model matrix associated with stratification (if any). |
stratContrasts |
The contrasts used for stratification model matrix, if any. |
stratXlevels |
A record of the levels of the factors used in stratification (if any)). |
stratTerms |
The terms object used for stratification. |
colnamesXg |
Names of columns for |
idx1 |
Vector of indexes into |
idx2 |
Vector of indexes into |
median |
List of median values, with elements including |
max |
Currently, a list with one element, |
smp |
List of coefficient samples, with elements |
Author(s)
Alireza S. Mahani, Mansour T.A. Sharabiani
References
Neal R.M. (2003). Slice Sampling. Annals of Statistics, 31, 705-767.
Park T. and Casella G. (2008) The Bayesian Lasso. Journal of the American Statistical Association, 103, 681-686.
Examples
# NOTE: to ensure convergence, typically more than 100 samples are needed
# fit the most general model, with two Weibull components and unspecified shape parameters
ret <- bayesmixsurv(Surv(time, status)~as.factor(trt)+age+as.factor(celltype)+prior, veteran
, control=bayesmixsurv.control(iter=100))
# fix one of the two shape parameters
ret2 <- bayesmixsurv(Surv(time, status)~as.factor(trt)+age+as.factor(celltype)+prior, veteran
, control=bayesmixsurv.control(iter=100, alpha2.fixed=1.0))