Description Usage Arguments Details Value Note Author(s) References See Also Examples

This function computes the conditional probability of surviving later times than the last observed time for which a longitudinal measurement was available.

1 2 3 4 5 |

`object` |
an object inheriting from class |

`newdata` |
a data frame that contains the longitudinal and covariate information for the subjects for which prediction
of survival probabilities is required. The names of the variables in this data frame must be the same as in the data frames that
were used to fit the linear mixed effects model (using |

`idVar` |
the name of the variable in |

`simulate` |
logical; if |

`survTimes` |
a numeric vector of times for which prediction survival probabilities are to be computed. |

`last.time` |
a numeric vector or character string. This specifies the known time at which each of the subjects in |

`M` |
integer denoting how many Monte Carlo samples to use – see |

`CI.levels` |
a numeric vector of length two that specifies which quantiles to use for the calculation of confidence interval for the
predicted probabilities – see |

`scale` |
a numeric scalar that controls the acceptance rate of the Metropolis-Hastings algorithm – see |

`...` |
additional arguments; currently none is used. |

Based on a fitted joint model (represented by `object`

), and a history of longitudinal responses
*tilde{y_i}(t) = {y_i(s), 0 ≤q s ≤q t}* and a covariates vector *x_i* (stored in
`newdata`

), this function provides estimates of *Pr(T_i > u | T_i > t,
tilde{y}_i(t), x_i)*, i.e., the conditional probability of surviving time *u* given that subject *i*, with covariate information
*x_i*, has survived up to time *t* and has provided longitudinal the measurements *tilde{y}_i(t)*.

To estimate *Pr(T_i > u | T_i > t, tilde{y}_i(t), x_i)* and if `simulate = TRUE`

, a
Monte Carlo procedure is followed with the following steps:

- Step 1:
Simulate new parameter values, say

*θ^**, from*N(\hat{θ}, C(\hat{θ}))*, where*\hat{θ}*are the MLEs and*C(\hat{θ})*their large sample covariance matrix, which are extracted from`object`

.- Step 2:
Simulate random effects values, say

*b_i^**, from their posterior distribution given survival up to time*t*, the vector of longitudinal responses*\tilde{y}_i(t)*and*θ^**. This is achieved using a Metropolis-Hastings algorithm with independent proposals from a properly centered and scaled multivariate*t*distribution. The`scale`

argument controls the acceptance rate for this algorithm.- Step 3
Using

*θ^**and*b_i^**, compute*Pr(T_i > u | T_i > t, b_i^*, x_i; θ^*)*.- Step 4:
Repeat Steps 1-3

`M`

times.

Based on the `M`

estimates of the conditional probabilities, we compute useful summary statistics, such as their mean, median, and
quantiles (to produce a confidence interval).

If `simulate = FALSE`

, then survival probabilities are estimated using the formula

*Pr(T_i > u | T_i > t, hat{b}_i, x_i; hat{θ}),*

where *\hat{θ}* denotes the MLEs as above, and *\hat{b}_i*
denotes the empirical Bayes estimates.

A list of class `survfitJM`

with components:

`summaries` |
a list with elements numeric matrices with numeric summaries of the predicted probabilities for each subject. |

`survTimes` |
a copy of the |

`last.time` |
a numeric vector with the time of the last available longitudinal measurement of each subject. |

`obs.times` |
a list with elements numeric vectors denoting the timings of the longitudinal measurements for each subject. |

`y` |
a list with elements numeric vectors denoting the longitudinal responses for each subject. |

`full.results` |
a list with elements numeric matrices with predicted probabilities for each subject in each replication of the Monte Carlo scheme described above. |

`success.rate` |
a numeric vector with the success rates of the Metropolis-Hastings algorithm described above for each subject. |

`scale` |
a copy of the |

Predicted probabilities are not computed for joint models with `method = "ch-Laplace"`

and `method = "Cox-PH-GH"`

.

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

Rizopoulos, D. (2012) *Joint Models for Longitudinal and Time-to-Event Data: with
Applications in R*. Boca Raton: Chapman and Hall/CRC.

Rizopoulos, D. (2011). Dynamic predictions and prospective accuracy in joint models for longitudinal and time-to-event data.
*Biometrics* **67**, 819–829.

Rizopoulos, D. (2010) JM: An R Package for the Joint Modelling of Longitudinal and Time-to-Event Data.
*Journal of Statistical Software* **35** (9), 1–33. http://www.jstatsoft.org/v35/i09/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# linear mixed model fit
fitLME <- lme(sqrt(CD4) ~ obstime + obstime:drug,
random = ~ 1 | patient, data = aids)
# cox model fit
fitCOX <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE)
# joint model fit
fitJOINT <- jointModel(fitLME, fitCOX,
timeVar = "obstime", method = "weibull-PH-aGH")
# sample of the patients who are still alive
ND <- aids[aids$patient == "141", ]
ss <- survfitJM(fitJOINT, newdata = ND, idVar = "patient", M = 50)
ss
``` |

```
Loading required package: MASS
Loading required package: nlme
Loading required package: splines
Loading required package: survival
Prediction of Conditional Probabilities of Event
based on 50 Monte Carlo samples
$`141`
times Mean Median Lower Upper
1 6.0000 1.0000 1.0000 1.0000 1.0000
1 6.0368 0.9960 0.9961 0.9943 0.9975
2 6.6553 0.9301 0.9316 0.8999 0.9548
3 7.2738 0.8655 0.8686 0.8102 0.9111
4 7.8924 0.8028 0.8065 0.7256 0.8667
5 8.5109 0.7422 0.7459 0.6464 0.8219
6 9.1294 0.6840 0.6872 0.5727 0.7770
7 9.7479 0.6282 0.6309 0.5047 0.7322
8 10.3665 0.5752 0.5771 0.4423 0.6877
9 10.9850 0.5250 0.5258 0.3855 0.6438
10 11.6035 0.4777 0.4776 0.3340 0.6008
11 12.2221 0.4332 0.4328 0.2877 0.5593
12 12.8406 0.3917 0.3910 0.2464 0.5201
13 13.4591 0.3530 0.3521 0.2097 0.4822
14 14.0776 0.3172 0.3159 0.1774 0.4460
15 14.6962 0.2841 0.2825 0.1492 0.4122
16 15.3147 0.2537 0.2518 0.1246 0.3800
17 15.9332 0.2259 0.2236 0.1034 0.3494
18 16.5518 0.2005 0.1979 0.0852 0.3204
19 17.1703 0.1774 0.1742 0.0698 0.2931
20 17.7888 0.1565 0.1514 0.0567 0.2674
21 18.4074 0.1377 0.1313 0.0458 0.2432
22 19.0259 0.1208 0.1142 0.0367 0.2213
23 19.6444 0.1056 0.0990 0.0291 0.2009
24 20.2629 0.0921 0.0854 0.0230 0.1819
25 20.8815 0.0801 0.0734 0.0180 0.1643
26 21.5000 0.0695 0.0627 0.0140 0.1480
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.