Package 'PICBayes'

Title: Bayesian Models for Partly Interval-Censored Data
Description: Contains functions to fit proportional hazards (PH) model to partly interval-censored (PIC) data (Pan et al. (2020) <doi:10.1177/0962280220921552>), PH model with spatial frailty to spatially dependent PIC data (Pan and Cai (2021) <doi:10.1080/03610918.2020.1839497>), and mixed effects PH model to clustered PIC data. Each random intercept/random effect can follow both a normal prior and a Dirichlet process mixture prior. It also includes the corresponding functions for general interval-censored data.
Authors: Chun Pan
Maintainer: Chun Pan <[email protected]>
License: GPL (>= 2)
Version: 1.0
Built: 2024-12-16 06:53:55 UTC
Source: CRAN

Help Index


Bayesian Models for Partly Interval-Censored Data and General Interval-Censored Data

Description

Contains functions to fit proportional hazards (PH) model to partly interval-censored (PIC) data (Pan et al. (2020) <doi:10.1177/0962280220921552>), PH model with spatial frailty to spatially dependent PIC data (Pan and Cai (2021) <doi:10.1080/03610918.2020.1839497>), and mixed effects PH model to clustered PIC data. Each random intercept/random effect can follow both a normal prior and a Dirichlet process mixture prior. It also includes the corresponding functions for general interval-censored data.

Details

Package: PICBayes
Type: Package
Version: 1.0
Date: 2021-08-04
License: GPL>=2
LazyLoad: yes

Author(s)

Chun Pan

Maintainer: Chun Pan [email protected]


Adjacency matrix of 46 South Carolina counties

Description

The adjacency matrix of the 46 South Carolina counties. C[i,j] = 1 if county i and county j share boundaries; 0 if not. C[i,i] = 0.

Usage

data(C)

PH model with random intercept for clustered general interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept for clustered general interval-censored data. Random intercept follows a normal distribution N(0, tau^{-1}).

Usage

