CuMRes {BGPhazard}  R Documentation 
Bayesian Semiparametric Cure Rate Model with an Unknown Threshold
Description
Posterior inference for the bayesian semiparametric cure rate model in survival analysis.
Usage
CuMRes(
times,
delta = rep(1, length(times)),
type.t = 3,
K = 5,
utao = NULL,
alpha = rep(0.01, K),
beta = rep(0.01, K),
c.r = rep(1, (K  1)),
type.c = 4,
epsilon = 1,
c.nu = 1,
a.eps = 0.1,
b.eps = 0.1,
a.mu = 0.01,
b.mu = 0.01,
iterations = 1000,
burn.in = floor(iterations * 0.2),
thinning = 5,
printtime = TRUE
)
Arguments
times 
Numeric positive vector. Failure times. 
delta 
Logical vector. Status indicator. 
type.t 
Integer. 1=computes uniformlydense intervals; 2= partition arbitrarily defined by the user with parameter utao and 3=same length intervals. 
K 
Integer. Partition length for the hazard function if

utao 
vector. Partition specified by the user when type.t = 2. The first value of the vector has to be 0 and the last one the maximum observed time, either censored or uncensored. 
alpha 
Nonnegative entry vector. Small entries are recommended in order to specify a noninformative prior distribution. 
beta 
Nonnegative entry vector. Small entries are recommended in order to specify a noninformative prior distribution. 
c.r 
Nonnegative vector. The higher the entries, the higher the correlation of two consecutive intervals. 
type.c 
1=defines 
epsilon 
Double. Mean of the exponential distribution assigned to

c.nu 
Tuning parameter for the proposal distribution for c. 
a.eps 
Numeric. Shape parameter for the prior gamma distribution of
epsilon when 
b.eps 
Numeric. Scale parameter for the prior gamma distribution of
epsilon when 
a.mu 
Numeric. Shape parameter for the prior gamma distribution of mu 
b.mu 
Numeric. Scale parameter for the prior gamma distribution of mu 
iterations 
Integer. Number of iterations including the 
burn.in 
Integer. Length of the burnin period for the Markov chain. 
thinning 
Integer. Factor by which the chain will be thinned. Thinning the Markov chain is to reduces autocorrelation. 
printtime 
Logical. If 
Details
Computes the Gibbs sampler with the full conditional distributions of all model parameters (NietoBarajas & Yin 2008) and arranges the resulting Markov chain into a tibble which can be used to obtain posterior summaries.
Note
It is recommended to verify chain's stationarity. This can be done by
checking each element individually. See CuPlotDiag
.
Examples
## Simulations may be time intensive. Be patient.
## Example 1
# data(crm3)
# times<crm3$times
# delta<crm3$delta
# res < CuMRes(times, delta, type.t = 2,
# K = 100, length = .1, alpha = rep(1, 100 ),
# beta = rep(1, 100),c.r = rep(50, 99),
# iterations = 100, burn.in = 10, thinning = 1, type.c = 2)