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.
When every framework fails because the data give no usable estimate (for
example no degrees of freedom; an error of class
pknca_error_be_not_estimable), that error is raised. Rows for the
"descriptive" framework have NA in the decision columns.
Usage
be_compare(
object,
reference_col,
reference_value,
endpoints = c("cmax", "aucinf.obs", "aucinf.pred", "auclast"),
regulators = c("ABE", "EMA", "HC", "GCC", "FDA"),
model_type = NULL,
alpha = 0.1,
subject = NULL,
sequence = NULL,
period = NULL,
design = NULL,
covariates = NULL,
heteroscedastic = FALSE,
widen_endpoints = NULL,
widen_default = TRUE
)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. The results of a sparse bootstrap (from aPKNCAconcobject made bysparse_bootstrap()) are compared with the percentile intervals of the bootstrap replicates (Shen and Machado 2017); see Details.- 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),"nlme"(mixed model with treatment-specific residual variances, for crossover/replicate designs), or"gls"(generalized least squares with treatment-specific residual variances, for parallel designs). WhenNULL(default) it is chosen from the design, the regulator, andheteroscedastic.- 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.- covariates
An optional character vector of column names added to every model as additive fixed effects (numeric columns as linear terms, character or factor columns as factors). They must not be missing in any analyzed row. For a
PKNCAresultsobject they must be columns ofas.data.frame(object), which means grouping columns. The within-subject variances used for reference scaling and the intra-subject contrasts do not use covariates.- heteroscedastic
Logical. When
TRUE, estimate a separate residual variance for each treatment (see Details).- widen_endpoints
For the expanding-limits frameworks (
"EMA","HC", and"GCC"), endpoints whose acceptance limits widen in addition to the framework's own choice (the endpoints judged like Cmax for the EMA and GCC, like AUC for Health Canada; seebe_regulator()). Use it for an endpoint that the guidance widens but PKNCA cannot recognize from its name, such as a partial AUC of a modified-release product (EMA), or an endpoint that is neither a PKNCA parameter nor a CDISC code. Naming an endpoint for another framework is an error;be_compare()passes it to the expanding-limits frameworks only, and each adds it to its own choice.- widen_default
For the expanding-limits frameworks, whether the framework's own choice of endpoints widens (the default,
TRUE). WithFALSEonly the endpoints inwiden_endpointswiden, for example none when the protocol did not specify widening in advance; Health Canada still judges Cmax by its point estimate.FALSEfor another framework is an error;be_compare()applies it to the expanding-limits frameworks only.
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))
)
}))
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 rule
#> EMA auclast T 98 85.72 112.04 34.11 ABE
#> HC auclast T 98 85.72 112.04 34.11 ABEL
#> GCC auclast T 98 85.72 112.04 34.11 ABE
#> FDA auclast T 98 85.48 112.35 34.11 RSABE
#> limit_lower limit_upper criterion pass
#> 80.00 125.00 NA TRUE
#> 77.71 128.68 NA TRUE
#> 80.00 125.00 NA TRUE
#> NA NA -0.05022 TRUE