clusterIC_int(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, beta_iter, phi_iter, 
beta_cand, phi_cand, beta_sig0, x_user, total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor and random intercept phi_i are sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws. Same method for phi_i.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

partau

A total by 1 vector of MCMC draws of tau.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


PH model with random intercept for clustered general interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept for clustered general interval-censored data. Random intercept follows a Dirithlet process mixture distribution.

Usage

clusterIC_int_DP(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, a_tau_star, 
b_tau_star, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

DP mixture prior:

phi_i~N(0,tau_{i}^{-1})

tau_{i}~G

G~DP(alpha,G_{0})

G_{0}=Gamma(a_tau_star,b_tau_star)

tau_{h}^{*}~G_{0}, h=1,...,H

The blocked Gibbs sampler proposed by Ishwaran and James (2001) is used to sample from the posteriors under the DP mixture prior.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by 1 vector of MCMC draws of alpha.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

partau_star

A total by H matrix of MCMC draws of tau_star.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


PH model with random intercept and random treatment for clustered general interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept and random treatment for clustered general interval-censored data. Each random effect follows a normal distribution N(0, tau^{-1}).

Usage

clusterIC_trt(L, R, y, xcov, IC, scale.designX, scaled, xtrt, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, a_tau_trt, 
b_tau_trt, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

xtrt

The covariate that has a random effect.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

a_tau_trt

The shape parameter of Gamma prior for random treatment precision tau_trt.

b_tau_trt

The rate parameter of Gamma prior for random treatment precision tau_trt.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor, random intercept phi_i, and random treatment phi_trt_i are sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws. Same method for phi_i and phi_trt_i.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parphi_trt

A total by I matrix of MCMC draws of phi_trt_i, i=1,...,I.

partau

A total by 1 vector of MCMC draws of tau.

partau_trt

A total by 1 vector of MCMC draws of tau_trt.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


PH model with random intercept and random treatment for clustered general interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept and random treatment for clustered general interval-censored data. Each random effect follows a Dirichlet process mixture distribution.

Usage

clusterIC_trt_DP(L, R, y, xcov, IC, scale.designX, scaled, xtrt, area, binary, 
I, order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, 
a_tau_star, b_tau_star, a_alpha_trt, b_alpha_trt, H_trt, a_tau_trt_star, 
b_tau_trt_star, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

xtrt

The covariate that has a random effect.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

a_alpha_trt

The shape parameter of Gamma prior for alpha_trt.

b_alpha_trt

The rate parameter of Gamma prior for alpha_trt.

H_trt

The number of distinct components in DP mixture prior under blocked Gibbs sampler for random treatment.

a_tau_trt_star

The shape parameter of G_0 in DP mixture prior for random treatment.

b_tau_trt_star

The rate parameter of G_0 in DP mixture prior for random treatment.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

Both random intercept and random treatment follow its own DP mixture prior. DP mixture prior:

phi_i~N(0,tau_{i}^{-1})

tau_{i}~G

G~DP(alpha,G_{0})

G_{0}=Gamma(a_tau_star,b_tau_star)

tau_{h}^{*}~G_{0}, h=1,...,H

The blocked Gibbs sampler proposed by Ishwaran and James (2001) is used to sample from the posteriors under the DP mixture prior.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by 1 vector of MCMC draws of alpha.

paralpha_trt

A total by 1 vector of MCMC draws of alpha_trt.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parphi_trt

A total by I matrix of MCMC draws of phi_trt_i, i=1,...,I.

partau_star

A total by H matrix of MCMC draws of tau_star.

partau_trt_star

A total by H_trt matrix of MCMC draws of tau_trt_star.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


Mixed effects PH model for clustered general interval-censored data

Description

Fit a Bayesian semiparametric mixed effects PH model for clustered general interval-censored data. Each random effect follows a normal distribution N(0, tau^{-1}).

Usage

clusterIC_Z(L, R, y, xcov, IC, scale.designX, scaled, zcov, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, beta_iter, phi_iter, 
beta_cand, phi_cand, beta_sig0, x_user, total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored; 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

zcov

The design matrix for the q random effects.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The mixed effects PH model is:

h(t_{ij}|x_{ij},z_{ij})=h_{0}(t_{ij})exp(beta'x_{ij}+phi_{i}'z_{ij}),

for the jth subject in the ith cluster.

Each of the q random effects is sampled using MH algorithm separately.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


Mixed effects PH model for clustered general interval-censored data

Description

Fit a Bayesian semiparametric mixed effects PH model for clustered general interval-censored data. Each random effect follows a DP mixture distribution.

Usage

clusterIC_Z_DP(L, R, y, xcov, IC, scale.designX, scaled, zcov, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, 
a_tau_star, b_tau_star, beta_iter, phi_iter, beta_cand, phi_cand, 
beta_sig0, x_user, total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

zcov

The design matrix for the q random effects.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The mixed effects PH model is:

h(t_{ij}|x_{ij},z_{ij})=h_{0}(t_{ij})exp(beta'x_{ij}+phi_{i}'z_{ij}),

for the jth subject in the ith cluster.

Each of the q random effects is sampled using MH algorithm separately.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by q vector of MCMC draws of alpha.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan


PH model with random intercept for clustered partly interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept for clustered partly interval-censored data. Random intercept follows a normal distribution N(0, tau^{-1}).

Usage

clusterPIC_int(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, beta_iter, 
phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

The baseline hazard is approximated by a linear combination of basis M-splines:

sum_{l=1}^{K}(gamma_l*M_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor and random intercept phi_i are sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws. Same method for phi_i.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

partau

A total by 1 vector of MCMC draws of tau.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da3)
try3<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da3),
model='clusterPIC_int',area=da3[,6],IC=da3[,7],scale.designX=TRUE,scale=c(1,0),
binary=c(0,1),I=25,C=C,nn=nn,order=3,knots=c(0,2,6,max(da3[,1:2],na.rm=TRUE)+1),
grids=seq(0.1,10.1,by=0.1),a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_tau=1,b_tau=1,
beta_iter=11,phi_iter=11,beta_cand=rep(1,2),phi_cand=1,beta_sig0=10,
x_user=NULL,total=60,burnin=10,thin=1,conf.int=0.95,seed=1)

PH model with random intercept for clustered partly interval-censored data data

Description

Fit a Bayesian semiparametric PH model with random intercept for clustered partly interval-censored data. Random intercept follows a Dirithlet process mixture distribution.

Usage

clusterPIC_int_DP(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, a_tau_star, 
b_tau_star, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

DP mixture prior:

phi_i~N(0,tau_{i}^{-1})

tau_{i}~G

G~DP(alpha,G_{0})

G_{0}=Gamma(a_tau_star,b_tau_star)

tau_{h}^{*}~G_{0}, h=1,...,H

The blocked Gibbs sampler proposed by Ishwaran and James (2001) is used to sample from the posteriors under the DP mixture prior.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by 1 vector of MCMC draws of alpha.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

partau_star

A total by H matrix of MCMC draws of tau_star.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da3)
try4<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da3),
model='clusterPIC_int_DP',area=da3[,6],IC=da3[,7],scale.designX=TRUE,
scale=c(1,0),binary=c(0,1),I=25,C=C,order=3,
knots=c(0,2,6,max(da3[,1:2],na.rm=TRUE)+1),grids=seq(0.1,10.1,by=0.1),
a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_alpha=1,b_alpha=1,H=5,a_tau_star=1,
b_tau_star=1,beta_iter=11,phi_iter=11,beta_cand=rep(1,2),phi_cand=1,
beta_sig0=10,x_user=NULL,total=60,burnin=10,thin=1,conf.int=0.95,seed=1)

PH model with random intercept and random treatment for clustered partly interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept and random treatment for clustered partly interval-censored data. Each random effect follows a normal distribution N(0, tau^{-1}).

Usage

clusterPIC_trt(L, R, y, xcov, IC, scale.designX, scaled, xtrt, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, a_tau_trt, 
b_tau_trt, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

xtrt

The covariate that has a random effect.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

a_tau_trt

The shape parameter of Gamma prior for random treatment precision tau_trt.

b_tau_trt

The rate parameter of Gamma prior for random treatment precision tau_trt.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

The baseline hazard is approximated by a linear combination of basis M-splines:

sum_{l=1}^{K}(gamma_l*M_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor, random intercept phi_i, and random treatment phi_trt_i are sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws. Same method for phi_i and phi_trt_i.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parphi_trt

A total by I matrix of MCMC draws of phi_trt_i, i=1,...,I.

partau

A total by 1 vector of MCMC draws of tau.

partau_trt

A total by 1 vector of MCMC draws of tau_trt.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da4)
try5<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da4),
model='clusterPIC_trt',xtrt=da4[,5],area=da4[,6],IC=da4[,7],
scale.designX=TRUE,scaled=c(1,0),binary=c(0,1),I=25,order=3,
knots=c(0,2,6,max(da4[,1:2],na.rm=TRUE)+1),grids=seq(0.1,10.1,by=0.1),
a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_tau=1,b_tau=1,a_tau_trt=1,b_tau_trt=1,
beta_iter=11,phi_iter=11,beta_cand=c(1,1),phi_cand=1,
beta_sig0=10,x_user=NULL,total=60,burnin=10,thin=1,conf.int=0.95,seed=1)

PH model with random intercept and random treatment for clustered partly interval-censored data

Description

Fit a Bayesian semiparametric PH model with random intercept and random treatment for clustered partly interval-censored data. Each random effect follows a Dirichlet process mixture distribution N(0, tau^{-1}).

Usage

clusterPIC_trt_DP(L, R, y, xcov, IC, scale.designX, scaled, xtrt, area, binary, 
I, order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, 
a_tau_star, b_tau_star, a_alpha_trt, b_alpha_trt, H_trt, a_tau_trt_star, 
b_tau_trt_star, beta_iter, phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

xtrt

The covariate that has a random effect.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

a_alpha_trt

The shape parameter of Gamma prior for alpha_trt.

b_alpha_trt

The rate parameter of Gamma prior for alpha_trt.

H_trt

The number of distinct components in DP mixture prior under blocked Gibbs sampler for random treatment.

a_tau_trt_star

The shape parameter of G_0 in DP mixture prior for random treatment.

b_tau_trt_star

The rate parameter of G_0 in DP mixture prior for random treatment.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

Both random intercept and random treatment follow its own DP mixture prior. DP mixture prior:

phi_i~N(0,tau_{i}^{-1})

tau_{i}~G

G~DP(alpha,G_{0})

G_{0}=Gamma(a_tau_star,b_tau_star)

tau_{h}^{*}~G_{0}, h=1,...,H

The blocked Gibbs sampler proposed by Ishwaran and James (2001) is used to sample from the posteriors under the DP mixture prior.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by 1 vector of MCMC draws of alpha.

paralpha_trt

A total by 1 vector of MCMC draws of alpha_trt.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parphi_trt

A total by I matrix of MCMC draws of phi_trt_i, i=1,...,I.

partau_star

A total by H matrix of MCMC draws of tau_star.

partau_trt_star

A total by H_trt matrix of MCMC draws of tau_trt_star.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da4)
try2<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da4),
model='clusterPIC_trt_DP', scale.designX=TRUE,scaled=c(1,0),IC=da4[,7],xtrt=da4[,5],
area=da4[,6],binary=c(0,1),I=25,order=3,knots=c(0,2,6,max(da4[,1:2],na.rm=TRUE)+1),
grids=seq(0.1,10.1,by=0.1),a_eta=1,b_eta=1,a_ga=1,b_ga=1,
a_alpha=1,b_alpha=1,H=5,a_alpha_trt=1,b_alpha_trt=1,H_trt=5,
a_tau_star=1,b_tau_star=1,a_tau_trt_star=1,b_tau_trt_star=1,
beta_iter=11,phi_iter=11,beta_cand=rep(1,2),phi_cand=1,beta_sig0=10,
x_user=NULL,total=60,burnin=10,thin=1,conf.int=0.95,seed=1)

