profile.lmm: Evaluate Contour of the Log-Likelihood

View source: R/profile.R

profile.lmmR Documentation

Evaluate Contour of the Log-Likelihood

Description

Display the (restricted) log-likelihood around Maximum Likelihood Estimate (MLE) under specific constrains.

Usage

## S3 method for class 'lmm'
profile(
  fitted,
  effects = NULL,
  profile.likelihood = FALSE,
  maxpts = NULL,
  conf.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 profile likelihood be performed? Otherwise varying one parameter at a time around the MLE while keeping the other constant).

maxpts

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

conf.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 a 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.

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)


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