profile.lmm: Log-Likelihood Contour For a Linear Mixed Model

View source: R/profile.R

profile.lmmR Documentation

Log-Likelihood Contour For a Linear Mixed Model

Description

Evaluate the (restricted) log-likelihood around Maximum Likelihood Estimate (MLE) of a linear mixed model. It will vary one parameter and either keep the other parameters constant or set the other parameters at their MLE (profile likelihood). Since a locally quadratic log-likelihood with an Hessian equivariant in law implies normally distributed estimates (Geyer 2013) it can help trusting confidence intervals and p-values in small samples with a non-normally distributed outcome.

Usage

## S3 method for class 'lmm'
profile(
  fitted,
  effects = NULL,
  profile.likelihood = FALSE,
  maxpts = NULL,
  level = 0.95,
  trace = FALSE,
  transform.sigma = NULL,
  transform.k = NULL,
  transform.rho = NULL,
  transform.names = TRUE,
  ...
)

Arguments

fitted

a lmm object.

effects

[character vector] name of the parameters who will be constrained. Alternatively can be the type of parameters, e.g. "mean", "variance", "correlation", or "all".

profile.likelihood

[logical] should the other parameters be set to the value maximizing the constrained likelihood or stay at their MLE value?

maxpts

[integer, >0] number of points use to discretize the likelihood, maxpts points smaller than the MLE and maxpts points higher than the MLE.

level

[numeric, 0-1] the confidence level of the confidence intervals used to decide about the range of values for each parameter.

trace

[logical] Show the progress of the execution of the function.

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

Each parameter defined by the argument effets is treated separately:

  • the confidence interval of a parameter is discretized with maxpt points,

  • this parameter is set to each discretization value.

  • the other parameters are either set to the (unconstrained) MLE (profile.likelihood=FALSE) or to constrained MLE (profile.likelihood=TRUE). The latter case is much more computer intensive as it implies re-running the estimation procedure.

  • the (restricted) log-likelihood is evaluated.

Value

A data.frame object containing the log-likelihood for various parameter values.

References

Geyer, C. J. (2013). Asymptotics of maximum likelihood without the lln or clt or sample size going to infinity. In Advances in Modern Statistical Theory and Applications: A Festschrift in honor of Morris L. Eaton, pages 1–24. Institute of Mathematical Statistics.

Examples

data(gastricbypassW, package = "LMMstar")
e.lmm <- lmm(weight2 ~ weight1 + glucagonAUC1,
             data = gastricbypassW, control = list(optimizer = "FS"))

## profile logLiklihood
## Not run: 
e.pro <- profile(e.lmm, effects = "all", maxpts = 10, profile.likelihood = TRUE)
head(e.pro)
plot(e.pro)

## End(Not run)

## along a single parameter axis
e.sliceNone <- profile(e.lmm, effects = "all", maxpts = 10, transform.sigma = "none")
plot(e.sliceNone)
e.sliceLog <- profile(e.lmm, effects = "all", maxpts = 10, transform.sigma = "log")
plot(e.sliceLog)


bozenne/handrem documentation built on Oct. 21, 2024, 8:40 a.m.