Mixed effects PH model for clustered partly interval-censored data

Description

Fit a Bayesian semiparametric mixed effects PH model for clustered partly interval-censored data with random effects for one or more predictors. Each random effect follows a normal distribution N(0, tau^{-1}).

Usage

clusterPIC_Z(L, R, y, xcov, IC, scale.designX, scaled, zcov, area, binary, I, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_tau, b_tau, beta_iter, 
phi_iter, beta_cand, phi_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

zcov

The design matrix for the q random effects.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The mixed effects PH model is:

h(t_{ij}|x_{ij},z_{i})=h_{0}(t_{ij})exp(beta'x_{ij}+phi_{i}'z_{i}),

for the jth subject in the ith cluster.

Each of the q random effects is sampled using MH algorithm separately.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival functions is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da4)
J=rep(1,nrow(da4))
zcov=cbind(J,da4[,4]) # The 4th column of da4 is x1.
try7<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da4),
model='clusterPIC_Z',IC=da4[,7],scale.designX=TRUE,scaled=c(1,0),zcov=zcov,
area=da4[,6],binary=c(0,1),I=25,order=3,knots=c(0,2,6,max(da4[,1:2],na.rm=TRUE)+1),
grids=seq(0.1,10.1,by=0.1),a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_tau=1,b_tau=1,
beta_iter=11,phi_iter=11,beta_cand=c(1,1),phi_cand=1,beta_sig0=10,
x_user=NULL,total=30,burnin=10,thin=1,conf.int=0.95,seed=1)

