Function to calculate joint likelihood used in the jointmeta1 function
jlike(
data,
longdat,
survdat,
q,
likeests,
lgpt,
studies,
p1,
p2,
long.rand.ind,
randstart.ind,
randstart.ind.cov,
r = NULL,
long.rand.stud = NULL,
randstart.stud = NULL,
randstart.stud.cov = NULL,
strat,
study.name,
id.name
)an object of class jointdata containing the variables named in the model formulae
the longitudinal data with factors and interaction terms expanded, ordered by increasing survival time
the survival data with factors and interaction terms expanded, ordered by increasing survival time
the number of individual level random effects
a list of values required to calculated the log-likelihood for the fitted joint model. This list has the following elements:
beta1a data frame containing the estimates of the coefficients of the fixed effect parameters of the longitudinal sub-model.
beta2a data frame containing the estimates of the coefficients of the fixed effect parameters of the survival sub-model.
sigma.ethe estimate of the variance for the measurement errors in the joint model.
Dthe estimated covariance matrix for the individual level random effects
Athe estimated covariance matrix for the study level random
effects. This is only present in the output if study level random effects
were specified in the function call to jointmeta1.
random2a list of matrices containing the conditional modes of the individual level random effects given the supplied data and the estimated parameters of the joint model. The list is of length equal to the number of studies in the dataset, and each element of the list has number of rows equal to the number of individuals in the study, and number of columns equal to the number of specified individual level random effects.
random3a matrix containing the conditional modes of the study level random effects given the supplied data and the estimated parameters of the joint model. The matrix has number of rows equal to the number of studies, and number of columns equal to the number of specified study level random effects.
long.rand.ind.forma character string giving the formulation of the individual level random effects.
long.rand.stud.forma character string giving the formulation of the study level random effects if included in the model.
conva logical value indicating whether convergence of the EM algorithm was achieved or not.
itersthe number of iterations completed by the EM algorithm
n.bystudythe number of individuals present in each study in the data supplied to the function.
hazthe estimated baseline hazard. If strat = TRUE in
the function call to jointmeta1 then this is a list of length equal
to the number of studies in the supplied dataset, each element of the list
being the baseline hazard for the corresponding study. Otherwise there is a
common baseline across all studies in the dataset and this is one vector.
rsa counter to indicate the last how many unique event times had occured by the individual's survival time - this is for use during further calculation in the joint model EM algorithm. If a stratified baseline this is a list of numerical vectors, whereas if the baseline is not stratified this is a single numeric vector.
sfthe unique event times observed in the dataset. If a stratified baseline this is a list of numerical vectors, whereas if the baseline is not stratified this is a single numeric vector.
the number of quadrature points which the log-likelihood is
evaluated over following a model fit. This defaults to lgpt = 7.
the names of the studies present in the supplied data
the number of fixed effects included in the longitudinal sub-model
the number of fixed effects included in the survival sub-model
a vector of character strings to indicate what variables
to assign individual level random effects to. A maximum of three
individual level random effects can be assigned. To assign a random
intercept include 'int' in the vector. To not include an individual level
random intercept include 'noint' in the vector. For example to fit a model
with individual level random intercept and random slope set
long.rand.ind = c('int', 'time'), where 'time' is the
longitudinal time variable in the data.
a list of the conditional modes of the individual level random effects in each study given the data and the estimates of the separate longitudinal model parameters
a list of the conditional covariance matrices for each individual for the individual level random effects given the data and the estimates of the separate longitudinal model parameters
the number of study level random effects (if included in the model)
a vector of character strings to indicate what
variables to assign study level random effects to. If no study level
random effects then this either not specified in function call or set to
NULL. If a study level random intercept is required, include the
name of the study membership variable for example long.rand.stud =
'study'.
a data frame containing the conditional modes of the
study level random effects given the data and the estimates of the separate
longitudinal model parameters. This is only present if study level random
effects were specified in the jointmeta1 function call.
a list of conditional covariance matrices for each
study for the study level random effects given the data and the estimates
of the separate longitudinal model parameters. This is only present if
study level random effects were specified in the jointmeta1 function
call.
logical value: if TRUE then the survival sub-model is
calculated with a baseline stratified by study. Otherwise baseline is
unstratified
a character string denoting the name of the variable in the
baseline dataset in data holding study membership, for example
study.name = 'study'.
character string specifying the id variable in the dataset
A list containing three elements:
log.likethe overall log-likelihood for the fitted joint model.
longlog.likethe portion of the log-likelihood attributable to the longitudinal sub-model.
survlog.likethe portion of the log-likelihood attributable to the survival sub-model.