| compute_trace_levels | R Documentation |
Assigns a traceability level (L0–L3) to each ADaM variable in the trace model based on available mapping, derivation text, and confidence scores.
compute_trace_levels(trace_model)
trace_model |
A |
Trace levels:
L0: No mapping and no derivation text.
L1: Derivation text present but no SDTM mapping.
L2: Mapping to SDTM variable/domain exists.
L3: Mapping exists AND (confidence >= threshold OR derivation text present alongside mapping).
A tibble with columns: adam_dataset, adam_var, trace_level,
has_mapping, has_derivation_text, n_candidates, max_confidence.
adam_meta <- data.frame(
dataset = "ADSL", variable = c("STUDYID", "USUBJID", "AGE", "AGEGR1"),
label = c("Study ID", "Unique Subject ID", "Age", "Age Group")
)
sdtm_meta <- data.frame(
dataset = "DM", variable = c("STUDYID", "USUBJID", "AGE"),
label = c("Study ID", "Unique Subject ID", "Age")
)
map <- data.frame(
adam_dataset = "ADSL", adam_var = c("STUDYID", "USUBJID", "AGE"),
sdtm_domain = "DM", sdtm_var = c("STUDYID", "USUBJID", "AGE"),
confidence = c(1.0, 1.0, 0.9)
)
tm <- build_trace_model(adam_meta, sdtm_meta, mapping = map)
compute_trace_levels(tm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.