DoseResponse / drc

Fitting dose-response models in R
https://doseresponse.github.io/drc/
21 stars 16 forks source link

Unexpectedly large LL.4 curve fit 'e' coefficients #4

Open khughitt opened 5 years ago

khughitt commented 5 years ago

Greetings,

I recently used drc to fit four parameter log-logistic models for some drug screen data. I noticed that in some cases, drc produces fits with very large values for the e parameter.

For example:

library(drc)

dose <- c(0.00078, 0.00234, 0.00702, 0.02107, 0.06321, 0.18964, 0.56893,                                          
          1.70678, 5.12033, 15.36098, 46.08295) 

response <- c(74.57337, 81.2668, 80.63771, 75.96445, 76.54648, 77.78535, 75.041, 74.92435,
              80.92873, 86.97225, 72.90051)

coef(drm(response ~ dose, fct = LL.4()))

# b:(Intercept)  c:(Intercept)  d:(Intercept)  e:(Intercept) 
# -1.695223e-03   1.091111e+01   2.876129e+02  2.244011e+291 

That is the most extreme example, but there appears to be a continuous distribution of larger-than-expected values.

Out of ~89,000 curves fit, 3,589 had values outside of the range of values (>~115) produced by a different tool (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3040458/).

Of those 3,589 values, many are "close" (but still well outside of) the expected range, while a fair number of many orders of magnitude larger than expected:

> quantile(outliers)
           0%           25%           50%           75%          100%                                     
 1.170338e+02  1.437558e+02  3.122357e+02  3.698680e+05 4.854230e+290  

Session Info

R version 3.5.1 (2018-07-02)                                                                              
Platform: x86_64-pc-linux-gnu (64-bit)                                                                    
Running under: Arch Linux                                                                                 

Matrix products: default                                                                                  
BLAS: /usr/lib/libblas.so.3.8.0                                                                           
LAPACK: /usr/lib/liblapack.so.3.8.0                                                                       

locale:                                                                                                   
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8                            
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8                        
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C                                   
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C                            

attached base packages:                                                                                   
[1] stats     graphics  grDevices utils     datasets  methods   base                                  

other attached packages:                                                                              
[1] drc_3.0-1      MASS_7.3-50    nvimcom_0.9-75 colorout_1.2-0                                       

loaded via a namespace (and not attached):                                                            
 [1] zip_1.0.0          Rcpp_0.12.19       cellranger_1.1.0   pillar_1.3.0       compiler_3.5.1    
 [6] BiocManager_1.30.3 forcats_0.3.0      tools_3.5.1        tibble_1.4.2       lattice_0.20-35   
[11] pkgconfig_2.0.2    rlang_0.3.0.1      openxlsx_4.1.0     Matrix_1.2-14      curl_3.2          
[16] mvtnorm_1.0-8      haven_1.1.2        rio_0.5.10         gtools_3.8.1       hms_0.4.2                
[21] grid_3.5.1         data.table_1.11.8  plotrix_3.7-4      readxl_1.1.0       survival_2.42-3   
[26] foreign_0.8-70     multcomp_1.4-8     TH.data_1.0-9      carData_3.0-2      car_3.0-2         
[31] magrittr_1.5       scales_1.0.0       codetools_0.2-15   splines_3.5.1      abind_1.4-5              
[36] colorspace_1.3-2   sandwich_2.5-0     munsell_0.5.0      crayon_1.3.4       zoo_1.8-4