class: title-slide-custom count: false <!-- <h1>JMbayes2</h1> --> <div style="font-size: 50pt; font-weight: 900; color: var(--nord4); margin-top: 60px;"> JMbayes2 </div> <div style="font-size: 26pt; color: var(--nord9); font-weight: 300; margin-top:40px;"> Extended Joint Models under the Bayesian Approach </div> <div id = "author"> <div style = "font-size: 30pt; font-weight: bolder; color: var(--nord4);">Dimitris Rizopoulos, P. Afonso, G. Papageorgiou</div> <div style = "color: var(--nord9);">Department of Biostatistics</div> </div> <div id="contact"> <a href="mailto:d.rizopoulos@erasmusmc.nl"><i class="fas fa-envelope"></i> d.rizopoulos@erasmusmc.nl</a>   <a href="https://twitter.com/drizopoulos"><i class="fab fa-twitter"></i> drizopoulos</a>   <a href="https://github.com/drizopoulos"><i class="fab fa-github"></i> drizopoulos</a>   </div> --- layout: true <link href="https://unpkg.com/nord-highlightjs@0.1.0/dist/nord.css" rel="stylesheet" type="text/css" /> <link href="fontawesome-free-5.14.0-web/css/all.css" rel="stylesheet"> <div class="my-footer"><span> <a href="https://twitter.com/drizopoulos"><i class="fab fa-twitter"></i> drizopoulos</a>      <a href="https://github.com/drizopoulos"><i class="fab fa-github"></i> drizopoulos</a>      <a href = "http://www.drizopoulos.com/"><i class="fas fa-globe-americas"></i> www.drizopoulos.com</a> </span></div> --- class: center, middle, animated, fadeIn # Joint Models:<br>Current Standard --- ## A Bit of History <p> </p> -- <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> <strong>Joint models have been around for many years...</strong> </div> -- <br> - Two parallel trajectories .pull-left[ **Event Process** <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> endogenous time-varying covariates </div> ] .pull-right[ **Longitudinal Outcomes** <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> non-random (MNAR) dropout </div> ] --- ## JMs and Extensions <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> <strong>Basic assumption: <font color = "red">Conditional Independence</font></strong> <br> The random effects \(\color{var(--nord15)}{b}\) explain all interrelationships. </div> .footnote[ [<i class = "fas fa-book"></i> Rizopoulos (2012)](https://www.crcpress.com/product/isbn/9781439872864) ] -- <br> * `\(\mathcal{Y}\)`: Longitudinal process * `\(\mathcal{T}\)`: Event process -- `\begin{align*} p\{\mathcal{Y},\, \mathcal{T} \mid \color{var(--nord15)}{b}\} = p\{\mathcal{Y} \mid \color{var(--nord15)}{b}\} \; p\{\mathcal{T} \mid \color{var(--nord15)}{b}\} \end{align*}` --- ## JMs and Extensions <img src="JM.gif" alt="DynPreds" style="margin:0px 0px 0px 0px; width:450px;"> --- ## JMs and Extensions <br> .pull-left[ **Longitudinal Process** - multiple outcomes - continuous, discrete, left-censored - flexible models (splines, etc.) ] .pull-right[ **Event Process** - competing risks - multi-state processes - recurrent events - multivariate ] --- ## JMs and Extensions **Conditional Independence:** .reference[[<i class = "fas fa-book"></i> Rizopoulos (2012)](https://www.crcpress.com/product/isbn/9781439872864)] <ul class="fa-ul"> <li><span class="fa-li" style = "color:var(--nord14);"> <i class="far fa-smile"></i></span> mathematically convenient</li> <li><span class="fa-li" style = "color:var(--nord11);"> <i class="far fa-frown"></i></span> computionally intensive</li> </ul> -- .pull-left[ **Maximum Likelihood:** <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> requires high-dimensional numerical integration </div> ] .pull-right[ **Bayesian:** <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> requires sampling high-dimensional random effects </div> ] --- ## Theory vs Practice As with many other statistical techniques,<br> it took some years for JMs software to appear -- <br> <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> <strong>Nowadays, given the rise of the <font color = "red">R ecosystem</font> a number of packages is available</strong> </div> --- ## Available Software .pull-left[ **Maximum Likelihood:** <button class="modal-button" href="#JM"><strong>JM</strong></button> <div id="JM" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> One continuous longitudinal outcome</li> <li> Competing risks</li> <li> (pseudo) adaptive Gaussian quadrature</li> </ul> </div> </div> <button class="modal-button" href="#joineRML"><strong>joineRML</strong></button> <div id="joineRML" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> Multiple continuous longitudinal outcomes</li> <li> Monte Carlo EM (<font color="red">needs tuning</font>)</li> </ul> </div> </div> <button class="modal-button" href="#frailtyPack"><strong>frailtyPack</strong></button> <div id="frailtyPack" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> One continuous longitudinal outcome</li> <li> recurrent events & terminating event</li> </ul> </div> </div> ] .pull-right[ **Bayesian:** <button class="modal-button" href="#JMbayes"><strong>JMbayes</strong></button> <div id="JMbayes" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> Multiple longitudinal outcomes of different type</li> <li> competing risks & multi-state models</li> <li> Corrected two-stage approach (<font color="red">not fully Bayesian</font>)</li> </ul> </div> </div> <button class="modal-button" href="#INLAjoint"><strong>INLAjoint</strong></button> <div id="INLAjoint" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> Multiple longitudinal outcomes of different type</li> <li> competing risks & multi-state models</li> <li> <font color="red">no control approximation error</font></li> <li> <font color="red">limited model assessment diagnostics</font></li> </ul> </div> </div> <button class="modal-button" href="#stan_jm"><strong>stan_jm</strong></button> <div id="stan_jm" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> Multiple longitudinal outcomes of different type</li> <li> fully Bayesian in STAN (<font color="red">slow</font>)</li> </ul> </div> </div> <button class="modal-button" href="#bamlss"><strong>jm_bamlss</strong></button> <div id="bamlss" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li> single longitudinal outcomes</li> <li> no competing risks nor multi-state models</li> </ul> </div> </div> ] --- ## Available Software <br><br> <div style = "width: 75%; padding: 1.15em 2em; background-color: var(--nord0); margin: auto; display: block;"> <strong>Still no software package exists to satisfy all needs</strong> </div> --- class: center, middle, animated, fadeIn # JMbayes2 --- ## A New Package .nord0box[ **<span style="font-size: 1.5rem;">⇨</span> Learning from the lessons of the past we decided to create a new package** ] -- <br> Our aims .pull-left[ * versatile * user-friendly * fast * complete ] .pull-right[ <div style = "color: var(--nord3);"> <ul> <li>cover (almost) all extensions</li> <li>straightforward syntax</li> <li><strong>C++</strong> & computational tricks</li> <li>support functions</li> </ul> </div> ] --- ## Under the Hood .nord0box[ **Work horse: Metropolis-Hastings algorithm** <br> <span style="font-size: 1.5rem;">⇨</span> adaptive optimal scaling using the Robbins–Monro process ] -- <br> .nord0box[ **Computational aspects** <br> <span style="font-size: 1.5rem;">⇨</span> parallel sampling of random effects<br> <span style="font-size: 1.5rem;">⇨</span> info from separate fits<br> ] --- ## Under the Hood <br> .nord0box[ **Implementation** <br> <span style="font-size: 1.5rem;">⇨</span> MCMC written in C++<br> <span style="font-size: 1.5rem;">⇨</span> avoiding double computations<br> ] --- ## An Example ```r library("JMbayes2") fm1 <- lme(log(serBilir) ~ year * sex, data = pbc2, random = ~ year | id) CoxFit <- coxph(Surv(years, status2) ~ sex, data = pbc2.id) jointFit1 <- jm(CoxFit, fm1, time_var = "year") ``` -- <br> **Check convergence** ```r ggtraceplot(jointFit1, "alphas") ``` --- ## Traceplot <img src="index_files/figure-html/unnamed-chunk-4-1.png" width="100%" /> --- ## Model Summary .scroll450[ ```r summary(jointFit1) ``` ``` ## ## Call: ## jm(Surv_object = CoxFit, Mixed_objects = fm1, time_var = "year") ## ## Data Descriptives: ## Number of Groups: 312 Number of events: 140 (44.9%) ## Number of Observations: ## log(serBilir): 1945 ## ## DIC WAIC LPML ## marginal 4255.243 5193.189 -2927.695 ## conditional 3438.104 3256.032 -1840.069 ## ## Random-effects covariance matrix: ## ## StdDev Corr ## (Intr) 1.0053 (Intr) ## year 0.1810 0.3976 ## ## Survival Outcome: ## Mean StDev 2.5% 97.5% P Rhat ## sexfemale -0.2626 0.2867 -0.7847 0.3157 0.3689 1.0020 ## value(log(serBilir)) 1.2475 0.0947 1.0613 1.4390 0.0000 1.0057 ## ## Longitudinal Outcome: log(serBilir) (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 0.7223 0.1720 0.3826 1.0622 0.0000 1.0000 ## year 0.2638 0.0376 0.1912 0.3395 0.0000 1.0055 ## sexfemale -0.2586 0.1824 -0.6156 0.0971 0.1620 1.0000 ## year:sexfemale -0.0899 0.0402 -0.1705 -0.0120 0.0229 1.0047 ## sigma 0.3469 0.0068 0.3337 0.3607 0.0000 1.0207 ## ## MCMC summary: ## chains: 3 ## iterations per chain: 3500 ## burn-in per chain: 500 ## thinning: 1 ## time: 18 sec ``` ] --- ## Multivariate <br> ```r fm2 <- lme(prothrombin ~ year * sex, data = pbc2, random = ~ year | id) fm3 <- mixed_model(ascites ~ year + sex, data = pbc2, random = ~ year | id, family = binomial()) jointFit2 <- jm(CoxFit, list(fm1, fm2, fm3), time_var = "year", n_iter = 12000L, n_burnin = 2000L, n_thin = 5L) ``` --- ## Multivariate .scroll450[ ```r summary(jointFit2) ``` ``` ## ## Call: ## jm(Surv_object = CoxFit, Mixed_objects = list(fm1, fm2, fm3), ## time_var = "year", n_iter = 12000L, n_burnin = 2000L, n_thin = 5L) ## ## Data Descriptives: ## Number of Groups: 312 Number of events: 140 (44.9%) ## Number of Observations: ## log(serBilir): 1945 ## prothrombin: 1945 ## ascites: 1885 ## ## DIC WAIC LPML ## marginal 11501.71 592782.35 -39636.864 ## conditional 12491.57 12237.35 -6618.324 ## ## Random-effects covariance matrix: ## ## StdDev Corr ## (Intr) 0.9913 (Intr) year (Intr) year (Intr) ## year 0.1899 0.4258 ## (Intr) 0.7774 0.5618 0.4965 ## year 0.3310 0.4145 0.3559 0.0587 ## (Intr) 2.9639 0.5629 0.5285 0.6224 0.2768 ## year 0.4601 0.3954 0.6588 0.2551 0.4505 -0.0095 ## ## Survival Outcome: ## Mean StDev 2.5% 97.5% P Rhat ## sexfemale -0.8052 0.3825 -1.5633 -0.0734 0.0347 1.0019 ## value(log(serBilir)) 0.4671 0.1765 0.1134 0.7965 0.0117 1.0737 ## value(prothrombin) 0.0463 0.1518 -0.2836 0.3178 0.6847 1.0408 ## value(ascites) 0.6305 0.1388 0.3947 0.9281 0.0000 1.0245 ## ## Longitudinal Outcome: log(serBilir) (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 0.7014 0.1681 0.3689 1.0278 0.0003 1.0008 ## year 0.2689 0.0340 0.2017 0.3365 0.0000 1.0000 ## sexfemale -0.2395 0.1784 -0.5871 0.1087 0.1840 1.0006 ## year:sexfemale -0.0794 0.0360 -0.1508 -0.0082 0.0280 1.0031 ## sigma 0.3466 0.0066 0.3340 0.3597 0.0000 1.0011 ## ## Longitudinal Outcome: prothrombin (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 10.9424 0.1693 10.6140 11.2733 0.0000 1.0018 ## year 0.2436 0.0741 0.0980 0.3915 0.0003 1.0002 ## sexfemale -0.4000 0.1810 -0.7613 -0.0475 0.0240 1.0016 ## year:sexfemale 0.0549 0.0781 -0.0992 0.2103 0.4783 1.0013 ## sigma 1.0551 0.0200 1.0164 1.0952 0.0000 1.0085 ## ## Longitudinal Outcome: ascites (family = binomial, link = logit) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) -4.5003 0.7081 -5.9580 -3.1942 0.0000 1.0087 ## year 0.6081 0.0732 0.4700 0.7582 0.0000 1.0402 ## sexfemale -0.5043 0.6911 -1.8435 0.8308 0.4613 1.0045 ## ## MCMC summary: ## chains: 3 ## iterations per chain: 12000 ## burn-in per chain: 2000 ## thinning: 5 ## time: 2.1 min ``` ] --- ## Functional Forms ```r jointFit3 <- update(jointFit2, functional_forms = ~ slope(log(serBilir)) + slope(log(serBilir)):sex + area(prothrombin)) ``` -- .pull-left[ **Slope** `$$h_i(t) = h_0(t) \exp\biggl\{\alpha \bbox[#2E3440, 5pt]{\frac{d\color{var(--nord14)}{\eta_i(t)}}{dt}}\biggr\}$$` ] .pull-right[ **(normalized) Area** `$$h_i(t) = h_0(t) \exp\biggl\{\alpha \bbox[#2E3440, 5pt]{\frac{1}{t} \int_0^t \color{var(--nord14)}{\eta_i(s)}\; ds}\biggr\}$$` ] <div align="center" style="padding-top:30px;">\(\color{var(--nord3)}{\eta_i(t) = \mathbf x_i(t)^\top \boldsymbol \beta + \mathbf z_i(t)^\top \mathbf b_i}\)</div> --- ## Functional Forms .scroll450[ ```r summary(jointFit3) ``` ``` ## ## Call: ## jm(Surv_object = CoxFit, Mixed_objects = list(fm1, fm2, fm3), ## time_var = "year", functional_forms = ~slope(log(serBilir)) + ## slope(log(serBilir)):sex + area(prothrombin), n_iter = 12000L, ... ## ## Data Descriptives: ## Number of Groups: 312 Number of events: 140 (44.9%) ## Number of Observations: ## log(serBilir): 1945 ## prothrombin: 1945 ## ascites: 1885 ## ## DIC WAIC LPML ## marginal 11407.35 12593.53 -6801.446 ## conditional 12464.61 12210.27 -6597.434 ## ## Random-effects covariance matrix: ## ## StdDev Corr ## (Intr) 0.9839 (Intr) year (Intr) year (Intr) ## year 0.1920 0.4627 ## (Intr) 0.7730 0.5623 0.5129 ## year 0.3329 0.4331 0.3694 0.0773 ## (Intr) 2.9335 0.5821 0.5332 0.6110 0.2939 ## year 0.4724 0.4700 0.6992 0.3232 0.4553 0.0607 ## ## Survival Outcome: ## Mean StDev 2.5% 97.5% P Rhat ## sexfemale -0.2101 0.7811 -1.7096 1.3984 0.7723 1.0581 ## slope(log(serBilir)) 4.1106 2.0171 -0.0720 7.8839 0.0543 1.0085 ## slope(log(serBilir)):sexfemale -2.2855 2.2898 -7.1533 2.0401 0.3127 1.0604 ## area(prothrombin) 0.1355 0.2434 -0.3670 0.5848 0.5390 1.1560 ## value(ascites) 0.7797 0.1901 0.4654 1.1858 0.0000 1.2316 ## ## Longitudinal Outcome: log(serBilir) (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 0.6770 0.1658 0.3506 0.9979 0.0003 1.0005 ## year 0.2642 0.0338 0.1977 0.3311 0.0000 1.0004 ## sexfemale -0.2145 0.1763 -0.5628 0.1313 0.2197 1.0005 ## year:sexfemale -0.0688 0.0351 -0.1364 -0.0001 0.0500 1.0010 ## sigma 0.3474 0.0065 0.3350 0.3600 0.0000 1.0001 ## ## Longitudinal Outcome: prothrombin (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 10.9271 0.1716 10.5903 11.2658 0.0000 1.0016 ## year 0.2387 0.0744 0.0969 0.3896 0.0017 1.0025 ## sexfemale -0.3811 0.1812 -0.7357 -0.0270 0.0357 1.0014 ## year:sexfemale 0.0639 0.0781 -0.0880 0.2200 0.4093 1.0027 ## sigma 1.0551 0.0203 1.0157 1.0956 0.0000 1.0102 ## ## Longitudinal Outcome: ascites (family = binomial, link = logit) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) -4.6078 0.7255 -6.1072 -3.2645 0.0000 1.0750 ## year 0.6355 0.0768 0.5003 0.7970 0.0000 1.1650 ## sexfemale -0.3989 0.6978 -1.7520 0.9894 0.5607 1.0013 ## ## MCMC summary: ## chains: 3 ## iterations per chain: 12000 ## burn-in per chain: 2000 ## thinning: 5 ## time: 2.3 min ``` ] --- ## Competing Risks Bring the data in the competing risks long format ```r pbc2.idCR <- crisk_setup(pbc2.id, statusVar = "status", censLevel = "alive", nameStrata = "CR") pbc2.idCR[pbc2.idCR$id %in% c(1, 2, 5), c("id", "years", "status", "status2", "CR")] ``` ``` ## id years status status2 CR ## 1 1 1.095170 dead 1 dead ## 1.1 1 1.095170 dead 0 transplanted ## 2 2 14.152338 alive 0 dead ## 2.1 2 14.152338 alive 0 transplanted ## 5 5 4.120578 transplanted 0 dead ## 5.1 5 4.120578 transplanted 1 transplanted ``` --- ## Competing Risks <br> Fit a competing risks Cox model ```r CoxFit_CR <- coxph(Surv(years, status2) ~ (age + drug) * strata(CR), data = pbc2.idCR) ``` --- ## Competing Risks <br> Fit the competing risks joint model ```r jFit_CR <- jm(CoxFit_CR, fm1, time_var = "year", functional_forms = ~ value(log(serBilir)):CR, n_iter = 25000L, n_burnin = 5000L, n_thin = 5L) ``` --- ## Competing Risks .scroll450[ ```r summary(jFit_CR) ``` ``` ## ## Call: ## jm(Surv_object = CoxFit_CR, Mixed_objects = fm1, time_var = "year", ## functional_forms = ~value(log(serBilir)):CR, n_iter = 25000L, ## n_burnin = 5000L, n_thin = 5L) ## ## Data Descriptives: ## Number of Groups: 312 Number of events: 169 (27.1%) ## Number of Observations: ## log(serBilir): 1945 ## ## DIC WAIC LPML ## marginal 4435.774 5313.425 -3238.973 ## conditional 3624.102 3446.399 -2000.840 ## ## Random-effects covariance matrix: ## ## StdDev Corr ## (Intr) 1.0020 (Intr) ## year 0.1817 0.3973 ## ## Survival Outcome: ## Mean StDev 2.5% 97.5% P ## age -0.0681 0.0252 -0.1160 -0.0191 0.0035 ## drugD-penicil -0.2892 0.3936 -1.0726 0.4564 0.4737 ## age:strata(CR)dead 0.1300 0.0248 0.0808 0.1757 0.0000 ## drugD-penicil:strata(CR)dead 0.2697 0.4208 -0.5363 1.1023 0.5288 ## value(log(serBilir)):CRtransplanted 1.1675 0.2083 0.7802 1.5974 0.0000 ## value(log(serBilir)):CRdead 1.3682 0.1079 1.1643 1.5861 0.0000 ## Rhat ## age 1.0588 ## drugD-penicil 1.0069 ## age:strata(CR)dead 1.0744 ## drugD-penicil:strata(CR)dead 1.0077 ## value(log(serBilir)):CRtransplanted 1.0152 ## value(log(serBilir)):CRdead 1.0031 ## ## Longitudinal Outcome: log(serBilir) (family = gaussian, link = identity) ## Mean StDev 2.5% 97.5% P Rhat ## (Intercept) 0.7182 0.1717 0.3821 1.0565 0.0000 0.9999 ## year 0.2624 0.0372 0.1898 0.3356 0.0000 1.0000 ## sexfemale -0.2591 0.1835 -0.6227 0.0989 0.1607 0.9998 ## year:sexfemale -0.0845 0.0395 -0.1628 -0.0079 0.0305 1.0000 ## sigma 0.3472 0.0067 0.3344 0.3605 0.0000 0.9998 ## ## MCMC summary: ## chains: 3 ## iterations per chain: 25000 ## burn-in per chain: 5000 ## thinning: 5 ## time: 4.9 min ``` ] --- ## More Features .three-cols[ <button class="modal-button" href="#GLMMs"><strong>Mixed Effects Models</strong></button> <div id="GLMMs" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li>Gaussian (<code>lme(...)</code>)</li> <li>Student's-t (<code>mixed_model(..., <span class="hljs-string">family = students.t(df = 4)</span>)</code>)</li> <li>Beta (<code>mixed_model(..., <span class="hljs-string">family = beta.fam()</span>)</code>)</li> <li>Gamma (<code>mixed_model(..., <span class="hljs-string">family = Gamma()</span>)</code>)</li> <li>censored Gaussian (<code>mixed_model(..., <span class="hljs-string">family = censored.normal()</span>)</code>)</li> </ul> <br> <ul> <li>Binomial (<code>mixed_model(..., <span class="hljs-string">family = binomial()</span>)</code>)</li> <li>Poisson (<code>mixed_model(..., <span class="hljs-string">family = poisson()</span>)</code>)</li> <li>Negative Binomial (<code>mixed_model(..., <span class="hljs-string">family = negative.binomial()</span>)</code>)</li> <li>Beta Binomial (<code>mixed_model(..., <span class="hljs-string">family = beta.binomial()</span>)</code>)</li> </ul> <a href="https://drizopoulos.github.io/JMbayes2/articles/Non_Gaussian_Mixed_Models.html"><i class="fas fa-globe-americas"></i> vignette distributions</a> </div> </div> <button class="modal-button" href="#Plots"><strong>Diagnostics</strong></button> <div id="Plots" class="modal"> <div class="modal-content"> <span class="close">×</span> <ul> <li>MCMC chains (<code>traceplot()</code> or <code>ggtraceplot()</code>)</li> <li>Density (<code>traceplot()</code> or <code>ggtraceplot()</code>)</li> <li>Gelman-Rubin (<code>gelman_diag()</code>)</li> <li>cumulative plot (<code>cumuplot()</code>)</li> </ul> </div> </div> ] .three-cols[ <button class="modal-button" href="#Penalties"><strong>Shrinkage Priors</strong></button> <div id="Penalties" class="modal"> <div class="modal-content"> <span class="close">×</span> Using the <strong>priors</strong> argument we can specify penalties: <pre><code class="r hljs remark-code"> <div class="remark-code-line">jm(..., <span class="hljs-number">priors = list("penalty_alphas" = "horseshoe")</span>)</div> <div class="remark-code-line"></div> <div class="remark-code-line">jm(..., <span class="hljs-number">priors = list("penalty_gammas" = "ridge")</span>)</div> </code></pre> </div> </div> <button class="modal-button" href="#Compare"><strong>Model Comparison</strong></button> <div id="Compare" class="modal"> <div class="modal-content"> <span class="close">×</span> Using the <code>compare_jm()</code> function we can compare fitted joint models using DIC, WAIC and LPML <pre><code class="r hljs remark-code"> <div class="remark-code-line"><span class="hljs-number">fit1</span> <- jm(<span class="hljs-number">CoxModel1</span>, <span class="hljs-number">MixedModels1</span>, ...)</div> <div class="remark-code-line"><span class="hljs-string">fit2</span> <- jm(<span class="hljs-string">CoxModel2</span>, <span class="hljs-string">MixedModels2</span>, ...)</div> <div class="remark-code-line"></div> <div class="remark-code-line">compare_jm(<span class="hljs-number">fit1</span>, <span class="hljs-string">fit2</span>)</div> </code></pre> </div> </div> ] .three-cols[ <button class="modal-button" href="#DynPred"><strong>Dynamic Predictions</strong></button> <div id="DynPred" class="modal"> <div class="modal-content"> <span class="close">×</span> Using the <code>predict()</code> method we can calculate (dynamic) predictions <ul> <li>Longitudinal outcomes</li> <li>Event outcomes (including competing risks)</li> <li>Accuracy measures</li> <ul> <li>discrimination: <code>tvROC()</code>, <code>tvAUC()</code></li> <li>calibration: <code>calibration_plot()</code>, <code>calibration_metrics()</code></li> <li>overall: <code>tvBrier()</code>, <code>tvEPCE()</code></li> </ul> </ul> <a href="https://drizopoulos.github.io/JMbayes2/articles/Dynamic_Predictions.html"><i class="fas fa-globe-americas"></i> vignette predictions</a> </div> </div> <button class="modal-button" href="#MCEvents"><strong>Multi-State Processes</strong></button> <div id="MCEvents" class="modal"> <div class="modal-content"> <span class="close">×</span> <strong>Using <code>mc_setup()</code> to setup the data and fitting a stratified Cox model</strong> <ul> <li>Multiple longitudinal outcomes</li> <li>Relative risk model per transition</li> </ul> <a href="https://drizopoulos.github.io/JMbayes2/articles/Multi_State_Processes.html"><i class="fas fa-globe-americas"></i> vignette multi-state</a> </div> </div> <button class="modal-button" href="#RecEvents"><strong>Recurrent Events</strong></button> <div id="RecEvents" class="modal"> <div class="modal-content"> <span class="close">×</span> Using <code>rc_setup()</code> to setup the data, fitting a stratified Cox model and calling <code>jm(..., <span class="hljs-string">recurrent = "..."</span>)</code> <ul> <li>Multiple longitudinal outcomes</li> <li>Relative risk model with a frailty term for recurrent events</li> <li>Relative risk models competing risks terminating events linked with frailty</li> <li>Gap time and Calendar time formulations</li> </ul> <a href="https://drizopoulos.github.io/JMbayes2/articles/Recurring_Events.html"><i class="fas fa-globe-americas"></i> vignette recurrent</a> </div> </div> ] --- class: center, middle .nord0box[ More about **JMbayes2** in the dedicated website<br><br> <a href="https://drizopoulos.github.io/JMbayes2/"><i class="fas fa-globe-americas"></i> https://drizopoulos.github.io/JMbayes2/</a> ] --- class: the-end, center, middle layout: true count: false ## Thank you for your attention! <div id="contact"> <a href="mailto:d.rizopoulos@erasmusmc.nl"><i class="fas fa-envelope"></i> d.rizopoulos@erasmusmc.nl</a>   <a href="https://twitter.com/drizopoulos"><i class="fab fa-twitter"></i> drizopoulos</a>   <a href="https://github.com/drizopoulos"><i class="fab fa-github"></i> drizopoulos</a>   <a href="http://www.drizopoulos.com/"><i class="fas fa-globe-americas"></i> http://www.drizopoulos.com/</a> </div> --- count: false <!-- <script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> --> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <script> // Get the button that opens the modal var btn = document.querySelectorAll("button.modal-button"); // All page modals var modals = document.querySelectorAll('.modal'); // Get the <span> element that closes the modal var spans = document.getElementsByClassName("close"); // When the user clicks the button, open the modal for (var i = 0; i < btn.length; i++) { btn[i].onclick = function(e) { e.preventDefault(); modal = document.querySelector(e.target.getAttribute("href")); modal.style.display = "block"; } } // When the user clicks on <span> (x), close the modal for (var i = 0; i < spans.length; i++) { spans[i].onclick = function() { for (var index in modals) { if (typeof modals[index].style !== 'undefined') modals[index].style.display = "none"; } } } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target.classList.contains('modal')) { for (var index in modals) { if (typeof modals[index].style !== 'undefined') modals[index].style.display = "none"; } } } </script>