Bioequivalence and Bioavailability Forum

Main page Policy/Terms of Use Abbreviations Latest Posts

 Log-in |  Register |  Search

Back to the forum  Query: 2017-10-19 00:17 CEST (UTC+2h)
 
mahmoud-teaima
Regular

Cairo, Egypt,
2017-06-08 17:45

Posting: # 17468
Views: 1,887
 

 R code for analysis of data from partial replicate design "2x3x3" BE study [R for BE/BA]

Hello all,
Can any of our R-coding experts advise me with an R code to do data analysis of partial replicate design "2x3x3" BE study according to FDA and EMA guidelines.
Greetings.

Mahmoud Teaima, PhD.
Assistant Professor at Department of Pharmaceutics and Industrial Pharmacy.
Vice-director at Center of Applied Research and Advanced Studies (CARAS).
Faculty of Pharmacy, Cairo University, Cairo, Egypt.
Helmut
Hero
Homepage
Vienna, Austria,
2017-06-10 01:44

@ mahmoud-teaima
Posting: # 17480
Views: 1,642
 

 R code for the EMA’s ABEL

Hi Mahmoud,

» […] an R code to do data analysis of partial replicate design "2x3x3" BE study according to FDA and EMA guidelines.

Good news: The EMA’s ‘Method A’ and ‘Method B’ are fairly easy to implement in R. I have code covering the following designs: RTRT|TRTR, RTTR|TRRT, RTR|TRT, RTT|TRR, RRT|RTR|TRR. The code handles balanced/unbalanced sequences and complete/incomplete data (i.e., periods missing). Example output:

This code is copyright © by Helmut Schütz, Michael Tomashevskiy, Detlew Labes.
This code is open source; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foun-
dation; either version 3, or (at your option) any later version. See the GNU
GPL for more details. Copies of the GPL-3 versions are available at:
http://www.gnu.org/licenses/gpl-3.0.html
╔════════════════════════════════════════════════════════════════════════════╗
║ Program 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.                                                   ║
╚════════════════════════════════════════════════════════════════════════════╝
Directory          : E:/Public/Documents/BEBAC/Publications/AAPS J/RepVal/Data/
File [sheet]       : DS.xls [01]
System             : BEBAC-PC
User               : HS
Operating System   : Windows 7 x64 build 7601, Service Pack 1
R version          : 3.4.0   (2017-04-21)
readxl version     : 1.0.0   (2017)
PowerTOST version  : 1.4.5   (2017)
EMA_methodAB vers. : 0.95    (2017-06-11)
──────────────────────────────────────────────────────────────────────
Function           : CV.calc(); exec. 2017-06-11 18:10:33 CEST
  Fixed effects    : sequence + subject(sequence) + period
  Data             : treatment = R
Function           : method.A(); exec. 2017-06-11 18:10:33 CEST
  Fixed effects    : sequence + subject(sequence) + period + treatment
  Data             : all
──────────────────────────────────────────────────────────────────────
Data set I given by the EMA (Q&A document) available at
http://www.ema.europa.eu/docs/en_GB/document_library/Scientific_guideline/2009/09/WC500002963.pdf
Analysis performed on column ‘PK’ (data internally log-transformed)
Sequences (design) : RTRT|TRTR (4-period full replicate)
Subjects / sequence: 38|39   (unbalanced)
Missings / sequence: 3|7     (incomplete)
Missings / period  : 0|1|7|2 (incomplete)
Subjects (total)   :  77
Sub’s with T and R :  77 (calculation of the CI)
Sub’s with two Ts  :  71
Sub’s with two Rs  :  73
Degrees of freedom : 217
alpha              : 0.05 (90% CI)
Switching CV       :  30.00%
Scaling cap        :  50.00%
Regulatory constant: 0.760
GMR restriction    :  80.00% ... 125.00%
CVwT               :  35.16%
CVwR               :  46.96% (reference-scaling applicable)
Expanded limits    :  71.23% ... 140.40%
Recalculation due to presence of 2 outliers (subj. 45|52)
─────────────────────────────────────────────────────────
CVwR (outl. excl.) :  32.16% (reference-scaling applicable)
Expanded limits    :  78.79% ... 126.93%