Mixed effects PH model for clustered partly interval-censored data

Description

Fit a Bayesian semiparametric mixed effects PH model for clustered partly interval-censored data with random effects for one or more predictors. Each random effect follows a DP mixture distribution.

Usage

clusterPIC_Z_DP(L, R, y, xcov, IC, scale.designX, scaled, zcov, area, binary, I, order, 
knots, grids, a_eta, b_eta, a_ga, b_ga, a_alpha, b_alpha, H, 
a_tau_star, b_tau_star, beta_iter, phi_iter, beta_cand, phi_cand, 
beta_sig0, x_user, total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

zcov

The design matrix for the q random effects.

area

The vector of cluster ID.

binary

The vector indicating whether each covariate is binary.

I

The number of clusters.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the initial MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The mixed effects PH model is:

h(t_{ij}|x_{ij},z_{i})=h_{0}(t_{ij})exp(beta'x_{ij}+phi_{i}'z_{i}),

for the jth subject in the ith cluster.

Each of the q random effects is sampled using MH algorithm separately.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

paralpha

A total by q vector of MCMC draws of alpha.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival function is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da4)
J=rep(1,nrow(da4))
zcov=cbind(J,da4[,4])
try8<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da4),
model='clusterPIC_Z_DP',IC=da4[,7],scale.designX=TRUE,scaled=c(1,0),zcov=zcov,
area=da4[,6],binary=c(0,1),I=25,order=3,knots=c(0,2,6,max(da4[,1:2],na.rm=TRUE)+1),
grids=seq(0.1,10.1,by=0.1),a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_alpha=1,b_alpha=1,H=5,
a_tau_star=1,b_tau_star=1,beta_iter=11,phi_iter=11,beta_cand=1,phi_cand=1,
beta_sig0=10,x_user=NULL,total=20,burnin=10,thin=1,conf.int=0.95,seed=1)

