forked from Helmut01/replicateBE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
274 lines (218 loc) · 16.4 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
---
title: "replicateBE"
output:
github_document:
toc: true
toc_depth: 4
fig_width: 6.5
fig_height: 6
dev: png
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
![active](https://www.repostatus.org/badges/latest/active.svg) ![min R](https://img.shields.io/badge/R%3E%3D-3.5.0-blue.svg) ![on CRAN](https://www.r-pkg.org/badges/version-ago/replicateBE) [![cran checks](https://cranchecks.info/badges/worst/replicateBE)](https://cran.r-project.org/web/checks/check_results_replicateBE.html) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/replicateBE?color=blue)](https://r-pkg.org/pkg/replicateBE) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-month/replicateBE?color=green)](https://r-pkg.org/pkg/replicateBE) ![code size](https://img.shields.io/github/languages/code-size/Helmut01/replicateBE?color=green) ![repo size](https://img.shields.io/github/repo-size/Helmut01/replicateBE?color=yellow)
```{r, setup, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-"
)
```
```{r, echo = FALSE, results = "asis"}
txt <- paste0("Version ", packageVersion("replicateBE"), " built ",
packageDate("replicateBE", date.fields = "Built"),
" with R ", substr(packageDescription("replicateBE", fields = "Built"), 3, 7))
if (grepl("900", as.character(packageVersion("replicateBE")))) {
txt <- paste(txt, "\n(development version not on CRAN).")
} else {
txt <- paste0(txt, "\n(stable release on CRAN ",
packageDate("replicateBE", date.fields = "Date/Publication"), ").")
}
cat(txt)
```
<h2>Comparative BA-calculation for the EMA’s Average Bioequivalence with Expanding Limits (ABEL)</h2>
## Introduction{#introduction}
The library provides data sets (internal `.rda` and in <span title="Character Separated Variables">CSV</span>-format in `/extdata/`) supporting users in a black-box performance qualification (PQ) of their software installations. Users can analyze own data imported from <span title="Character Separated Variables">CSV</span>- and Excel-files. The methods given by the <span title="European Medicines Agency">EMA</span> for reference-scaling<sup id="a1">[1](#f1),</sup><sup id="a2">[2](#f2)</sup> are implemented.<br>
Potential influence of outliers on the variability of the reference can be assessed by box plots of studentized and standardized residuals as suggested at a joint <span title="European Generic Medicines Association">EGA</span>/<span title="European Medicines Agency">EMA</span> workshop.<sup id="a3">[3](#f3)</sup><br>
Health Canada’s approach<sup id="a4">[4](#f4)</sup> requiring a mixed-effects model is approximated by intra-subject contrasts.
Direct widening of the acceptance range as recommended by the Gulf Cooperation Council<sup id="a5">[5](#f5)</sup> (Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, United Arab Emirates) is provided as well.
In full replicate designs the variability of test and reference treatments can be assessed by _s_~wT~/_s_~wR~ and the upper confidence limit of _σ_~wT~/_σ_~wR~ (required for the <span title="World Health Organization">WHO</span>’s approach<sup id="a6">[6](#f6)</sup> for reference-scaling of _AUC_).
<small>[TOC ↩](#replicatebe)</small>
### Methods{#methods}
#### Estimation of _CV_~wR~ (and _CV_~wT~ in full replicate designs){#estimation-of-cvwr-and-cvwt-in-full-replicate-designs}
Called internally by functions `method.A()` and `method.B()`. A linear model of log-transformed pharmacokinetic (PK) responses and effects
_sequence_, _subject_(_sequence_), _period_\
where all effects are fixed (_i.e._, <span title="Analysis of Variance">ANOVA</span>). Estimated by the function `lm()` of library `stats`.
```{r eval = FALSE}
modCVwR <- lm(log(PK) ~ sequence + subject%in%sequence + period,
data = data[data$treatment == "R", ])
modCVwT <- lm(log(PK) ~ sequence + subject%in%sequence + period,
data = data[data$treatment == "T", ])
```
<small>[TOC ↩](#replicatebe)</small>
#### Method A{#method-a}
Called by function `method.A()`. A linear model of log-transformed <span title="pharmacokinetic">PK</span> responses and effects
_sequence_, _subject_(_sequence_), _period_, _treatment_\
where all effects are fixed (_e.g._, by an <span title="Analysis of Variance">ANOVA</span>). Estimated by the function `lm()` of library `stats`.
```{r eval = FALSE}
modA <- lm(log(PK) ~ sequence + subject%in%sequence + period + treatment,
data = data)
```
<small>[TOC ↩](#replicatebe)</small>
#### Method B{#method-b}
Called by function `method.B()`. A linear model of log-transformed <span title="pharmacokinetic">PK</span> responses and effects
_sequence_, _subject_(_sequence_), _period_, _treatment_\
where _subject_(_sequence_) is a random effect and all others are fixed.
Three options are provided:
* Estimated by the function `lmer()` of library `lmerTest`. `method.B(..., option = 1)` employs Satterthwaite’s approximation of the degrees of freedom equivalent to SAS’ `DDFM=SATTERTHWAITE`, Phoenix WinNonlin’s `Degrees of Freedom Satterthwaite`, and Stata’s `dfm=Satterthwaite`. Note that this is the only available approximation in SPSS.
```{r eval = FALSE}
modB <- lmer(log(PK) ~ sequence + period + treatment + (1|subject),
data = data)
```
* Estimated by the function `lme()` of library `nlme`. `method.B(..., option = 2)` employs degrees of freedom equivalent to SAS’ `DDFM=CONTAIN`, Phoenix WinNonlin’s `Degrees of Freedom Residual`, STATISTICA’s `GLM containment`, and Stata’s `dfm=anova`. Implicitly preferred according to the <span title="European Medicines Agency">EMA</span>’s <span title="Questions & Answers">Q&A</span> document and hence, the default of the function.
```{r eval = FALSE}
modB <- lme(log(PK) ~ sequence + period + treatment, random = ~1|subject,
data = data)
```
* Estimated by the function `lmer()` of library `lmerTest`. `method.B(..., option = 3)` employs the Kenward-Roger approximation equivalent to Stata’s `dfm=Kenward Roger (EIM)` and SAS’ `DDFM=KENWARDROGER(FIRSTORDER)` *i.e.*, based on the *expected* information matrix. Note that SAS with `DDFM=KENWARDROGER` and JMP calculate Satterthwaite’s [*sic*] degrees of freedom and apply the Kackar-Harville correction, *i.e.*, based on the *observed* information matrix.
```{r eval = FALSE}
modB <- lmer(log(PK) ~ sequence + period + treatment + (1|subject),
data = data)
```
<small>[TOC ↩](#replicatebe)</small>
#### Average Bioequivalence{#average-bioequivalence}
Called by function `ABE()`. The model is identical to [Method A](#method-a). Conventional BE limits (80.00 – 125.00\%) are employed by default. Tighter limits (90.00 – 111.11\%) for narrow therapeutic index drugs (<span title="European Medicines Agency">EMA</span> and others) or wider limits (75.00 – 133.33\%) for *C*~max~ according to the guideline of South Africa<sup id="a7">[7](#f7)</sup> can be specified.
<small>[TOC ↩](#replicatebe)</small>
### Tested designs{#tested-designs}
#### Four period (full) replicates{#four-period-full-replicates}
`TRTR | RTRT`
`TRRT | RTTR`
`TTRR | RRTT`
`TRTR | RTRT | TRRT | RTTR`
`TRRT | RTTR | TTRR | RRTT`
#### Three period (full) replicates{#three-period-full-replicates}
`TRT | RTR`
`TRR | RTT`
#### Two period (full) replicate{#two-period-full-replicate}
`TR | RT | TT | RR` <small>(Balaam’s design; *not recommended* due to poor power characteristics)</small>
#### Three period (partial) replicates{#three-period-partial-replicates}
`TRR | RTR | RRT`
`TRR | RTR` <small>(Extra-reference design; biased in the presence of period effects, *not recommended*)</small>
<small>[TOC ↩](#replicatebe)</small>
### Cross-validation{#cross-validation}
Details about the reference datasets:
```{r eval = FALSE}
help("data", package = "replicateBE")
?replicateBE::data
```
Results of the 30 reference datasets agree with ones obtained in SAS (9.4), Phoenix WinNonlin (6.4 – 8.1), STATISTICA (13), SPSS (22.0), Stata (15.0), and JMP (10.0.2).<sup id="a8">[8](#f8)</sup>
<small>[TOC ↩](#replicatebe)</small>
## Examples{#examples}
- Evaluation of the internal reference dataset 01<sup id="a9">[9](#f9)</sup> by Method A.
```{r example1}
library(replicateBE) # attach the library
res <- method.A(verbose = TRUE, details = TRUE,
print = FALSE, data = rds01)
cols <- c(12, 17:21) # extract relevant columns
# cosmetics: 2 decimal places acc. to the GL
tmp <- data.frame(as.list(sprintf("%.2f", res[cols])))
names(tmp) <- names(res)[cols]
tmp <- cbind(tmp, res[22:24]) # pass|fail
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
- The same dataset evaluated by Method B, Satterthwaite approximation of degrees of freedom.
```{r example2}
res <- method.B(option = 1, verbose = TRUE, details = TRUE,
print = FALSE, data = rds01)
cols <- c(12, 17:21)
tmp <- data.frame(as.list(sprintf("%.2f", res[cols])))
names(tmp) <- names(res)[cols]
tmp <- cbind(tmp, res[22:24])
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
- The same dataset evaluated by Method B, Kenward-Roger approximation of degrees of freedom. Outlier assessment, recalculation of _CV_~wR~ after exclusion of outliers, new expanded limits.
```{r example3}
res <- method.B(option = 3, ola = TRUE, verbose = TRUE,
details = TRUE, print = FALSE, data = rds01)
cols <- c(27, 31:32, 19:21)
tmp <- data.frame(as.list(sprintf("%.2f", res[cols])))
names(tmp) <- names(res)[cols]
tmp <- cbind(tmp, res[22:24])
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
- The same dataset evaluated according to the conditions of the <span title="Gulf Cooperation Council">GCC</span> (if _CV_~wR~ > 30\% widened limits 75.00 – 133.33\%, GMR-constraint 80.00 – 125.00\%).
```{r example4}
res <- method.A(regulator = "GCC", details = TRUE,
print = FALSE, data = rds01)
cols <- c(12, 17:21)
tmp <- data.frame(as.list(sprintf("%.2f", res[cols])))
names(tmp) <- names(res)[cols]
tmp <- cbind(tmp, res[22:24])
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
- The same dataset evaluated according to the conditions of South Africa (if _CV_~wR~ > 30\% fixed limits 75.00 – 133.33\%).
```{r example5}
res <- ABE(theta1 = 0.75, details = TRUE,
print = FALSE, data = rds01)
tmp <- data.frame(as.list(sprintf("%.2f", res[12:17])))
names(tmp) <- names(res)[12:17]
tmp <- cbind(tmp, res[18])
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
- Evaluation of the internal reference dataset 05.<sup id="a10">[10](#f10)</sup> Tighter limits for the <span title="Narrow Therapeutic Index Drug">NTID</span> phenytoin.
```{r example6}
res <- ABE(theta1 = 0.90, details = TRUE,
print = FALSE, data = rds05)
cols <- c(13:17)
tmp <- data.frame(as.list(sprintf("%.2f", res[cols])))
names(tmp) <- names(res)[cols]
tmp <- cbind(tmp, res[18])
print(tmp, row.names = FALSE)
```
<small>[TOC ↩](#replicatebe)</small>
## Installation{#installation}
The package requires R ≥3.5.0. However, for the Kenward-Roger approximation `method.B(..., option = 3)` R ≥3.6.0 is required.
* Install the released version from <span title="The Comprehensive R Archive Network">CRAN</span>:
```{r eval = FALSE}
install.packages("replicateBE", repos = "https://cloud.r-project.org/")
```
* To use the development version, please install the released version from [CRAN](https://cran.r-project.org/package=replicateBE) first to get its dependencies right ([readxl](https://cran.r-project.org/package=readxl) ≥1.0.0, [PowerTOST](https://cran.r-project.org/package=PowerTOST) ≥1.5.3, [lmerTest](https://cran.r-project.org/package=lmerTest), [nlme](https://cran.r-project.org/package=nlme), [pbkrtest](https://cran.r-project.org/package=pbkrtest)).
You need tools for building R packages from sources on your machine. For Windows users:\
- Download [Rtools](https://cran.r-project.org/bin/windows/Rtools/) from <span title="The Comprehensive R Archive Network">CRAN</span> and follow the suggestions of the installer.
- Install `devtools` and build the development version by:
```{r eval = FALSE}
install.packages("devtools", repos = "https://cloud.r-project.org/")
devtools::install_github("Helmut01/replicateBE")
```
<small>[TOC ↩](#replicatebe)</small>
## Session Information{#session-information}
Inspect this information for reproducibility. Of particular importance are the versions of R and the packages used to create this workflow. It is considered good practice to record this information with every analysis.
```{r, sessioninfo}
options(width = 59)
devtools::session_info()
```
<small>[TOC ↩](#replicatebe)</small>
## Contributors{#contributors}
Helmut Schütz (author) <span style="font-size:smaller">[ORCID iD](https://orcid.org/0000-0002-1167-7880)</span><br>
Michael Tomashevskiy (contributor)<br>
Detlew Labes (contributor) <span style="font-size:smaller">[ORCID iD](https://orcid.org/0000-0003-2169-426X)</span>
<small>[TOC ↩](#replicatebe)</small>
## Disclaimer{#disclaimer}
*Package offered for Use without any Guarantees and Absolutely No Warranty. No Liability is accepted for any Loss and Risk to Public Health Resulting from Use of this R-Code.*
<small>[TOC ↩](#replicatebe)</small>
***
<span id="f1" style="font-size:smaller"> 1. European Medices Agency. [EMA/582648/2016. Annex I.](https://www.ema.europa.eu/en/documents/other/31-annex-i-statistical-analysis-methods-compatible-ema-bioequivalence-guideline_en.pdf) 21 September 2016.</span> [↩](#a1)\
<span id="f2" style="font-size:smaller"> 2. European Medices Agency. Committee for Medicinal Products for Human Use. [CPMP/EWP/QWP/1401/98 Rev. 1/ Corr **.](https://www.ema.europa.eu/en/documents/scientific-guideline/guideline-investigation-bioequivalence-rev1_en.pdf) 20 January 2010.</span> [↩](#a2)\
<span id="f3" style="font-size:smaller"> 3. European Generic Medicines Association. [Revised EMA Bioequivalence Guideline. Questions & Answers.](https://www.medicinesforeurope.com/wp-content/uploads/2016/03/EGA_BEQ_QA_WEB_QA_1_32.pdf) London, June 2010.</span> [↩](#a3)\
<span id="f4" style="font-size:smaller"> 4. Health Canada. [Guidance Document. Conduct and Analysis of Comparative Bioavailability Studies.](https://www.canada.ca/content/dam/hc-sc/documents/services/drugs-health-products/drug-products/applications-submissions/guidance-documents/bioavailability-bioequivalence/conduct-analysis-comparative.pdf) 2018/06/08.</span> [↩](#a4)\
<span id="f5" style="font-size:smaller"> 5. Executive Board of the Health Ministers’ Council for GCC States. [The GCC Guidelines for Bioequivalence. Version 2.4.](https://old.sfda.gov.sa/en/drug/drug_reg/Regulations/GCC_Guidelines_Bioequivalence.pdf) 30/3/2016.</span> [↩](#a5)\
<span id="f6" style="font-size:smaller"> 6. World Health Organization. [Application of reference-scaled criteria for AUC in bioequivalence studies conducted for submission to PQTm.](https://extranet.who.int/pqweb/sites/default/files/documents/AUC_criteria_November2018.pdf) 22 November 2018.</span> [↩](#a6)\
<span id="f7" style="font-size:smaller"> 7. Medicines Control Council. Registration of Medicines. [Biostudies.](https://www.sahpra.org.za/wp-content/uploads/2020/01/61de452d2.06_Biostudies_Jun15_v6.pdf) June 2015.</span> [↩](#a7)\
<span id="f8" style="font-size:smaller"> 8. Schütz H, Tomashevskiy M, Labes D, Shitova A, González-de la Parra M, Fuglsang A. *Reference Datasets for Studies in a Replicate Design Intended for Average Bioequivalence with Expanding Limits.* AAPS J. 2020; 22(2): Article 44. [doi:10.1208/s12248-020-0427-6](https://doi.org/10.1208/s12248-020-0427-6).</span> [↩](#a8)\
<span id="f9" style="font-size:smaller"> 9. European Medices Agency. [EMA/582648/2016. Annex II.](https://www.ema.europa.eu/en/documents/other/31-annex-ii-statistical-analysis-bioequivalence-study-example-data-set_en.pdf) 21 September 2016.</span> [↩](#a9)\
<span id="f10" style="font-size:smaller">10. Shumaker RC, Metzler CM. *The Phenytoin Trial is a Case Study of ‘Individual’ Bioequivalence.* Drug Inf J. 1998; 32(4): 1063--1072. [doi:10.1177/009286159803200426](https://doi.org/10.1177/009286159803200426).</span> [↩](#a10)