mahmoud-teaima
★    

2017-06-08 17:45

Posting: # 17468
Views: 13,315
 

 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.
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-06-10 01:44

@ mahmoud-teaima
Posting: # 17480
Views: 12,298
 

 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.

Cheers,
Helmut Schütz
[image]

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

2017-06-10 22:48

@ Helmut
Posting: # 17484
Views: 11,806
 

 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.
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-06-11 01:24

@ mahmoud-teaima
Posting: # 17485
Views: 11,870
 

 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).

Cheers,
Helmut Schütz
[image]

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

2017-06-11 03:01

@ Helmut
Posting: # 17486
Views: 11,856
 

 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.
Yura
★    

Belarus,
2017-09-04 21:22

@ Helmut
Posting: # 17773
Views: 10,979
 

 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
★★★
avatar
Homepage
Vienna, Austria,
2017-09-05 01:55

@ Yura
Posting: # 17774
Views: 10,999
 

 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.

Cheers,
Helmut Schütz
[image]

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

Belarus,
2017-09-05 22:21

@ Helmut
Posting: # 17783
Views: 10,888
 

 R code for the EMA’s ABEL

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

@ Yura
Posting: # 17785
Views: 10,903
 

 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.

Cheers,
Helmut Schütz
[image]

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

Belarus,
2017-09-08 08:54

@ Helmut
Posting: # 17794
Views: 10,797
 

 R code for the EMA’s ABEL

Yes, Captain
Best regards!


Edit: ElMaestro is our capt’n. :pirate: I’m just a deckhand. [Helmut]
sschivu
☆    

India,
2019-04-22 13:50
(edited by mittyri on 2019-04-22 14:31)

@ Helmut
Posting: # 20205
Views: 3,146
 

 R code for the EMA’s ABEL

Hi Helmut,

Request you to send partial replicate code to my Personal email ID.

Regards,
sschivu


Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post #5[mittyri]
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2019-04-22 18:46

@ sschivu
Posting: # 20208
Views: 3,094
 

 package replicateBE for R

Hi sschivu,

» Request you to send partial replicate code to my Personal email ID.

See this post. The current version is 1.0.5.9000 (2017-11-25).
You can also click Clone or download ▼ Download ZIP and then install in R from the local file.
Though we validated the code with reference data sets against SAS and Phoenix/WinNonlin it is still a work in progress. Use in a productive environment is at your own risk.


Edit: v1.0.8 on CRAN since 2016-06-14. [Helmut]

Cheers,
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
gvk
☆    

India,
2019-05-03 09:15

@ Helmut
Posting: # 20269
Views: 2,925
 

 package replicateBE for R

Hi Helmut,

I have developed simple crossover & parallel BE code in r using mittyri post code. But I was stuck with 3 period partial replicate code. Could you please help on this.

Request you to send partial replicate r code like SAS code.

Thanks & Regards,
gvk


Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Ohlbe]
Activity
 Admin contact
20,135 posts in 4,245 threads, 1,385 registered users;
online 19 (0 registered, 19 guests [including 5 identified bots]).
Forum time (Europe/Vienna): 10:43 CET

In the beginner’s mind there are many possibilities.
In the expert’s mind there are few.    Shunryu Suzuki

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5