Overview
Ratio calculations compare PK parameters between groups — across analytes, dose profiles, specimen types, or routes of administration. In aNCA, ratios are configured in NCA > Setup > Parameter Selection > Ratio Calculations.
Each ratio is defined by:
| Field | Description |
|---|---|
| Test Parameter | PK parameter for the numerator (e.g. CMAX,
AUCLST) |
| Ref Parameter | PK parameter for the denominator (defaults to same as test) |
| Test Groups | Group level for the numerator. (all other levels) uses
every level except the reference. |
| Ref Groups | Group level for the denominator
(e.g. PARAM: ParentDrug) |
| Aggregate |
no = within-subject ratio; yes = mean of
reference across subjects; if-needed = falls back to
aggregation when within-subject matching is not possible |
| Adj. Factor | Multiplier applied to the ratio (e.g. molecular weight correction) |
| PPTESTCD | Auto-generated CDISC code; editable |
The general formula is:
aNCA auto-generates a PPTESTCD based on which grouping variable is used as the reference. The sections below describe each ratio type.
Ratio calculations are implemented in aNCA independently of PKNCA. They operate on the computed NCA results — dividing one parameter value by another across groups — rather than being part of the core NCA engine.
Note: Ratio calculations are only available for parameters selected in the Parameter Selection section. If a parameter is not selected, it will not be available for ratio calculations.
Metabolite Ratio (MR)
When: The reference group column is the
analyte column (e.g. PARAM).
PPTESTCD: MR{param} —
e.g. MRCMAX
Use case: Compare a metabolite to its parent compound.
Accumulation Ratio (AR)
When: The reference group column is the dose
profile column (ATPTREF).
PPTESTCD: AR{param} —
e.g. ARCMAX
Use case: Compare steady-state exposure to single-dose exposure.
Renal Clearance (RENALCL)
When: The test specimen is urine,
the reference specimen is plasma, the test parameter
starts with RCAMINT (recovered amount in interval), and the
reference parameter starts with AUC.
PPTESTCD: RENALCL
Use case: Estimate renal clearance from urinary recovery and plasma AUC.
Formula
Where is the cumulative amount excreted in urine over the interval, and is the corresponding plasma AUC.
Absolute Bioavailability (FABS)
When: The reference group is an
intravascular route
(e.g. ROUTE: INTRAVASCULAR).
PPTESTCD: FABS
Use case: Compare extravascular (e.g. oral) to intravascular (IV) bioavailability, typically dose-normalized.
Relative Bioavailability (FREL)
When: The reference group is a route column but NOT intravascular.
PPTESTCD: FREL
Use case: Compare bioavailability between two extravascular formulations or routes (e.g. tablet vs. capsule, oral vs. subcutaneous).
Generic Ratio (RA)
When: The reference group column does not match any of the specific patterns above (not analyte, not dose profile, not specimen, not route).
PPTESTCD: RA{param} —
e.g. RACMAX
Use case: Any other grouping variable — cohort, treatment arm, dose level, period, etc.
Aggregation Modes
The Aggregate setting controls how reference values are handled when subjects differ between test and reference groups:
| Mode | Behavior |
|---|---|
no |
Strict within-subject matching. Fails if a subject is missing from the reference group. |
yes |
Computes the arithmetic mean of reference values across all subjects, then divides each test subject’s value by that mean. |
if-needed |
Tries within-subject first. For subjects without a matching reference, falls back to the aggregated mean. |
Recommendation: Use no for crossover
designs where every subject has both test and reference. Use
if-needed for parallel designs or when some subjects lack
reference data.
PPTESTCD Auto-Generation
aNCA auto-generates PPTESTCD codes based on the reference group column:
| Reference column matches | PPTESTCD pattern | Example |
|---|---|---|
Analyte column (PARAM) |
MR{param} |
MRCMAX |
Dose profile (ATPTREF) |
AR{param} |
ARAUCLST |
| Specimen + urine/plasma + RCAMINT/AUC | RENALCL |
RENALCL |
| Route = intravascular | FABS |
FABS |
| Route (other) | FREL |
FREL |
| Anything else | RA{param} |
RACMAX |
When multiple ratios produce the same code, a numeric suffix is
appended (e.g. MRCMAX, MRCMAX1).
The PPTESTCD field is editable — you can override the auto-generated code with any custom name.
Using the R Script
Ratio calculations can also be run outside the Shiny app using
calculate_ratios():
library(aNCA)
# Assuming `nca_results` is a PKNCAresults object
ratios <- calculate_ratios(
data = nca_results,
test_parameter = "CMAX",
ref_parameter = "CMAX",
match_cols = c("USUBJID", "start", "end"),
ref_groups = data.frame(PARAM = "ParentDrug"),
adjusting_factor = 1,
custom_pptestcd = "MRCMAX"
)For the app-level wrapper that processes a full ratio table:
# ratio_table is a data.frame with columns:
# TestParameter, RefParameter, RefGroups, TestGroups,
# AggregateSubject, AdjustingFactor, PPTESTCD
results <- calculate_table_ratios(nca_results, ratio_table)