predict.JMcuR: Predictions of the cure membership, the longitudinal or...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.JMcuR.R

Description

Predictions of the cure membership, the longitudinal or survival responses from the estimated joint longitudinal survival models with cure fraction

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'JMcuR'
predict(
  object,
  newdata = NULL,
  type = "subject",
  state = "cure",
  level.interval = 0.95,
  Tsurv = NULL,
  Yt = NULL,
  yVar = "y",
  idVar = "subject",
  MCMC = FALSE,
  M = NULL,
  ...
)

Arguments

object

an object inheriting from class JMcuR

newdata

a data frame in which to look for variables with which to predict (default is NULL, and the prediction is done on the data used to estimate the cure model)

type

a character string indicating the type of predictions to compute, marginal or subject-specific.

state

a (vector of) character string indicating the response ("cure","survival","longitudinal") to predict

level.interval

a numeric scalar denoting the tolerance/confidence level for the credibility interval; the credible interval is return only for MCMC=TRUE

Tsurv

A numeric scalar denoting the time of interest associated with the prediction; 'Tsur' is NULL by default and then the censoring time is considered to predict the cure status.

Yt

a numeric scalar denoting the value of the longitudinal measurement if type='profile'. yt is NULL by default

yVar

a character string indicating the name of the variable in newdata that corresponds to the longitudinal outcome;

idVar

a character string indicating the name of the variable in newdata that corresponds to the subject identifier; required when type = "Subject"

MCMC

logical; if TRUE prediction procedure is done using Bayesian approach, and if FALSE (by default) the Frequentist approach is then considered for the prediction procedure

M

a numerical scalar denoting the sampling size using Bayesian approach; is NULL by default and the lengh of MC chains in estimation step is then considered.

...

further arguments to be passed to or from other methods. They are ignored in this function.

Value

An object curePredict being a list with the following elements:

out_pred

Dataframe with the (subject-specific) prediction results.

sims.list

list of the MCMC chains of the parameters

data

the argument 'newdata' used

type

the argument 'type' used

state

the argument 'state' used

Author(s)

Antoine Barbieri and Catherine Legrand

See Also

jointCureModel

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## For the exemple(s), use the data 'aids' from joineR package
data("aids", package = "joineR")

## estimation of the MCM for 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")

## Estimation of the joint latent class cure model (JLCCM)
JLCCM <- jointCureModel(formFixed = CD4 ~ obstime + drug + gender + prevOI + AZT,
                        formRandom = ~ obstime,
                        timeVar= "obstime",
                        formLatency = Surv(time, death) ~ drug + gender + prevOI + AZT,
                        formIncidence = ~ drug + gender + prevOI + AZT,
                        formID= ~ id,
                        IdVar = "id",
                        data = aids,
                        # model specifications
                        jointCureModel = "JLCCmodel",
                        survMod = "weibull-PH",
                        param = "shared-RE",
                        # prior options
                        n.iter = 1000,
                        n.burnin = 500,
                        Infprior_cure = TRUE,
                        smcure_out = smcure_out,
                        priorTau = 100,
                        # classification options
                        classif_trick = TRUE,
                        cov_prior = "inverse-gamma",
                        Sigma_d = TRUE)

## details of the estimated model
summary(JLCCM)

## prediction step with the JLCCM
# Frequentist approach
pred_JLCCM <- predict(object = JLCCM,
                      newdata = NULL,
                      type = "subject",
                      state = c("cure"),
                      level.intervalle=0.95,
                      Tsurv = NULL,
                      Yt = NULL,
                      yVar = "CD4",
                      idVar = "id",
                      MCMC = FALSE,
                      M = NULL)

## Not run: 
# Bayesian approach
pred_JLCCM_MCMC <- predict(object = JLCCM,
                           newdata = NULL,
                           type = "subject",
                           state = c("cure"),
                           level.intervalle=0.95,
                           Tsurv=NULL,
                           Yt = NULL,
                           yVar = "CD4",
                           idVar = "id",
                           MCMC = TRUE,
                           M = 500)

## End(Not run)

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