Package 'IDEFICS.scalc'

Title: Scoring Tools for Anthropometric and Metabolic Parameters in Children
Description: Provides tools to compute standardized percentiles and z-scores for anthropometric and metabolic parameters in children, based on age-, sex-, and height-specific reference data from the IDEFICS study. Supports computation of a composite Metabolic Syndrome (MetS) score and associated action levels for child health monitoring.
Authors: Andreas Mändle [aut, cre]
Maintainer: Andreas Mändle <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2026-05-16 08:30:45 UTC
Source: https://github.com/bips-hb/IDEFICS_scalc

Help Index


Compute IDEFICS Action Levels

Description

Assigns monitoring or intervention levels based on variable percentiles using standard IDEFICS thresholds.

Usage

action_levels(
  df,
  lvl_name = c("none", "monit", "action"),
  perc_level = c(0.9, 0.95),
  append = FALSE,
  filter = NULL
)

Arguments

df

A data frame containing percentile columns such as 'waist_percentile', 'sbp_percentile', 'hdl_percentile', etc.

lvl_name

Character vector of level labels. Defaults to 'c("none", "monit", "action")'.

perc_level

Numeric vector of two percentiles used as cutoffs. Defaults to 'c(0.9, 0.95)' for 90th and 95th percentile.

append

Logical. If 'TRUE', appends action level columns to 'df'. If 'FALSE', returns only the computed levels.

filter

Character. Optional. Limits calculation to a specific domain: '"adiposity"', '"blood_pressure"', '"blood_lipids"', '"blood_glu_insu"', or '"overall"'.

Details

Action levels are derived using 'cut()' on percentile values. For example, a value > 95th percentile maps to '"action"'. HDL is reversed ('1 - hdl_percentile') since lower HDL values are riskier.

Value

A list (or a modified data frame if 'append = TRUE') containing action level classifications for each domain.

Examples

df <- data.frame(waist_percentile = c(0.85, 0.96))
action_levels(df)

df <- data.frame(
  hdl_percentile = c(0.1,0.5),
  homa_percentile = c(0.4,0.9),
  trg_percentile = c(0.6,0.5),
  waist_percentile = c(0.9,0.99),
  sbp_percentile = c(0.8,0.01)
)
action_levels(df)

Calculate IDEFICS Scores for Children

Description

Computes age-, sex- and (for 'sbp' and 'dbp') height-specific percentiles or z-scores for anthropometric and metabolic variables using IDEFICS study reference data.

Usage

get_scores(
  variable = "waist",
  sex = c("f", "m"),
  age = 6:5,
  height = NULL,
  values = c(20, 21),
  return_values = c("percentile", "z.score")
)

Arguments

variable

Character. The variable to assess. Must be one of the supported variables ("waist", "bmi", "hdl", "sbp", "dbp", "trg", "homa", "glu", "height" or "insu").

sex

Character vector. Same length as 'age', 'height', and 'values'. Accepts "f" for female or "m" for male.

age

Numeric vector. Ages of the children in years.

height

Numeric vector or NULL. Required for height-dependent models ('sbp' and 'dbp'). Defaults to NULL.

values

Numeric vector. Observed values of the variable to score.

return_values

Character vector. Specifies which outputs to return. Options include "percentile", "z.score".

Value

A named list containing the requested scores. Each element is a numeric vector of the same length as 'values'.

Examples

get_scores(
  variable = "waist",
  sex = "f",
  age = c(5, 6),
  values = c(50, 52),
  return_values = "z.score"
)

get_scores(
  variable="dbp",
  sex=c("f","m"),
  age=c(5,5),
  height=c(120,110),
  values=c(70,60)
)

Calculate Metabolic Syndrome (MetS) Score

Description

Computes a composite MetS score from standardized z-scores of metabolic indicators.

Usage

MetSScore(df)

Arguments

df

A data frame containing the following columns: 'waist_z.score', 'homa_z.score', 'sbp_z.score', 'dbp_z.score', 'trg_z.score', and 'hdl_z.score'. These are expected to be numeric vectors representing z-scores.

Details

The MetS score is computed as:
'waist_z + homa_z + 0.5 × (sbp_z + dbp_z + trg_z - hdl_z)'

Value

A numeric vector representing the calculated MetS score for each row in the input data.

Examples

df <- data.frame(
  waist_z.score = c(1.2, 0.5),
  homa_z.score = c(0.8, 0.6),
  sbp_z.score = c(0.7, 0.3),
  dbp_z.score = c(0.6, 0.4),
  trg_z.score = c(1.0, 0.9),
  hdl_z.score = c(-0.5, -0.2)
)
MetSScore(df)

Compute IDEFICS Scores for Multiple Variables

Description

Applies 'get_scores()' to multiple anthropometric and metabolic variables in a data frame and optionally returns MetS and action levels.

Usage

ScoreCalc(
  df,
  return_input = F,
  return_values = c("percentile", "z.score", "MetS", "action")
)

Arguments

df

A data frame with columns: 'sex', 'age', 'height', and observed values for any of the supported variables: 'bmi', 'glu', 'hdl', 'height', 'homa', 'insu', 'trg', 'waist', 'sbp', 'dbp'. Values for 'height' are only required for 'sbp' and 'dbp'.

return_input

Logical. If 'TRUE', includes original input columns in the result. Defaults to 'FALSE'.

return_values

Character vector. Specifies which scores to compute. Options include '"percentile"', '"z.score"', '"MetS"', and '"action"'.

Details

The function iteratively applies 'get_scores()' to each recognized variable in the input and combines the results. If '"MetS"' is requested, a Metabolic Syndrome score is computed and optionally transformed to percentiles/z-scores.

Value

A data frame with score columns named as '<variable>_percentile', '<variable>_z.score', etc. Includes additional columns like 'MetS' or action levels if requested.

Examples

df <- data.frame(
  sex = c("f", "m"),
  age = c(6, 7),
  height = c(120, 125),
  waist = c(55, 60),
  homa = c(1.2, 1.4),
  sbp = c(100, 105),
  dbp = c(65, 70),
  trg = c(0.9, 1.0),
  hdl = c(1.1, 1.0)
)
ScoreCalc(df, return_values = c("z.score", "MetS"))