Coef method for a PICBayes model

Description

Extracts estimated regression coefficients.

Usage

## S3 method for class 'PICBayes'
coef(object, ...)

Arguments

object

The class PICBayes object.

...

Other arguments if any.

Value

An object of class coef.


Partly interva-censored data

Description

A simulated partly interval-censored data set based on:

lambda(t|x)=lambda_{0}(t)exp(x1+x2).

Usage

data(da1)

Format

L: Left endpoints of observed time intervals.
R: Right endpoints of observed time intervals.
y: Censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.
X1: Covariate 1.
X2: Covariate 2.
IC: General interval-censored indicator: 1=general interval-censored, 0=exact.
ID: Subject ID.

Clustered partly interva-censored data

Description

A simulated clsutered partly interval-censored data set based on PH model with spatial frailty:

lambda(t|x)=lambda_{0}(t)exp(x1+x2+phi).

Usage

data(da2)

Format

L: Left endpoints of observed time intervals.
R: Right endpoints of observed time intervals.
y: Censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.
X1: Covariate 1.
X2: Covariate 2.
area: Cluster ID.
IC: General interval-censored indicator: 1=general interval-censored, 0=exact.
ID: Subject ID.

Clustered partly interva-censored data

Description

A simulated clsutered partly interval-censored data set based on PH model with random intercept:

lambda(t|x)=lambda_{0}(t)exp(x1+x2+phi).

Usage

data(da3)

Format

L: Left endpoints of observed time intervals.
R: Right endpoints of observed time intervals.
y: Censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.
X1: Covariate 1.
X2: Covariate 2.
area: Cluster ID.
IC: General interval-censored indicator: 1=general interval-censored, 0=exact.
ID: Subject ID.

Clustered partly interva-censored data

Description

A simulated clsutered partly interval-censored data set based on PH model with random intercept and random effect for x2:

lambda(t|x)=lambda_{0}(t)exp(x1+x2+phi+phi_trt*x2).

Usage

data(da4)

Format

L: Left endpoints of observed time intervals.
R: Right endpoints of observed time intervals.
y: Censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.
X1: Covariate 1.
X2: Covariate 2.
area: Cluster ID.
IC: General interval-censored indicator: 1=general interval-censored, 0=exact.
ID: Subject ID.

PH model for general interval-censored data

Description

Fit a Bayesian semiparametric PH model to general interval-censored data.

Usage

