mCureModel: Estimation of a classical mixture cure model (survival model...

Description Usage Arguments Value Author(s) References Examples

View source: R/mCureModel.R

Description

Function using JAGS to estimate the mixture cure model (MCM)[Farewell, 1982].

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
mCureModel(
  formLatency,
  formIncidence,
  formID = NULL,
  data,
  survMod = "weibull-PH",
  inf_prior = TRUE,
  smcure_out = NULL,
  classif_trick = TRUE,
  n.chains = 3,
  n.iter = 10000,
  n.burnin = 5000,
  n.thin = 1,
  n.adapt = NULL,
  C = 1000,
  priorTau = 100,
  save_jagsUI = TRUE,
  out_data = T,
  parallel = FALSE,
  verbose = TRUE
)

Arguments

formLatency

survival formula as formula in survival package for latency submodel

formIncidence

formula specifying covariate in incidence submodel

formID

formula specifying the ID variable (e.g. = ~ subject), if NULL each row is a statistic unit

data

dataset of observed variables

survMod

form of survival submodel (only "weibull-PH" is available until now)

inf_prior

if TRUE, the estimation is built considering informative prior from survival (coxph function) or smcure package. If FALSE, vague priors are used.

smcure_out

object from smcure package estimating model and used for data-driven priors, otherwise is NULL by default

classif_trick

if TRUE, subjects are cured if t_obs>max(t_obs(delta==1), otherwise D is only know for subjects having developed the event Taylor's rule about the cure status, D==0 if T_obs>max(t_obs[which(delta==1)])

n.chains

the number of parallel chains for the model; default is 3

n.iter

integer specifying the total number of iterations; default is 10000

n.burnin

integer specifying how many of n.iter to discard as burn-in ; default is 5000

n.thin

integer specifying the thinning of the chains; default is 1

n.adapt

integer specifying the number of iterations to use for adaptation; default is NULL

C

positive integer for the zero trick used to define the likelihood in JAGS, default is 1000

priorTau

variance by default for vague prior distribution

save_jagsUI

If TRUE (by default), the output of jagsUI package is return by the function

out_data

Boolean such as TRUE if you want the data of different submodels in output or FALSE otherwise

parallel

if TRUE, the program is parallelized

verbose

If set to FALSE, all text output in the console will be suppressed as the function runs (including most warnings).

Value

A JMcuR object which is a list with the following elements:

mean

list of posterior mean for each parameter

median

list of posterior median for each parameter

modes

list of posterior mode for each parameter

StErr

list of standard error for each parameter

StDev

list of standard deviation for each parameter

Rhat

Gelman and Rubin diagnostic for all parameters

ICs

list of the credibility interval at 0.95 for each parameters excepted for covariance parameters in covariance matrix of random effects. Otherwise, use save_jagsUI=TRUE to have the associated quantiles.

data

data included in argument

sims.list

list of the MCMC chains of the parameters and random effects

control

list of arguments giving details about the estimation

out_jagsUI

only if save_jagsUI=TRUE in argument: list including posterior mean, median, quantiles (2.5 Moreover, this list also returns the MCMC draws, the Gelman and Rubin diagnostics (see output of jagsUI objects)

Author(s)

Antoine Barbieri and Catherine Legrand

References

Barbieri A and Legrand C. (2019). Joint longitudinal and time-to-event cure models for the assessment of being cured. Statistical Methods in Medical Research. doi: 10.1177/0962280219853599.

Taylor JMG. (1995) Semi-Parametric Estimation in Failure Time Mixture Models. Biometrics 1995; 51(3): 899-907.

Farewell VT. The use of mixture models for the analysis of survival data with long-term survivors. Biometrics 1982; 38(4):1041–1046.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# For the exemple(s), use the data 'aids' from joineR package
data("aids", package = "joineR")

## Estimation of the mixture cure model (MCM)
MCM1 <- mCureModel(formLatency = Surv(time, death) ~ drug + gender + prevOI + AZT,
                   formIncidence = ~ drug + gender + prevOI + AZT,
                   formID = ~ id,
                   data = aids,
                   # model specifications
                   survMod = "weibull-PH",
                   # prior options
                   n.iter = 1000,
                   n.burnin = 500,
                   smcure_out = NULL,
                   priorTau = 100,
                   # classification options
                   classif_trick = TRUE)

# details of the estimated model
summary(MCM1)

## Not run: 

# estimation of the MCM with parameter initialisation
aids.id <- unique(aids[,c("id","time","death","drug","gender","prevOI","AZT")])
aids.id2 <- aids.id
aids.id2$drug <- as.numeric(aids.id$drug)-1
aids.id2$gender <- as.numeric(aids.id$gender)-1
aids.id2$prevOI <- as.numeric(aids.id$prevOI)-1
aids.id2$AZT <- as.numeric(aids.id$AZT)-1
smcure_out <- smcure(Surv(time, death) ~ drug + gender + prevOI + AZT,
                     cureform=~ drug + gender + prevOI + AZT,
                     data = aids.id2,
                     model="ph")

MCM2 <- mCureModel(formLatency = Surv(time, death) ~ drug + gender + prevOI + AZT,
                   formIncidence = ~ drug + gender + prevOI + AZT,
                   data = aids.id,
                   # model specifications
                   survMod = "weibull-PH",
                   # prior options
                   smcure_out = smcure_out,
                   priorTau = 100,
                   # classification options
                   classif_trick = TRUE)

# details of the estimated model
summary(MCM2)

## End(Not run)

AntoineBbi/JMcuR documentation built on Oct. 1, 2020, 1:31 a.m.