score.lmm: Extract The Score From a Linear Mixed Model

View source: R/score.R

score.lmmR Documentation

Extract The Score From a Linear Mixed Model

Description

Extract or compute the first derivative of the log-likelihood of a linear mixed model.

Usage

## S3 method for class 'lmm'
score(
  x,
  effects = "mean",
  data = NULL,
  p = NULL,
  indiv = FALSE,
  transform.sigma = NULL,
  transform.k = NULL,
  transform.rho = NULL,
  transform.names = TRUE,
  ...
)

Arguments

x

a lmm object.

effects

[character] Should the score relative to all coefficients be output ("all"), or only coefficients relative to the mean ("mean" or "fixed"), or only coefficients relative to the variance and correlation structure ("variance" or "correlation").

data

[data.frame] dataset relative to which the score should be computed. Only relevant if differs from the dataset used to fit the model.

p

[numeric vector] value of the model coefficients at which to evaluate the score. Only relevant if differs from the fitted values.

indiv

[logical] Should the contribution of each cluster to the score be output? Otherwise output the sum of all clusters of the derivatives.

transform.sigma

[character] Transformation used on the variance coefficient for the reference level. One of "none", "log", "square", "logsquare" - see details.

transform.k

[character] Transformation used on the variance coefficients relative to the other levels. One of "none", "log", "square", "logsquare", "sd", "logsd", "var", "logvar" - see details.

transform.rho

[character] Transformation used on the correlation coefficients. One of "none", "atanh", "cov" - see details.

transform.names

[logical] Should the name of the coefficients be updated to reflect the transformation that has been used?

...

Not used. For compatibility with the generic method.

Details

For details about the arguments transform.sigma, transform.k, transform.rho, see the documentation of the coef.lmm function.

Value

When argument indiv is FALSE, a vector with the value of the score relative to each coefficient. When argument indiv is TRUE, a matrix with the value of the score relative to each coefficient (in columns) and each cluster (in rows).


LMMstar documentation built on Nov. 9, 2023, 1:06 a.m.