score.mlmm: Extract The Score From Multiple Linear Mixed Models

View source: R/score.R

score.mlmmR Documentation

Extract The Score From Multiple Linear Mixed Models

Description

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

Usage

## S3 method for class 'mlmm'
score(
  x,
  effects = "contrast",
  indiv = FALSE,
  p = NULL,
  newdata = NULL,
  ordering = "by",
  simplify = TRUE,
  ...
)

Arguments

x

a mlmm object.

effects

[character] By default will output the estimates relative to the hypotheses being tested ("contrast"). But can also output all model coefficients ("all"), or only coefficients relative to the mean ("mean" or "fixed"), or only coefficients relative to the variance structure ("variance"), or only coefficients relative to the correlation structure ("correlation").

indiv

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

p

[list of numeric vector] list of model coefficients to be used. Only relevant if differs from the fitted values.

newdata

[NULL] Not used. For compatibility with the generic method.

ordering

[character] should the output be ordered by type of parameter (parameter) or by model (by).

simplify

[logical] should the score be combined across models into a single vector (indiv=FALSE) or matrix (indiv=TRUE)?

...

passed to score.lmm.

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). When effects differs from "contrast" and simplify=FALSE, it will store the score in a list with an element relative to each parameter or model (argument ordering).


bozenne/repeated documentation built on July 16, 2025, 11:16 p.m.