Assessment based on original CVwR 46.96%
────────────────────────────────────────
Confidence interval: 107.11% ... 124.89% (pass)
Point estimate     : 115.66% (pass)
Overall conclusion : pass

Assessment based on recalculated CVwR 32.16%
────────────────────────────────────────────
Confidence interval: pass
Point estimate     : pass
Overall conclusion : pass


This code is copyright © by Helmut Schütz, Michael Tomashevskiy, Detlew Labes.
This code is open source; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foun-
dation; either version 3, or (at your option) any later version. See the GNU
GPL for more details. Copies of the GPL-3 versions are available at:
http://www.gnu.org/licenses/gpl-3.0.html
╔════════════════════════════════════════════════════════════════════════════╗
║ Program 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.                                                   ║
╚════════════════════════════════════════════════════════════════════════════╝
Directory          : E:/Public/Documents/BEBAC/Publications/AAPS J/RepVal/Data/
File [sheet]       : DS.xls [01]
System             : BEBAC-PC
User               : HS
Operating System   : Windows 7 x64 build 7601, Service Pack 1
R version          : 3.4.0   (2017-04-21)
readxl version     : 1.0.0   (2017)
PowerTOST version  : 1.4.5   (2017)
nlme version       : 3.1.131 (2017)
EMA_methodAB vers. : 0.95    (2017-06-11)
─────────────────────────────────────────────────────────────────────────────────
Function           : CV.calc(); exec. 2017-06-11 18:10:37 CEST
  Fixed effects    : sequence + subject(sequence) + period
  Data             : treatment = R
Function           : method.B(option=2): nlme/lme; exec. 2017-06-11 18:10:37 CEST
  Fixed effects    : sequence + period + treatment
  Random effect    : subject(sequence)
  Data             : all
─────────────────────────────────────────────────────────────────────────────────
Data set I given by the EMA (Q&A document) available at
http://www.ema.europa.eu/docs/en_GB/document_library/Scientific_guideline/2009/09/WC500002963.pdf
Analysis performed on column ‘PK’ (data internally log-transformed)
Sequences (design) : RTRT|TRTR (4-period full replicate)
Subjects / sequence: 38|39   (unbalanced)
Missings / sequence: 3|7     (incomplete)
Missings / period  : 0|1|7|2 (incomplete)
Subjects (total)   :  77
Sub’s with T and R :  77 (calculation of the CI)
Sub’s with two Ts  :  71
Sub’s with two Rs  :  73
Degrees of freedom : 217
alpha              : 0.05 (90% CI)
Switching CV       :  30.00%
Scaling cap        :  50.00%
Regulatory constant: 0.760
GMR restriction    :  80.00% ... 125.00%
CVwT               :  35.16%
CVwR               :  46.96% (reference-scaling applicable)
Expanded limits    :  71.23% ... 140.40%
Recalculation due to presence of 2 outliers (subj. 45|52)
─────────────────────────────────────────────────────────
CVwR (outl. excl.) :  32.16% (reference-scaling applicable)
Expanded limits    :  78.79% ... 126.93%

Assessment based on original CVwR 46.96%
────────────────────────────────────────
Confidence interval: 107.17% ... 124.97% (pass)
Point estimate     : 115.73% (pass)
Overall conclusion : pass

Assessment based on recalculated CVwR 32.16%
────────────────────────────────────────────
Confidence interval: pass
Point estimate     : pass
Overall conclusion : pass


I will send you the code by PM.

Bad news: Evaluation of replicate designs which will give exactly the same results as SAS’ PROC MIXED according to the FDA’s progesterone guidance is not (and likely will never be) possible in R. Too different philosophies.


Edit: Updated the output according to v0.95 of the R-code.

[image]All the best,
Helmut Schütz 
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
mahmoud-teaima
Regular

Cairo, Egypt,
2017-06-10 22:48

@ Helmut
Posting: # 17484
Views: 1,540
 

 R code for the EMA’s ABEL