IC(L, R, y, xcov, IC, scale.designX, scaled, binary, order, knots, grids, 
a_eta, b_eta, a_ga, b_ga, beta_iter, beta_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

binary

The vector indicating whether each covariate is binary.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

beta_cand

The sd of the proposal normal distribution in the MH sampling for beta_r.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor is sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival functions is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

References

Pan, C., Cai, B., and Wang, L. (2020). A Bayesian approach for analyzing partly interval-censored data under the proportional hazards model. Statistical Methods in Medical Research,

DOI: 10.1177/0962280220921552.


LogLik method for a PICBayes model

Description

The log-likelihood of the observed partly interval-censored data estimated by log pseudo-marginal likelihood.

Usage

## S3 method for class 'PICBayes'
logLik(object, ...)

Arguments

object

Class PICBayes object.

...

Other arguments if any.

Value

An object of class logLik.


Colorectal cancer data

Description

A progression-free survival data set derived by the author from a phase 3 metastatic colorectal cancer clinical trial.

Usage

data(mCRC)

Format

L: Left endpoints of observed time intervals.
R: Right endpoints of observed time intervals.
y: Censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.
TRT_C: Treatment arm: 0 = FOLFIRI alone, 1 = Panitumumab + FOLFIRI.
KRAS_C: Tumor KRAS mutation status: 0 = wild-type, 1 = mutant.
SITE: Clinical site where a patient is treated.
IC: General interval-censored indicator: 1=general interval-censored, 0=exact.
ID: Subject ID.

PH model for partly interval-censored data

Description

Fit a Bayesian semiparametric PH model to partly interval-censored data.

Usage

PIC(L, R, y, xcov, IC, scale.designX, scaled, binary, order, knots, grids, 
a_eta, b_eta, a_ga, b_ga, beta_iter, beta_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

binary

The vector indicating whether each covariate is binary: 1=binary, 0=not.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

beta_cand

The sd of the proposal normal distribution in the MH sampling for beta_r.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

The baseline hazard is approximated by a linear combination of basis M-splines:

sum_{l=1}^{K}(gamma_l*M_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor is sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival functions is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

References

Pan, C., Cai, B., and Wang, L. (2020). A Bayesian approach for analyzing partly interval-censored data under the proportional hazards model. Statistical Methods in Medical Research,

DOI: 10.1177/0962280220921552.

Examples

# Number of iterations set to very small for CRAN automatic testing
data(da1)
try1<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da1),
model='PIC',IC=da1[,6],scale.designX=TRUE,scale=c(1,0),binary=c(0,1),
order=3,knots=c(0,2,6,max(da1[,1:2],na.rm=TRUE)+1),grids=seq(0.1,10.1,by=0.1),
a_eta=1,b_eta=1,a_ga=1,b_ga=1,beta_iter=11,beta_cand=1,beta_sig0=10,
x_user=NULL,total=60,burnin=10,thin=1,conf.int=0.95,seed=1)

Bayesian models for partly interval-censored data and general interval-censored data

Description

Calls one of the 16 functions to fit the correspoinding model.

Usage

PICBayes(L, ...)

## Default S3 method:
PICBayes(L,R,y,xcov,IC,model,scale.designX,scaled,xtrt,zcov,
area,binary,I,C,nn,order=3,knots,grids,a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_lamb=1,
b_lamb=1,a_tau=1,b_tau=1,a_tau_trt=1,b_tau_trt=1,a_alpha=1,b_alpha=1,H=5,
a_tau_star=1,b_tau_star=1,a_alpha_trt=1,b_alpha_trt=1,H_trt=5,
a_tau_trt_star=1,b_tau_trt_star=1,beta_iter=1001,phi_iter=1001,
beta_cand,phi_cand,beta_sig0=10,x_user=NULL,
total=6000,burnin=1000,thin=1,conf.int=0.95,seed=1,...)

## S3 method for class 'formula'
PICBayes(formula, data, ...)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

model

A character string specifying the type of model. See details.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

xtrt

The covariate that has a random effect.

zcov

The design matrix for the q random effects.

area

The vector of cluster ID.

I

The number of areas.

C

The adjacency matrix.

nn

The vector of number of neighbors for each area.

binary

The vector indicating whether each covariate is binary.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_lamb

The shape parameter of Gamma prior for spatial precision lambda.

b_lamb

The rate parameter of Gamma prior for spatial precision lambda.

a_tau

The shape parameter of Gamma prior for random intercept precision tau.

b_tau

The rate parameter of Gamma prior for random intercept precision tau.

a_tau_trt

The shape parameter of Gamma prior for random treatment precision tau_trt.

b_tau_trt

The rate parameter of Gamma prior for random treatment precision tau_trt.

a_alpha

The shape parameter of Gamma prior for alpha.

b_alpha

The rate parameter of Gamma prior for alpha.

H

The number of distinct components in DP mixture prior under blocked Gibbs sampler.

a_tau_star

The shape parameter of G_0 in DP mixture prior.

b_tau_star

The rate parameter of G_0 in DP mixture prior.

a_alpha_trt

The shape parameter of Gamma prior for alpha_trt.

b_alpha_trt

The rate parameter of Gamma prior for alpha_trt.

H_trt

The number of distinct components in DP mixture prior under blocked Gibbs sampler for random treatment.

a_tau_trt_star

The shape parameter of G_0 in DP mixture prior for random treatment.

b_tau_trt_star

The rate parameter of G_0 in DP mixture prior for random treatment.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the MH sampling for beta_r.

phi_cand

The sd of the proposal normal distribution in the initial MH sampling for phi_i.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

formula

A formula expression with the response returned by the Surv function in the survival package.

data

A data frame that contains the variables named in the formula argument.

...

Other arguments if any.

Details

Possible values are "PIC", "spatialPIC", "clusterPIC_int", "clusterPIC_int_DP", "clusterPIC_trt", "clusterPIC_trt_DP", "clusterPIC_Z", and "clusterPIC_Z_DP" for partly interval-censored data; and "IC", "spatialIC", "clusterIC_int", "clusterIC_int_DP", "clusterIC_trt", "clusterIC_trt_DP", "clusterIC_Z", and "clusterIC_Z_DP" for general interval-censored data.

Value

An object of class PICBayes. Refere to each specific function for its specific values.

Author(s)

Chun Pan


Plot method for a PICBayes model

Description

Plot estimated baseline survival function at grids.

Usage

## S3 method for class 'PICBayes'
plot(x, y, ...)

Arguments

x

A sequence of points (grids) where baseline survival probabilities are estimated.

y

Estiamted baseline survival at grids.

...

Other arguments if any.

Value

A plot of baseline survival function.


PH model for spatial general interval-censored data

Description

Fit a Bayesian semiparametric PH model with spatial frailty for spatially dependent general interval-censored data.

Usage

spatialIC(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, C, nn, 
order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_lamb, b_lamb, beta_iter, 
phi_iter, beta_cand, beta_sig0, x_user, total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of area ID.

I

The number of areas.

C

The adjacency matrix.

nn

The vector of number of neighbors for each area.

binary

The vector indicating whether each covariate is binary.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_lamb

The shape parameter of Gamma prior for spatial precision lambda.

b_lamb

The rate parameter of Gamma prior for spatial precision lambda.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the MH sampling for beta_r.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor is sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parlamb

A total by 1 matrix of MCMC draws of lambda.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival functions is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

References

Pan, C. and Cai, B. (2020). A Bayesian model for spatial partly interval-censored data. Communications in Statistics - Simulation and Computation, DOI: 10.1080/03610918.2020.1839497.


PH model for spatial partly interval-censored data

Description

Fit a Bayesian semiparametric PH model with spatial frailty for spatially dependent partly interval-censored data.

Usage

spatialPIC(L, R, y, xcov, IC, scale.designX, scaled, area, binary, I, 
C, nn, order, knots, grids, a_eta, b_eta, a_ga, b_ga, a_lamb, b_lamb, 
beta_iter, phi_iter, beta_cand, beta_sig0, x_user, 
total, burnin, thin, conf.int, seed)

Arguments

L

The vector of left endpoints of the observed time intervals.

R

The vector of right endponts of the observed time intervals.

y

The vector of censoring indicator: 0=left-censored, 1=interval-censored, 2=right-censored, 3=exact.

xcov

The covariate matrix for the p predictors.

IC

The vector of general interval-censored indicator: 1=general interval-censored, 0=exact.

scale.designX

The TRUE or FALSE indicator of whether or not to scale the design matrix X.

scaled

The vector indicating whether each covariate is to be scaled: 1=to be scaled, 0=not.

area

The vector of area ID.

I

The number of areas.

C

The adjacency matrix.

nn

The vector of number of neighbors for each area.

binary

The vector indicating whether each covariate is binary.

order

The degree of basis I-splines: 1=linear, 2=quadratic, 3=cubic, etc.

knots

A sequence of knots to define the basis I-splines.

grids

A sequence of points at which baseline survival function is to be estimated.

a_eta

The shape parameter of Gamma prior for gamma_l.

b_eta

The rate parameter of Gamma prior for gamma_l.

a_ga

The shape parameter of Gamma prior for e^{beta_r}.

b_ga

The rate parameter of Gamma prior for e^{beta_r}.

a_lamb

The shape parameter of Gamma prior for spatial precision lambda.

b_lamb

The rate parameter of Gamma prior for spatial precision lambda.

beta_iter

The number of initial iterations in the Metropolis-Hastings sampling for beta_r.

phi_iter

The number of initial iterations in the Metropolis-Hastings sampling for phi_i.

beta_cand

The sd of the proposal normal distribution in the MH sampling for beta_r.

beta_sig0

The sd of the prior normal distribution for beta_r.

x_user

The user-specified covariate vector at which to estimate survival function(s).

total

The number of total iterations.

burnin

The number of burnin.

thin

The frequency of thinning.

conf.int

The confidence level of the CI for beta_r.

seed

A user-specified random seed.

Details

The baseline cumulative hazard is approximated by a linear combination of I-splines:

sum_{l=1}^{K}(gamma_l*b_l(t)).

The baseline hazard is approximated by a linear combination of basis M-splines:

sum_{l=1}^{K}(gamma_l*M_l(t)).

For a binary prdictor, we sample e^{beta_r}, with Gamma prior.

The regression coefficient beta_r for a continuous predictor is sampled using MH algorithm. During the initial beta_iter iterations, sd of the proposal distribution is beta_cand. Afterwards, proposal sd is set to be the sd of available MCMC draws.

Value

a list containing the following elements:

N

The sample size.

parbeta

A total by p matrix of MCMC draws of beta_r, r=1, ..., p.

parsurv0

A total by length(grids) matrix, each row contains the baseline survival at grids from one iteration.

parsurv

A total by length(grids)*G matrix, each row contains the survival at grids from one iteration. G is the number of sets of user-specified covariate values.

parphi

A total by I matrix of MCMC draws of phi_i, i=1,...,I.

parlamb

A total by 1 matrix of MCMC draws of lambda.

coef

A vector of regression coefficient estimates.

coef_ssd

A vector of sample standard deviations of regression coefficient estimates.

coef_ci

The credible intervals for the regression coefficients.

S0_m

The estimated baseline survival at grids.

S_m

The estimated survival at grids with user-specified covariate values x_user.

grids

The sequance of points where baseline survival functions is estimated.

DIC

Deviance information criterion.

NLLK

Negative log pseudo-marginal likelihood.

Author(s)

Chun Pan

References

Pan, C. and Cai, B. (2020). A Bayesian model for spatial partly interval-censored data. Communications in Statistics - Simulation and Computation, DOI: 10.1080/03610918.2020.1839497.

Examples

data(C)
data(da2)
nn<-apply(C,1,sum)
# Number of iterations set to very small for CRAN automatic testing
try2<-PICBayes(formula=Surv(L,R,type='interval2')~x1+x2,data=data.frame(da2),
model='spatialPIC',area=da2[,6],IC=da2[,7],scale.designX=TRUE,scale=c(1,0),
binary=c(0,1),I=46,C=C,nn=nn,order=3,knots=c(0,2,6,max(da2[,1:2],na.rm=TRUE)+1),
grids=seq(0.1,10.1,by=0.1),a_eta=1,b_eta=1,a_ga=1,b_ga=1,a_lamb=1,b_lamb=1,
beta_iter=11,phi_iter=11,beta_cand=1,beta_sig0=10,
x_user=NULL,total=50,burnin=10,thin=1,conf.int=0.95,seed=1)

Summary method for a PICBayes model

Description

Present output from function PICBayes.

Usage

## S3 method for class 'PICBayes'
summary(object, ...)

Arguments

object

Class PICBayes object.

...

Other arguments if any.

Value

An object of class summary.


Transform Surv object to data matrix with L and R columns

Description

Take a Surv object and transforms it into a data matrix with two columns, L and R, representing the left and right points of observed time intervals. For right-censored data, R = NA.

Usage

SurvtoLR(x)

Arguments

x

a Surv object

Details

The input Surv object should be in the form of Surv(L,R,type='interval2'), where R = NA for right-censored data.

Value

A data matrix with two variables:

L

left-points of observed time intervals

R

right-points of observed time intervals

References

Michael P. Fay, Pamela A. Shaw (2010). Exact and Asymptotic Weighted Logrank Tests for Interval Censored Data: The interval R Package. Journal of Statistical Software, 36 1-34.

Examples

library(survival)
L<-c(45,6,0,46)
R<-c(NA,10,7,NA)
y<-Surv(L,R,type='interval2')
SurvtoLR(y)