Compare a bioequivalence dataset across regulatory frameworks
Source:R/bioequivalence.R
be_compare.Rdbe_compare() runs be_assess() under several regulatory frameworks and
stacks the results, so the same study can be judged side by side under the
different reference-scaling rules. Frameworks that the design does not
support (for example NTID on a partial replicate) are skipped with a warning.
Arguments
- object
A
PKNCAresultsobject or a tidy long data.frame with aPPTESTCDcolumn of parameter names, aPPORRES/PPSTREScolumn of values, and subject/sequence/period/treatment columns.- reference_col
The column identifying the formulation/treatment.
- reference_value
The value of
reference_colthat is the reference formulation.- endpoints
Character vector of NCA parameters (matched against
PPTESTCD) to assess.- regulators
A character vector of regulatory frameworks to compare (see
be_regulator()).- model_type
The model for the average-BE point estimate, one of
"lmer"(mixed model, for crossover/replicate designs),"anova"(fixed-effects, for parallel designs),"isc"(intra-subject contrasts, the FDA reference-scaled path), or"nlme"(treatment-specific mixed model). WhenNULL(default) it is chosen from the design and regulator.- alpha
The significance level; the confidence interval has level
1 - alpha(default0.10gives the 90% interval).- subject, sequence, period
Column names for the subject, randomization sequence, and period. When
NULLthey are taken from thePKNCAresultsobject or detected from common column names.sequencemay be absent.- design
An optional
be_design()object; computed from the data whenNULL.
Value
An object of class be_compare (a data.frame) with the be_assess()
columns for every endpoint, test formulation, and regulator.
See also
Other Bioequivalence:
be_assess(),
be_dataset(),
be_design(),
be_expand_limits(),
be_extract_param(),
be_fit_model_single(),
be_fit_models(),
be_regulator(),
be_table(),
be_within_var()
Examples
set.seed(1)
nsub <- 24
seqs <- rep(c("TRTR", "RTRT"), length.out = nsub)
b <- stats::rnorm(nsub, sd = 0.4)
d <- do.call(rbind, lapply(seq_len(nsub), function(i) {
trt <- strsplit(seqs[i], "")[[1]]
data.frame(
subject = i, sequence = seqs[i], period = seq_along(trt), treatment = trt,
PPTESTCD = "auclast",
PPORRES = exp(log(100) + ifelse(trt == "T", 0.04, 0) + b[i] +
stats::rnorm(length(trt), sd = 0.45)),
stringsAsFactors = FALSE
)
}))
be_compare(d, reference_col = "treatment", reference_value = "R",
endpoints = "auclast", regulators = c("EMA", "HC", "GCC", "FDA"))
#> Warning: Units were not found in the data; omitting the `units` column. Supply units via a PKNCAresults object or `PPSTRESU`/`PPORRESU` columns.
#> Bioequivalence comparison across EMA, HC, GCC, FDA (90% CI)
#>
#> regulator endpoint test gmr_percent ci_lower ci_upper cvwr_percent limit_lower
#> EMA auclast T 98 85.72 112.04 34.11 77.71
#> HC auclast T 98 85.72 112.04 34.11 77.71
#> GCC auclast T 98 85.72 112.04 34.11 75.00
#> FDA auclast T 98 85.75 112.00 34.11 NA
#> limit_upper criterion pass
#> 128.68 NA TRUE
#> 128.68 NA TRUE
#> 133.33 NA TRUE
#> NA -0.05081 TRUE