stab for R - A Data Analysis Tool for Drug Stability
with R
 (play the flash demo)


Created by Hsin-ya Lee , and Yung-jin Lee (mobilePK@gmail.com)
College of Pharmacy, Kaohsiung Medical University
Kaohsiung, Taiwan 807

Introduction: This package is used to analyze stability data.  We follow the ICH guideline 'Q1E Evaluation for Stability Data' (linked to USA FDA site) to design this tool (Here's its .pdf.). This guideline describes when extrapolation should be considered as proposing a retest period for a drug substance or a shelf life of a drug product that extends beyond the period covered by available data from the stability study under the long-term storage condition.

Installation & Upgrade: stab for R is one of R packages.  Thus, users have to download and install R first, and then run it.  Under R Console, users can click "Packages" from the menu then ->"Install package(s)..." --> select a CRAN mirror site near you and you will see the list of currently available R packages.  Just select "stab" from the list and click "OK" to start installation.  Then it's done!  If you want to upgrade from
previous version of stab for R when a new version is released, please go the menu and click "Packages", and then select "Update packages...".  then select a CRAN mirror site near you and click "OK".  Done!  Pretty easy to upgrade.  If you're running Linux PC or Mac OS X, you may not see the menu but the R Console.  You can read this R Installation and Administration (pdf ) for detailed information.  You can also type help("INSTALL") or help("install.packages") in R Console for information on how to install packages from this directory.  Don't worry about this. You only need to do this once.  After these installation, you now can run stab by simply typing "library(stab) (enter)" under R Console.

Remove stab for R: Simply go to the directory of R where you installed and then go to the sub-directory of /library, delete stab.

Methods:: 
This package includes two steps.  In the first step, Decision Tree for Data Evaluation follows "Appendix A" of ICH guideline "Q1E Evaluation for Stability Data" that assists users evaluating stability data and guide users to consider doing an extrapolation for a proposed retest period or shelf life. 
In the second step, Statistical Approaches to Stability Data Analysis is conducted for two different situations.  First one is for a single batchThis approach estimates the retest period or shelf life for a single batch of drug product.  The relationship between residuals and time is assumed to be linear.  Two-sided 95 % confidence intervals of the regression line for residuals (% relative to the original amount) of a drug product intersect with upper and lower acceptance criteria of label claimed.  Then, the shortest one is the shelf life.  When there are multiple batches (e.g. 3 batched) available,  analysis of covariance (ANCOVA) is first employed to test the difference in slopes and intercepts of the regression lines with different factors (packages, dosage forms, etc.).  Then, based on the statistical results, there can be three possibilities. (1).  slope (P>=0.25) and intercept (P>=0.25): the tests for equality of slopes and equality of intercepts are all no differences.  The data from all batches then should be combined.  Then, a single retest period or shelf life is estimated from the combined data. (2).  slope (P>=0.25) and intercept (P<0.25): the test rejects the hypothesis of equality of intercepts but fails to reject the hypothesis with that all slopes are equal.  The data should be combined to estimate the common slope.  The retest periods or shelf lives for individual batches can be estimated.  Then, the shortest estimate among batches should be chosen as the shelf life for all batches. (3).  [slope (P<0.25) and intercept (P>=0.25)] or [slope (P<0.25) and intercept (P<0.25)]: the result in this scenario shows that the test rejects the hypothesis of equality of all slopes.  It is not appropriate to combine the data from all batches in this situation.  The retest periods or shelf lives for individual batches is estimated.  Then, the shortest estimate among batches should be chosen as the shelf life for all batches. Please note the "batch" should be numerical ONLY (e.g., 1, 2, 3...) as the following example; otherwise, it may cause error.



Cross Validation with FDA provided SAS Stability
programs:  Please check with this .pdf file and use bookmarks to browse this pdf file. Please note that in SAS output, the lines for the upper and lower ranges were drawn between 90% and 110% (set as default). We did not change that (should be in the file - stab.dat marked with '/* line B */'), though we used different ranges; however, they would not affect the final results. They were just like marks over there.


Note: Please use "PageUP"/"PageDown" keys to switch plots back and forth on the graphic window of R.

Sample output file

------------------ stab for R v0.1.2 -------------------

 developed by Hsin-ya Lee and Yung-jin Lee, 2007-2010.

 generated on Thu Nov 18 08:27:04 2010 


-- --- List of input data --- --

   batch time assay (%)
1      1    0      99.2
2      1    3      97.1
3      1    6      96.1
4      1    9      95.2
5      1   12      93.8
6      1   18      93.1
7      1   24      92.4
8      2    0      98.7
9      2    3      97.0
10     2    6      96.2
11     2    9      95.1
12     2   12      94.2
13     2   18      93.3
14     3    0     102.5
15     3    3      98.9
16     3    6      97.1
17     3    9      95.6
18     3   12      94.1
19     3   18      93.1


 Analysis settings for multiple batches:
 ---------------------------------------------
 The lower acceptance limit is set to 90 %.

--Output: ANCOVA model: batch vs. time vs. assay (%)--


Analysis of Variance Table

Response: assay
           Df Sum Sq Mean Sq  F value    Pr(>F)    
batch       2  8.683   4.342   5.4055   0.01957 *  
time        1 94.715  94.715 117.9215 6.859e-08 ***
batch:time  2  8.101   4.051   5.0432   0.02392 *  
Residuals  13 10.442   0.803                       
---
Signif. codes:  0 .***・ 0.001 .**・ 0.01 .*・ 0.05 ..・ 0.1 . ・ 1 


       Type   P values
1 Intercept 0.01956915
2     Slope 0.02392274
--------------------------
at a sig. level of 0.25.

--------------------------------------------------------------------------
          -- ANCOVA Output: Testing for poolability of batches --         
--------------------------------------------------------------------------
                                                                          
 The test rejects the hypothesis of equality of slopes (there is a        
 significant difference in slopes and intercepts among batches).          
                                                                          
               --Model #3: one-sided lower LC analysis--                  
        separate intercepts and separate slopes between batches.          
------------------------------------------------------------------------

              --linear regression model: Assay (%) vs. time--             


Call:
lm(formula = assay ~ batch * time, data = ANCOVAdata)

Coefficients:
(Intercept)       batch2       batch3         time  batch2:time  
   98.04611      0.06961      2.86389     -0.26976     -0.02595  
batch3:time  
   -0.23357  

Analysis of Variance Table

Response: assay
           Df Sum Sq Mean Sq  F value    Pr(>F)    
batch       2  8.683   4.342   5.4055   0.01957 *  
time        1 94.715  94.715 117.9215 6.859e-08 ***
batch:time  2  8.101   4.051   5.0432   0.02392 *  
Residuals  13 10.442   0.803                       
---
Signif. codes:  0 .***・ 0.001 .**・ 0.01 .*・ 0.05 ..・ 0.1 . ・ 1 

**************************************************************************
                               -- Output --                               
--------------------------------------------------------------------------
                    --Summary: linear regression model--                



 --- Batch#: 1 ---

Y = 98.0461 +( -0.2697605 ) X


  Time Observed assay(%) Calculated assay(%)   Residuals
1    0              99.2            98.04611 -1.15389222
2    3              97.1            97.23683  0.13682635
3    6              96.1            96.42754  0.32754491
4    9              95.2            95.61826  0.41826347
5   12              93.8            94.80898  1.00898204
6   18              93.1            93.19042  0.09041916
7   24              92.4            91.57186 -0.82814371


 --- Batch#: 2 ---

Y = 98.11571 +( -0.2957143 ) X


  Time Observed assay(%) Calculated assay(%)  Residuals
1    0              98.7            98.11571 -0.5842857
2    3              97.0            97.22857  0.2285714
3    6              96.2            96.34143  0.1414286
4    9              95.1            95.45429  0.3542857
5   12              94.2            94.56714  0.3671429
6   18              93.3            92.79286 -0.5071429


 --- Batch#: 3 ---

Y = 100.91 +( -0.5033333 ) X


  Time Observed assay(%) Calculated assay(%) Residuals
1    0             102.5              100.91     -1.59
2    3              98.9               99.40      0.50
3    6              97.1               97.89      0.79
4    9              95.6               96.38      0.78
5   12              94.1               94.87      0.77
6   18              93.1               91.85     -1.25


**************************************************************************
                       -- Summary and plots --                            
--------------------------------------------------------------------------


                     One-sided lower LC analysis                        

   batch#   shelf life*
1       1      24.93071
2       2      23.46921
3       3      17.58738
-------------------------
*: estimated shelf life



   time      fit    Lower
1     0 98.04611 97.01794
2     1 97.77635 96.81025
3     2 97.50659 96.59983
4     3 97.23683 96.38611
5     4 96.96707 96.16839
6     5 96.69731 95.94584
7     6 96.42754 95.71750
8     7 96.15778 95.48230
9     8 95.88802 95.23915
10    9 95.61826 94.98703
11   10 95.34850 94.72519
12   11 95.07874 94.45326
13   12 94.80898 94.17134
14   13 94.53922 93.87998
15   14 94.26946 93.58008
16   15 93.99970 93.27268
17   16 93.72994 92.95889
18   17 93.46018 92.63974
19   18 93.19042 92.31613
20   19 92.92066 91.98884
21   20 92.65090 91.65851
22   21 92.38114 91.32566
23   22 92.11138 90.99071
24   23 91.84162 90.65402
25   24 91.57186 90.31585
26   25 91.30210 89.97645
27   26 91.03234 89.63598
28   27 90.76257 89.29462
29   28 90.49281 88.95247
30   29 90.22305 88.60966
31   30 89.95329 88.26626
32   31 89.68353 87.92234
33   32 89.41377 87.57798
34   33 89.14401 87.23322
35   34 88.87425 86.88811
36   35 88.60449 86.54268
37   36 88.33473 86.19697
38   37 88.06497 85.85101
39   38 87.79521 85.50483
40   39 87.52545 85.15844
41   40 87.25569 84.81187
42   41 86.98593 84.46512
43   42 86.71617 84.11823
44   43 86.44641 83.77119
45   44 86.17665 83.42403
46   45 85.90689 83.07674
47   46 85.63713 82.72935
48   47 85.36737 82.38186
49   48 85.09760 82.03428
   time      fit    Lower
1     0 98.11571 97.40949
2     1 97.82000 97.16947
3     2 97.52429 96.92621
4     3 97.22857 96.67878
5     4 96.93286 96.42597
6     5 96.63714 96.16633
7     6 96.34143 95.89817
8     7 96.04571 95.61985
9     8 95.75000 95.33009
10    9 95.45429 95.02842
11   10 95.15857 94.71531
12   11 94.86286 94.39204
13   12 94.56714 94.06026
14   13 94.27143 93.72163
15   14 93.97571 93.37764
16   15 93.68000 93.02947
17   16 93.38429 92.67806
18   17 93.08857 92.32411
19   18 92.79286 91.96817
20   19 92.49714 91.61063
21   20 92.20143 91.25181
22   21 91.90571 90.89194
23   22 91.61000 90.53123
24   23 91.31429 90.16980
25   24 91.01857 89.80778
26   25 90.72286 89.44525
27   26 90.42714 89.08230
28   27 90.13143 88.71898
29   28 89.83571 88.35535
30   29 89.54000 87.99144
31   30 89.24429 87.62729
32   31 88.94857 87.26293
33   32 88.65286 86.89839
34   33 88.35714 86.53368
35   34 88.06143 86.16883
36   35 87.76571 85.80384
37   36 87.47000 85.43874
38   37 87.17429 85.07353
39   38 86.87857 84.70822
40   39 86.58286 84.34283
41   40 86.28714 83.97735
42   41 85.99143 83.61181
43   42 85.69571 83.24620
44   43 85.40000 82.88053
45   44 85.10429 82.51480
46   45 84.80857 82.14902
47   46 84.51286 81.78320
48   47 84.21714 81.41733
49   48 83.92143 81.05142
   time       fit    Lower
1     0 100.91000 99.09266
2     1 100.40667 98.73266
3     2  99.90333 98.36430
4     3  99.40000 97.98520
5     4  98.89667 97.59229
6     5  98.39333 97.18177
7     6  97.89000 96.74936
8     7  97.38667 96.29077
9     8  96.88333 95.80277
10    9  96.38000 95.28410
11   10  95.87667 94.73602
12   11  95.37333 94.16177
13   12  94.87000 93.56562
14   13  94.36667 92.95187
15   14  93.86333 92.32430
16   15  93.36000 91.68599
17   16  92.85667 91.03933
18   17  92.35333 90.38614
19   18  91.85000 89.72781
20   19  91.34667 89.06538
21   20  90.84333 88.39965
22   21  90.34000 87.73125
23   22  89.83667 87.06064
24   23  89.33333 86.38820
25   24  88.83000 85.71424
26   25  88.32667 85.03898
27   26  87.82333 84.36262
28   27  87.32000 83.68532
29   28  86.81667 83.00721
30   29  86.31333 82.32840
31   30  85.81000 81.64896
32   31  85.30667 80.96899
33   32  84.80333 80.28853
34   33  84.30000 79.60765
35   34  83.79667 78.92640
36   35  83.29333 78.24481
37   36  82.79000 77.56291
38   37  82.28667 76.88074
39   38  81.78333 76.19832
40   39  81.28000 75.51568
41   40  80.77667 74.83284
42   41  80.27333 74.14981
43   42  79.77000 73.46661
44   43  79.26667 72.78326
45   44  78.76333 72.09976
46   45  78.26000 71.41613
47   46  77.75667 70.73238
48   47  77.25333 70.04852
49   48  76.75000 69.36455
------------------------------------------------------------------
                                                                  
 Drug product with lower acceptance limit of 90 % of label claim
 Shelf life = 17 (months/weeks)                        

******************************************************************