egg_aucs: Derived areas under the curve from a cubic splines...

View source: R/egg_aucs.R

egg_aucsR Documentation

Derived areas under the curve from a cubic splines mixed-effects model by egg_model().

Description

Derived areas under the curve (AUCs) for differentintervals based on a fitted cubic splines mixed-effects model from egg_model(). This function is a specific version of compute_aucs designed to work specifically on egg_model().

Usage

egg_aucs(
  fit,
  period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17),
  knots = c(1, 8, 12)
)

Arguments

fit

A model object from a statistical model such as from a call to egg_model().

period

The intervals knots on which AUCs are to be computed.

knots

The knots as defined fit and according to method.

Value

A data.frame with AUC for each individuals/samples.

Examples

data("bmigrowth")
res <- egg_model(
  formula = log(bmi) ~ age,
  data = bmigrowth[bmigrowth[["sex"]] == 0, ],
  id_var = "ID",
  random_complexity = 1
)
head(
  egg_aucs(
    fit = res,
    period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17),
    knots = c(1, 8, 12)
  )
)

mcanouil/eggla documentation built on April 5, 2025, 3:06 a.m.