Last data update: 2014.03.03

R: PH, PO, and Probit Models for Interval-Censored Data
ICBayesR Documentation

PH, PO, and Probit Models for Interval-Censored Data

Description

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.

Usage

ICBayes(L, ...)

## Default S3 method:
ICBayes(L, R, model, status, xcov, x_user=NULL, order=2, 
sig0=10, coef_range=5, v0=0.1, a_eta=1, b_eta=1, 
knots=NULL, grids=NULL, conf.int=0.95, plot_S=TRUE, chain.save=FALSE, 
dd1, niter=11000, burnin=1000, thin=1, ...)
## S3 method for class 'formula'
ICBayes(formula, data, ...)

Arguments

L

a column vector of left-points of observed time intervals.

R

a column vector of right-points of observed time intervals. Use NA to denote infinity.

model

a character string specifying the type of model. Possible values are "case1ph", "case2ph", "case2po", and "case2probit".

status

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.

xcov

a matrix of covariates, each column corresponds to one covariate.

x_user

a vector of covariate values, default is NULL. Need to specify for survival estimation.

order

degree of I-splines (b_l) (see details). Recommended values are 2-4. Default is 2.

sig0

standard deviation of normal prior for each regression coefficient beta_r. Used if model="case1ph", "case1po", or "case2ph". Default is 10.

coef_range

specify support domain of target density for beta_r using arms (see details). Used if model="case1ph", "case1po", or "case2ph". Default is 5.

v0

precision of normal prior for gamma_0. Used if model="case2po" or "case2probit". Default is 0.1.

a_eta

shape parameter of Gamma prior for gamma_l (see details). Default is 1.

b_eta

rate parameter of Gamma prior for gamma_l (see details). Default is 1.

knots

a sequence of points to define I-splines. Default is a sequence of time points from min to max with length=10.

grids

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.

conf.int

level for a two-sided credible interval on coefficient estimate(s). Default is 0.95.

niter

total number of iterations of MCMC chains. Default is 11000.

burnin

number of iterations to discard at the beginning of an MCMC run. Default is 1000.

thin

specify thinning of MCMC draws. Default is 1.

plot_S

logical; if TRUE (default), survival at grids are saved for plot.

chain.save

logical, default is FALSE; if TRUE, MCMC chains for beta_r's are saved in dd1.

dd1

needed if chain.save=TRUE; a character string specifying the directory to a local .txt file to save the MCMC chains for beta_r's.

formula

a symbolic description of the model to be fit.

data

a data frame containing the variables in the model.

...

values passed to other functions.

Details

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.

Value

an object of class ICBayes containing at least the following elements:

coef

a vector of regression coefficient estimates

coef_ssd

a vector of sample standard deviations of regression coefficient estimates

coef_ci

credible intervals for regression coefficients

LPML

log pseudo marginal likelihood for model selection, the larger the better

If plot_S is TRUE, also store:

grids

the sequance of points where baseline survival functions is estimated

S0_m

estimated baseline survival probabilities at grids

S_m

estimated survival probabilities at grids for x_user

Author(s)

Chun Pan

References

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.

See Also

case1ph, case1po, case2ph, case2probit

Examples

# 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),niter=500,burnin=100)
# 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),niter=500,burnin=100)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ICBayes)
Loading required package: HI
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICBayes/ICBayes.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ICBayes
> ### Title: PH, PO, and Probit Models for Interval-Censored Data
> ### Aliases: ICBayes ICBayes.default ICBayes.formula
> ### Keywords: case 1 interval-censored data case 2 interval-censored data
> 
> ### ** Examples
> 
> # 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),niter=500,burnin=100)
> # 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),niter=500,burnin=100)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>