# logLik.joint: Log-likelihood for joint model. In gmvjoint: Joint Models of Survival and Multivariate Longitudinal Data

 logLik.joint R Documentation

## Log-likelihood for joint model.

### Description

Calculate joint log-likelihood, degrees of freedom, AIC and BIC of joint model fit.

### Usage

## S3 method for class 'joint'
logLik(object, conditional = FALSE, ...)


### Arguments

 object a joint object. conditional Logical. Should the conditional or observed data log-likelihood be returned? See details. ... additional arguments (none used).

### Details

Calculate the log-likelihood of a joint model of survival and multivariate longitudinal data (i.e. a joint object). The argument conditional manages whether or not the log-likelihood conditional on the random effects, or simply the observed data log-likelihood is returned (the default, conditional = FALSE).

If conditional = TRUE, then the log-likelihood conditional on the random effects is returned. That is

\log f(T_i, \Delta_i, Y_i|b_i;\Omega) = \log f(Y_i|b_i; \Omega) + \log f(T_i, \Delta_i|b_i; \Omega) + \log f(b_i|\Omega)

If conditional = FALSE, then the observed data log-likelihood is returned i.e.

\log\int f(Y_i|b_i; \Omega)f(T_i, \Delta_i|b_i; \Omega)f(b_i|\Omega)db_i.

Additionally, the degrees of freedom, \nu is given by

\nu = \code{length(vech(D))} + \sum_{k=1}^K\{P_k + P_{\sigma_k}\} + P_s,

where P_k denotes the number of coefficients estimated for the kth response, and P_{\sigma_k} the number of dispersion parameters estimated. P_s denotes the number of survival coefficients, i.e. the length of c(zeta, gamma). Finally, all covariance parameters are captured in length(vech(D)).

With the degrees of freedom, we can additionally compute AIC and BIC, which are defined in no special way; and are calculated using the observed data log-likelihood.

### Value

Returns an object of class logLik, a number which is the log-likelihood of the fitted model object. This has multiple attributes: df which is the degrees of freedom, df.residual; the number of residual degrees of freedom; AIC and BIC which are the Akaike or Bayes information criterion evaluated at either the conditional or observed log-likelihood (as requested by argument conditional).

### Author(s)

James Murray (j.murray7@ncl.ac.uk)

### References

Henderson R, Diggle P, Dobson A. Joint modelling of longitudinal measurements and event time data. Biostatistics 2000; 1(4); 465-480.

Wulfsohn MS, Tsiatis AA. A joint model for survival and longitudinal data measured with error. Biometrics 1997; 53(1); 330-339.

extractAIC.joint and anova.joint

### Examples

# Bivariate simulated data (2x Gaussian)
data <- simData(n = 100,
D = diag(c(.25, .04, .2, .02)),
gamma = c(0.4, -0.2), theta = c(-2, .2))\$data
fit <- joint(list(
Y.1 ~ time + cont + bin + (1 + time|id),
Y.2 ~ time + cont + bin + (1 + time|id)
), Surv(survtime, status) ~ cont + bin,
data = data,
family = list('gaussian', 'gaussian'))

logLik(fit)



gmvjoint documentation built on May 29, 2024, 11:29 a.m.