Calls the case1ph
, case2ph
, or case2probit
function to fit the corresponding model.
Give point estimates and credible intervals for regression coefficients and estimation and plot of survival functions.
ICBayes(L, ...)# S3 method for default
ICBayes(L, R, model, status, xcov, x_user=NULL, order=2,
sig0=10, coef_range=5, m0=0, v0=0.1, a_eta=1, b_eta=1,
knots=NULL, grids=NULL, conf.int=0.95,
niter=5000, burnin=1000, thin=1, seed=NULL, ...)
# S3 method for formula
ICBayes(formula, data, ...)
a column vector of left-points of observed time intervals.
a column vector of right-points of observed time intervals. Use NA to denote infinity.
a character string specifying the type of model. Possible values are "case1ph", "case2ph", "case2po", and "case2probit".
a vector of censoring indicators. If model
="case1ph", then 1=left-censored, 0=right-censored. If model
="case2ph", "case2po", or "case2probit", then 0=left-censored, 1=interval-censored, 2=right-censored.
a matrix of covariates, each column corresponds to one covariate.
a vector of covariate values, default is NULL. Need to specify for survival estimation.
degree of I-splines (b_l
) (see details). Recommended values are 2-4. Default is 2.
standard deviation of normal prior for each regression coefficient beta_r
.
Used if model
="case1ph", "case1po", or "case2ph". Default is 10.
specify support domain of target density for beta_r
using arms
(see details).
Used if model
="case1ph", "case1po", or "case2ph". Default is 5.
mean of normal prior for gamma_0
. Default is 0.
precision of normal prior for gamma_0
. Used if model
="case2po" or "case2probit". Default is 0.1.
shape parameter of Gamma prior for gamma_l
(see details). Default is 1.
rate parameter of Gamma prior for gamma_l
(see details). Default is 1.
a sequence of points to define I-splines. Default is a sequence of time points from min to max with length=10.
a sequence of points where survival function is to be estimated. Defalult is a sequence of time points from min to max with length=100.
level for a two-sided credible interval on coefficient estimate(s). Default is 0.95.
total number of iterations of MCMC chains. Default is 5000.
number of iterations to discard at the beginning of an MCMC run. Default is 1000.
specify thinning of MCMC draws. Default is 1.
a use-specified random seed. Default is NULL.
a symbolic description of the model to be fit.
a data frame containing the variables in the model.
values passed to other functions.
an object of class ICBayes
containing the following elements:
a vector of regression coefficient estimates
a vector of sample standard deviations of regression coefficient estimates
credible intervals for regression coefficients
log pseudo marginal likelihood for model selection, the larger the better
the sequance of points where baseline survival functions is estimated
estimated baseline hazard at grids
a length(grids)*G
by 2 matrix that contains estimated hazard at grids
for x_user
, where G is the number of sets of covariate values
credible intervals for hazard function at grids
for x_user
estimated baseline survival probabilities at grids
a length(grids)*G
by 2 matrix that contains estimated survival probabilities at grids
for x_user
, where G is the number of sets of covariate values
credible intervals for survival probablities at grids
for x_user
a niter
by p matrix of mcmc chains for regression coefficients, where niter is the number of iterations and p is the number of covariates
a niter
by length{grids}*G
matrix of mcmc chains for survival probabilities at grids
, where niter is the number of iterations and G is the number of sets of covariate values
For "case1ph", "case1po", and "case2ph" models, function arms
is used to sample regression coefficient beta_r
, and coef_range
specifies the support of the indFunc
in arms
. The baseline cumulative hazard in "case1ph"and "case2ph" models and the baseline odds function in "case1po" are modeled by a linear combination of I-splines:
sum_{l=1}^{k}(gamma_l*b_l)
.
For "case2probit" model, baseline function is modeled by a linear combination of I-splines:
gamma_0+sum_{l=1}^{k}(gamma_l*b_l)
.
For "case2probit" model, regression coefficient vector beta
is sampled from a multivariate normal distribution.
For more information, please see reference.
Cai, B., Lin, X., and Wang, L. (2011). Bayesian proportional hazards model for current status data with monotone splines. Computational Statistics and Data Analysis, 55 2644-2651.
Lin, X. and Wang, L. (2009). A semiparametric probit model for case 2 interval-censored failure time data. Statistics in Medicine, 29 972-981.
Lin, X. and Wang, L. (2011). Bayesian proportional odds model for analyzing current status data: univariate, clustered, and multivariate. Communication in Statistics-Simulation and Computation, 40 1171-1181.
Lin, X., Cai, B., Wang, L., and Zhang, Z. (submitted). Bayesian proportional hazards model for general interval-censored data.
# NOT RUN {
# To save time in checking package, niter is set to only 500 iterations.
# formula form
data(bcdata)
bcdata<-data.frame(bcdata) # must be a data frame
try<-ICBayes(Surv(L,R,type='interval2')~x1,data=bcdata,
model='case2ph',status=bcdata[,3],x_user=c(0,1),knots=seq(0.1,60.1,length=10),
grids=seq(0.1,60.1,by=1),coef.int=0.95,niter=500,burnin=100,seed=20161224)
# general form
try2<-ICBayes(model='case2ph',L=bcdata[,1],R=bcdata[,2],status=bcdata[,3],
xcov=bcdata[,4],x_user=c(0,1),knots=seq(0.1,60.1,length=10),
grids=seq(0.1,60.1,by=1),coef.int=0.95,niter=500,burnin=100,seed=20161224)
# }
Run the code above in your browser using DataLab