  The objective of this paper is to provide an introduction to the principles
of Bayesian joint modeling of longitudinal measurements and time-to-event
outcomes, as well as model implementation using the BUGS language syntax. This
syntax can be executed directly using OpenBUGS or by utilizing convenient
functions to invoke OpenBUGS and JAGS from R software. In this paper, all
details of joint models are provided, ranging from simple to more advanced
models. The presentation started with the joint modeling of a Gaussian
longitudinal marker and time-to-event outcome. The implementation of the
Bayesian paradigm of the model is reviewed. The strategies for simulating data
from the JM are also discussed. A proportional hazard model with various forms
of baseline hazards, along with the discussion of all possible association
structures between the two sub-models are taken into consideration. The paper
covers joint models with multivariate longitudinal measurements, zero-inflated
longitudinal measurements, competing risks, and time-to-event with cure
fraction. The models are illustrated by the analyses of several real data sets.
All simulated and real data and code are available at
\url{https://github.com/tbaghfalaki/JM-with-BUGS-and-JAGS}.
