calculate_centile_table: Calculate a centile table from a given reference

View source: R/calculate_centile_table.R

calculate_centile_tableR Documentation

Calculate a centile table from a given reference

Description

This function calculates centiles based on specified z-scores or percentiles using a given reference. It requires the reference to be provided as a code compatible with the centile package.

Usage

calculate_centile_table(x, z = NULL, p = NULL, refcode = NULL, dec = 4, ...)

Arguments

x

A vector with the grid (usually years, sometimes cm) on the horizontal axis.

z

A vector containing the z values of the desired centiles.

p

A vector containing the desired percentile values (between 0 and 100). The default p = NULL does not calculate percentiles.

refcode

A reference code according to the specifications of the centile package. This code should match a pre-defined reference table containing LMS values for various age or measurement groups.

dec

Number of decimals needed for the output.

...

Additional arguments passed down to z2y().

Value

A matrix containing the desired centiles, with columns named according to either the z-score values (e.g., Z-2, Z0, Z2) or percentiles (e.g., P3, P50, P97).

Examples

# Centile table from WHO weight standard for boys aged 0-5 years
calculate_centile_table(z = -2:2, x = 0:5, refcode = "who_2006_wgt_male_")

growthcharts/yzy documentation built on Oct. 28, 2024, 10:32 a.m.