Salam Alikum Hilmut,
Thanks for the code!
Waiting you send it to me through email.
Greetings.

Mahmoud Teaima, PhD.
Assistant Professor at Department of Pharmaceutics and Industrial Pharmacy.
Vice-director at Center of Applied Research and Advanced Studies (CARAS).
Faculty of Pharmacy, Cairo University, Cairo, Egypt.
Helmut
Hero
Homepage
Vienna, Austria,
2017-06-11 01:24

@ mahmoud-teaima
Posting: # 17485
Views: 1,535
 

 R code for the EMA’s ABEL

Salam Mahmoud,

» Waiting you send it to me through email.

I’ve sent it already yesterday afternoon to the e-mail address you used in registering to the forum. Please check your inbox.
I just sent it again to the three other addresses I found at your faculty’s website. This e-mail contains more explanations. Since you are working on MacOS I adapted the output: The file is encoded in UTF-8 with line endings CR (ASCII 13). Please report back whether it works (I don’t have a Mac to test it).

[image]All the best,
Helmut Schütz 
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
mahmoud-teaima
Regular

Cairo, Egypt,
2017-06-11 03:01

@ Helmut
Posting: # 17486
Views: 1,528
 

 R code for the EMA’s ABEL

Salam Helmut,

» I’ve sent it already yesterday afternoon to the e-mail address you used in registering to the forum. Please check your inbox.
» I just sent it again to the three other addresses I found at your faculty’s website. This e-mail contains more explanations. Since you are working on MacOS I adapted the output: The file is encoded in UTF-8 with line endings CR (ASCII 13).

I got the mail, thanks.

» Please report back whether it works (I don’t have a Mac to test it).

Sure, will check it and report back to you.

Many thanks.

Greetings to all participants in this effort.

Mahmoud Teaima, PhD.
Assistant Professor at Department of Pharmaceutics and Industrial Pharmacy.
Vice-director at Center of Applied Research and Advanced Studies (CARAS).
Faculty of Pharmacy, Cairo University, Cairo, Egypt.
Yura
Regular

Belarus,
2017-09-04 21:22

@ Helmut
Posting: # 17773
Views: 721
 

 R code for the EMA’s ABEL

Dear Helmut
I use combined R and SAS (I use the EMA approach) to calculate the replicative design
Is it possible to get from you the implementation code in R of the above described constructions?
thank you very much for any answer
Best regards!
Helmut
Hero
Homepage
Vienna, Austria,
2017-09-05 01:55

@ Yura
Posting: # 17774
Views: 690
 

 R code for the EMA’s ABEL

Hi Yura,

» Is it possible to get from you the implementation code in R of the above described constructions?

It’s on GitHub: https://github.com/Helmut01/replicateBE
Installation analogous to PowerTOST. See Detlew’s post.

[image]All the best,
Helmut Schütz 
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
Yura
Regular

Belarus,
2017-09-05 22:21

@ Helmut
Posting: # 17783
Views: 665
 

 R code for the EMA’s ABEL

Thank you
it remains only to run
Helmut
Hero
Homepage
Vienna, Austria,
2017-09-06 14:24

@ Yura
Posting: # 17785
Views: 655
 

 R code for the EMA’s ABEL

Hi Yura,

» it remains only to run

If you have questions, please post here.

If you think that you discovered a bug, keep it. ;-)
No, seriously: Navigate to https://github.com/Helmut01/replicateBE/issues and click on New issue.

[image]All the best,
Helmut Schütz 
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes
Yura
Regular

Belarus,
2017-09-08 08:54

@ Helmut
Posting: # 17794
Views: 596
 

 R code for the EMA’s ABEL

Yes, Captain
Best regards!


Edit: ElMaestro is our capt’n. :pirate: I’m just a deckhand. [Helmut]
Back to the forum Activity
 Thread view
Bioequivalence and Bioavailability Forum | Admin contact
17,394 Posts in 3,725 Threads, 1,072 registered users;
28 users online (0 registered, 28 guests).

No investigation can strictly be called scientific
unless it admits of mathematical demonstration.    Leonardo da Vinci

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
XHTML/CSS RSS Feed