MonolixSuite in R
Auto Light Dark
Auto Light Dark

tableNCARatios()

Returns a reporting-ready summary table of individual NCA ratio results from a PKanalix project. Supports stratification by covariates, wide or vertical layouts, per-parameter rounding, custom aliases, and optional inclusion of individual subject values.

Usage

R
tableNCARatios(projectFile      = NULL,
               splitCovariates  = NULL,
               stratifyColumns  = FALSE,
               covariateLabels  = NULL,
               selectParameters = NULL,
               metrics          = NULL,
               useWideFormat    = TRUE,
               includeId        = FALSE,
               filterCovariates = NULL,
               filterIds        = NULL,
               roundDigits      = 3,
               roundMethod      = c("monolixSuiteRounding", "significantFigures", "significantFiguresPreserved", "none"),
               roundByParameter = NULL,
               prettyLabels     = TRUE,
               customAliases    = NULL,
               mock             = FALSE)

Arguments

  • projectFile (character) Path to a PKanalix project file (.pkx). If NULL (default), uses the currently loaded project.

  • splitCovariates (character) Column name(s) to stratify by (must exist in the individual-ratio data, excluding id/ratio columns), e.g. "DOSE" or c("DOSE","VISIT"). If NULL (default), no stratification.

  • stratifyColumns (logical) If TRUE, creates separate columns per covariate combination plus an "Overall" column. If FALSE (default), covariates appear as left-side columns. Only applies when splitCovariates is set and useWideFormat = FALSE.

  • covariateLabels (character) Custom labels for splitCovariates (same length). If NULL (default), the original covariate names are used. Shown in headers when stratifyColumns = TRUE.

  • selectParameters (character) Ratio parameter names to include. If NULL (default), all available ratio parameters are used.

  • metrics (character) Summary statistics to include. If NULL (default), all available metrics are included. Accepted values (returned by getDescriptiveStatsMetrics(), in calculation order):

    • Counts: "N", "Nobs"

    • Range / percentiles: "min", "P05", "Q1", "median", "Q3", "P95", "max"

    • Central tendency & dispersion: "mean", "SD", "SE", "CV"

    • Geometric / harmonic: "geoMean", "geoSD", "geoCV", "harmMean"

    • Combined display metrics: "MeanSD", "MeanCV", "GeomCV", "GeomSD"

  • useWideFormat (logical) If TRUE (default), returns a wide table; if FALSE, results are pivoted to long format.

  • includeId (logical) If TRUE (with useWideFormat = FALSE and stratifyColumns = FALSE), appends individual subject ratio values below the summary statistics. Default FALSE.

  • filterCovariates (list) Named list of categorical covariates → allowed values, e.g. list(SEX = "Male"). If NULL (default), no covariate filtering is applied.

  • filterIds (character/numeric) Subject IDs to include. If NULL (default), no ID filtering is applied.

  • roundDigits (integer) Number of decimal places for rounding (default 3).

  • roundMethod (character) How numeric values are rounded. roundDigits controls the number of digits in each case. Options:

    • "monolixSuiteRounding" (default) - Mirrors MonolixSuite display. The integer part is kept exactly as-is, and only the fractional part is rounded to roundDigits significant figures. Small values (< 1) automatically get more decimal places.

    • "significantFigures" - Standard significant-figures rounding: the value is rounded to roundDigits total significant digits, zeroing non-significant digits before the decimal for large numbers.

    • "significantFiguresPreserved" - Like "significantFigures", but never zeroes digits before the decimal. Once the integer part already has at least roundDigits digits, the value is simply rounded to the nearest whole number instead of being zeroed out.

    • "none" - No rounding; values are returned as-is.

  • roundByParameter Optional per-parameter rounding overrides on top of the global settings, either a named numeric vector of digits (c(AUClast_ratio = 2, Cmax_ratio = 4)) or a 3-column data frame (parameter, digits, method). Unlisted parameters keep global settings (default NULL).

  • prettyLabels (logical) If TRUE (default), converts column names to human-readable labels.

  • customAliases (character / data.frame) Named vector or 2-column data frame mapping parameters → custom alias labels. (Ratios are dimensionless, so there is no units argument.)

  • mock (logical) If TRUE, masks values for documentation/examples (metric values become "xx.xx", covariate levels become "Category 1"…, IDs become "id1"…). Default FALSE.

Returns: A data frame of summary statistics (N, Min, Q1, Mean, Median, Q3, Max) for each ratio parameter, optionally stratified; when includeId = TRUE, also individual per-subject ratio values.

Examples

Last updated: