ml.loglik.fn {mixmeta} | R Documentation |
Likelihood Functions for mixmeta Models
Description
These functions compute the value of the log-likelihood and the related vectors of first partial derivatives for random-effects meta-analytical models, in terms of model parameters. They are meant to be used internally and not directly run by the users.
Usage
ml.loglik.fn(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
bscov, fix)
ml.loglik.gr(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
bscov, fix)
reml.loglik.fn(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
bscov, fix)
reml.loglik.gr(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
bscov, fix)
Arguments
Assuming a meta-analysis or meta-regression based on n
units aggregated within m
(outer-level) groups, k
outcomes, p
fixed-effects predictors, and q
random-effects predictors:
par |
a vector representing the random-effects parameters defining the random-effects (co)variance matrix (or multiple matrices for multilevel models). |
Xlist |
a |
Zlist |
a |
ylist |
a |
Slist |
a |
nalist |
a |
rep |
matrix with |
k , q , nall |
number of outcomes, number of random-effects predictors (including the intercept), total number of observations (excluding missing), respectively. While usually all are scalars, in the case of multilevel models |
const |
value of the constant to be included in the (restricted) likelihood, therefore not computed in the |
bscov |
a character vector defining the structure of the (co)variance matrix for each level or random effects. See |
fix |
a matrix (or optionally a list of matrices for multilevel models) defining the fixed components of the random-effects part of the model. See |
Details
These functions are called internally by fitting functions, in particular ml.newton
and reml.newton
, to compute the (restricted) log-likelihood and its first partial derivatives in terms of random-effects parameters for meta-analytical models.
These functions actually specify the profiled version of the (restricted) likelihood, expressed only in terms of random-effects parameters, while the estimate of the fixed-effects coefficients is computed at each iteration using a generalized least squares estimator, based on the current value of the between-study (co)variance matrix. At convergence, the value of this profiled version is identical to the full (restricted) likelihood. This approach is computationally efficient, as it reduces the number of parameters in the optimization routine, especially for meta-regression models.
The random-effects parameters in par
depends on the chosen structure(s)
for the random-effects (co)variance matrix (or multiple matrices for multilevel models). The parameterization ensures positive-definiteness. A Cholesky decomposition is then performed on the marginal (co)variance matrix in order to re-express the problem as standard least square equations, an approach which speeds up the computation of matrix inverses and determinants. These equations are finally solved through a QR decomposition, which guarantees stability. More details are provided in the references below.
Some parameters of the fitting procedures are determined through mixmeta.control
. Specifically, the user can obtain the Hessian matrix of the estimated parameters (appropriately transformed, see mixmetaCovStruct
) in the optimization function by setting hessian=TRUE
, and specific settings of the optimization process can be defined by the control list argument optim
. These values are passed to the optimization function optim
.
Value
ml.loglik.fn
and reml.loglik.fn
return the value of the (restricted) log-likelihood for a given set of parameters in par
. ml.loglik.gr
and reml.loglik.gr
return instead the related vector of first partial derivatives.
Note
As stated earlier, these functions are called internally by mixmeta.ml
and mixmeta.reml
, and are not meant to be used directly. In particular, their code does not contain any check on the arguments provided, which are expected in specific formats. They are however exported in the namespace and documented for completeness.
Author(s)
Antonio Gasparrini <antonio.gasparrini@lshtm.ac.uk> and Francesco Sera <francesco.sera@lshtm.ac.uk>
References
Sera F, Armstrong B, Blangiardo M, Gasparrini A (2019). An extended mixed-effects framework for meta-analysis.Statistics in Medicine. 2019;38(29):5429-5444. [Freely available here].
Lindstrom MJ and Bates DM (1988). Newton-Raphson and EM algorithms for linear mixed-effects models for repeated-measures data. Journal of the American Statistical Association. 83(404):1014–1022.
Harville DA (1977) Maximum likelihood approaches to variance component estimation and to related problems. Journal of the American Statistical Association. 72(358):320–338.
Pinheiro JC and Bates DM (2000). Mixed-Effects Models in S and S-PLUS. New York, Springer Verlag.
See Also
See mixmeta.fit
and mixmeta.ml
for additional info on the fitting procedures. See mixmeta.control
to determine specific parameters of the fitting procedures. See mixmetaCovStruct
for (co)variance structures. See chol
and qr
for info on the Cholesky and QR decomposition.
See mixmeta-package
for an overview of the package and modelling framework.