Coder Social home page Coder Social logo

drc's People

Contributors

bjreisman avatar christian-ritz avatar daniel-gerhard avatar onofriandreapg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drc's Issues

`predict` not returning confidence intervals for `NEC.3()` model

Is this potentially a bug or is it intended behaviour?

I noticed that the spinach.model1 example in ?predict.drc returns a matrix with the credible intervals

> library(drc)
> spinach_model1_ll4 <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = LL.4())
> predict(spinach_model1_ll4, data.frame(dose=2, CURVE=c("1", "2", "3")),
          interval = "confidence")
     Prediction     Lower     Upper
[1,]  0.9048476 0.8552178 0.9544775
[2,]  0.4208307 0.3626741 0.4789873
[3,]  0.5581673 0.4971838 0.6191509
Warning messages:
1: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

2: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

3: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

But as soon as I use NEC.3() for the model, it only returns what I think is the mean?

> spinach_model1_nec3 <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = NEC.3())
> predict(spinach_model1_nec3)
  [1] 1.534025e+00 1.534025e+00 1.534025e+00 1.396653e+00 1.396653e+00
  [6] 1.396653e+00 1.159464e+00 1.159464e+00 1.159464e+00 6.613781e-01
 [11] 6.613781e-01 6.613781e-01 1.231237e-01 1.231237e-01 1.231237e-01
 [16] 7.943600e-04 7.943600e-04 7.943600e-04 2.130037e-10 2.130037e-10
 [21] 2.130037e-10 8.254612e-01 8.254612e-01 8.254612e-01 7.073317e-01
 [26] 7.073317e-01 7.073317e-01 5.206644e-01 5.206644e-01 5.206644e-01
 [31] 2.066325e-01 2.066325e-01 2.066325e-01 1.298029e-02 1.298029e-02
 [36] 1.298029e-02 3.217671e-06 3.217671e-06 3.217671e-06 4.889130e-17
 [41] 4.889130e-17 4.889130e-17 9.281359e-01 9.281359e-01 9.281359e-01
 [46] 9.088835e-01 9.088835e-01 9.088835e-01 8.546830e-01 8.546830e-01
 [51] 8.546830e-01 6.692668e-01 6.692668e-01 6.692668e-01 2.502354e-01
 [56] 2.502354e-01 2.502354e-01 4.917835e-03 4.917835e-03 4.917835e-03
 [61] 7.315787e-10 7.315787e-10 7.315787e-10 2.124491e+00 2.124491e+00
 [66] 2.124491e+00 2.124491e+00 2.124491e+00 2.124491e+00 2.124491e+00
 [71] 2.124491e+00 2.124491e+00 1.703807e+00 1.703807e+00 1.703807e+00
 [76] 7.583491e-01 7.583491e-01 7.583491e-01 4.461082e-02 4.461082e-02
 [81] 4.461082e-02 1.361222e-05 1.361222e-05 1.361222e-05 1.773046e+00
 [86] 1.773046e+00 1.773046e+00 1.773046e+00 1.773046e+00 1.773046e+00
 [91] 1.773046e+00 1.773046e+00 1.773046e+00 1.413257e+00 1.413257e+00
 [96] 1.413257e+00 6.522470e-01 6.522470e-01 6.522470e-01 4.355921e-02
[101] 4.355921e-02 4.355921e-02 1.909801e-05 1.909801e-05 1.909801e-05
Warning message:
In sqrt(diag(varMat)) : NaNs produced

My specs are:

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
[1] drc_3.0-1   MASS_7.3-54

loaded via a namespace (and not attached):
 [1] zip_2.1.1         Rcpp_1.0.7        cellranger_1.1.0  pillar_1.6.2     
 [5] compiler_4.1.1    forcats_0.5.1     tools_4.1.1       lifecycle_1.0.0  
 [9] tibble_3.1.4      lattice_0.20-44   pkgconfig_2.0.3   rlang_0.4.11     
[13] Matrix_1.3-4      openxlsx_4.2.3    curl_4.3.2        mvtnorm_1.1-2    
[17] haven_2.4.3       rio_0.5.26        vctrs_0.3.8       gtools_3.9.2     
[21] hms_1.1.0         grid_4.1.1        data.table_1.14.0 R6_2.5.1         
[25] plotrix_3.8-2     fansi_0.5.0       readxl_1.3.1      survival_3.2-11  
[29] foreign_0.8-81    multcomp_1.4-17   TH.data_1.0-10    carData_3.0-4    
[33] car_3.0-10        magrittr_2.0.1    scales_1.1.1      codetools_0.2-18 
[37] ellipsis_0.3.2    splines_4.1.1     abind_1.4-5       colorspace_2.0-2 
[41] sandwich_3.0-1    utf8_1.2.2        stringi_1.7.4     munsell_0.5.0    
[45] crayon_1.4.1      zoo_1.8-9        

`predict` uses depreciated array recycling

> library(drc)
> spinach.model1 <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = LL.4())
> predict(spinach.model1, data.frame(dose=2, CURVE=c("1", "2", "3")), 
+         interval = "confidence")
     Prediction     Lower     Upper
[1,]  0.9048476 0.8552178 0.9544775
[2,]  0.4208307 0.3626741 0.4789873
[3,]  0.5581673 0.4971838 0.6191509
Warning messages:
1: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

2: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

3: In (tquan * sqrt(varVal + sumObjRV)) * c(-1, 1) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Relevant SessionInfo:

R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.5.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C         
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.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-51.5

loaded via a namespace (and not attached):
 [1] zip_2.1.1         Rcpp_1.0.4        cellranger_1.1.0 
 [4] pillar_1.4.7      compiler_3.6.3    forcats_0.5.0    
 [7] tools_3.6.3       lifecycle_0.2.0   tibble_3.0.4     
[10] lattice_0.20-38   pkgconfig_2.0.3   rlang_0.4.9      
[13] openxlsx_4.2.3    Matrix_1.2-18     rstudioapi_0.13  
[16] curl_4.3          mvtnorm_1.1-1     haven_2.2.0      
[19] rio_0.5.16        vctrs_0.3.5       gtools_3.8.2     
[22] hms_0.5.3         grid_3.6.3        data.table_1.12.8
[25] R6_2.5.0          plotrix_3.7-8     readxl_1.3.1     
[28] survival_3.1-8    foreign_0.8-75    multcomp_1.4-15  
[31] TH.data_1.0-10    carData_3.0-4     car_3.0-10       
[34] magrittr_2.0.1    scales_1.1.0      codetools_0.2-16 
[37] ellipsis_0.3.1    splines_3.6.3     rsconnect_0.8.16 
[40] abind_1.4-5       colorspace_1.4-1  sandwich_3.0-0   
[43] stringi_1.5.3     munsell_0.5.0     crayon_1.3.4     
[46] zoo_1.8-8   

CRAN release?

Dear drc developers,

I noticed that the CRAN version (3.0-1) is quite outdated, compare to the github version (3.2.0).
Are there any plans for a new CRAN release?

Methods not found

Some methods are defined in the namespace but the code cannot be found.
The package fails to install.

Error from ED function with sandwich

I am running the code in example 1 from slides of 'Advances in dose-response analysis' presented at 'useR! Toulouse, July 12 2019'.

the code I am running are:

library(drc)
selenium.LL.2.1 <- drm(dead/total ~ conc, curveid = type, weights = total, data = selenium, fct = LL.2(), type = "binomial")

library(sandwich)
ED(selenium.LL.2.1, c(50), interval = "delta", vcov. = sandwich)

received the message:
Error in UseMethod("estfun") :
no applicable method for 'estfun' applied to an object of class "drc"

session information

sessionInfo(package = c('drc','sandwich')) says:

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
character(0)

other attached packages:
[1] drc_3.0-6 sandwich_2.5-2

Please help!

How to find self-starting routine code for W2.2()?

Hello, I am using drm() with self-starter function W2.2() to fit my data, and interested to learn how W2.2() searches for the starting values. I have read a lot online, but couldn't find the code of W2.2(). Can you please point me to the correct location or paste the code here?

Thank you very much! I am looking forward to your response!

issues with boxcox and functional programmming

Hi!

First of all, thank you so much for this package, it is a must-have tool for all of us in the tox world.

I just came across an issue when trying to use drm() and boxcox() in a functional programming framework via PURRR. Here is a repex:

library(drc)
library(tidyverse)

alba_m1 <- S.alba %>% 
  group_by(Herbicide) %>% 
  nest() %>% 
  mutate(fit = map(.x = data, ~ drm(DryMatter~Dose, data = .x, fct = LL.4())
                   ))

alba_m2 <- S.alba %>% 
  group_by(Herbicide) %>% 
  nest() %>% 
  mutate(fit = map(.x = data, ~ drm(DryMatter~Dose, data = .x, fct = LL.4())),
         bc_fit = map(.x = fit, ~ boxcox(.x)))

alba_m3 <- S.alba %>% 
  group_by(Herbicide) %>% 
  nest() %>% 
  mutate(fit = map(.x = data, ~ boxcox(drm(DryMatter~Dose, data = .x, fct = LL.4()))
  ))


alba_m4a <- boxcox(drm(DryMatter~Dose, data = alba_m1$data[[1]], fct = LL.4()))
alba_m4b <- boxcox(drm(DryMatter~Dose, data = alba_m1$data[[2]], fct = LL.4()))

When used this way (a workflow that is becoming more and more common), alba_m1 works just fine, but alba_m2 and m3 fail at the boxcox step.

when run outside the map(), with the individual data subsets (as in alba_m4a and m4b) the boxcox works perfectly.

My current hypothesis as to what could be happening is that boxcox() fails to update the drc object. What i believe is happening is that the $call is stored in reference to the internal map() call, (e.g. "drm(formula = DryMatter ~ Dose, data = .x, fct = LL.4())") making it impossible for the update.drc() used by boxcox() to actually use it, even when nested inside the same map() (which should still give boxcox access to ".x"

Obviously, that update() part of boxplot is one of the main aspects, so i don't know if there is much room to change it. My request perhaps is to offer the possibility to run a boxcox = TRUE inside of the drm() call as it seems it was the case with the old multdrc(). perhaps that way the whole process can be run at once inside of a map().

I do know that drm() offers the option to run a boxcox transformation, but the way i understand it right now, you need to specify the lambda, instead of letting it choose the optimal. please correct me if i am wrong.

Also, i do know that you could run this simple example as it is presented in the help documents by telling drm() what the groups are instead of going the group_by - nest - map route. This is just a repex, the actual case where i came across this issue is a much more complex situation that would be hard to approach that way.

Thank you in advance!

Same data but different results when using `drm()` on different OSs

Hi there,

I'd like to highlight some differences that I found when running the drm() function on my Mac (Processor 2.6 GHz 6-Core Intel Core i7) vs an Amazon Linux machine.

I attached the example dataset input_data.txt.

Example:

input_data = read.table(file.path(here(), "tests/test-data/input_data.txt"))
drm(response ~ dose, data = input_data, fct = L.4())

Results from my Mac

Model fitted: Logistic (ED50 as parameter) (4 parms)

Parameter estimates:

                 Estimate  Std. Error t-value   p-value    
b:(Intercept) -2.3306e-01  7.0496e-01 -0.3306 0.7434100    
c:(Intercept)  4.4357e+05  1.3346e+05  3.3236 0.0024854 ** 
d:(Intercept)  1.3001e+06  3.2732e+05  3.9720 0.0004529 ***
e:(Intercept)  5.2777e+01  1.2060e+01  4.3763 0.0001521 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

 654792.8 (28 degrees of freedom)

When running on an Amazon Linux machine:

Model fitted: Logistic (ED50 as parameter) (4 parms)
--
  |  
  | Parameter estimates:
  |  
  | Estimate  Std. Error t-value   p-value
  | b:(Intercept) -2.3552e-01  7.2686e-01 -0.3240 0.7483338
  | c:(Intercept)  4.4373e+05  1.3397e+05  3.3122 0.0025592 **
  | d:(Intercept)  1.2999e+06  3.2735e+05  3.9711 0.0004540 ***
  | e:(Intercept)  5.2747e+01  1.2068e+01  4.3709 0.0001543 ***
  | ---
  | Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  |  
  | Residual standard error:
  |  
  | 654788.4 (28 degrees of freedom)

All the estimates are slightly but I believe not negligibly different.
Do you have any insights into how I can improve the reproducibility of the results?
Thanks for all your work and your help,

Anna

Why do we need `curveid` argument of the `drm()` function?

Dear Team,

I have a question regarding curveid parameter of the drm() function.
In which cases do we have to use this argument? Should it be distinct groups like different species or different treatments/conditions or should it be more or less similar groups like biological replicates/different individuals?

The existing documentation is not clear enough, so any comments from you will be really valuable.
Thank you in advance!

Best regards,
Yulia

Namespace export

export divAtInf, xexplogx, xexpx, and xlogx into drc namespace to call functions from medrc

The classes and the names of some functions do not match!

For EXD.2(), EXD.3(), AR.2() and AR.3(), the class of the models specified is "Weibull" (as below)?

For example:
str(EXD.2())
$ fixed : num [1:4] 1 0 NA NA

  • attr(*, "class")= chr "Weibull-1"

I know that Weibull and exponential models are similar. Is it on purpose?

Unexpectedly large LL.4 curve fit 'e' coefficients

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 

MASS import causes name conflicts (e.g. with select function from dplyr)

Dear drc developers,

I like your package very much and use it all the time in my work. Also I enjoy using tidyverse metapackage with its pipelines. But there's an issue that prevents me from using both with comfort.
I can see that you are using MASS package for some calculations. Unfortunately, importing all its functions into user environment can cause name conflicts (e.g. select() function from dplyr). Currently I have to manually detach MASS package to keep working normally with select() from dplyr, or explicitly state dplyr::select(), or use drc functions like drc::drm(formula, data, fct = drc::LL.4() ...) to prevent attaching MASS.
I'd suggest to run MASS functions without attaching them, like MASS::boxcox().

Best regards,
Evgeny

problem in 3-parameter weibull?

I've been using W1.3() and W2.3() to fit a 3-parameter Weibull model to data. drc gives 2 parameterizations of the 3-parameter weibull (https://cran.r-project.org/web/packages/drc/drc.pdf):

f(x) = 0 + (d − 0) exp(− exp(b(log(x) − log(e))))
f(x) = 0 + (d − 0)(1 − exp(− exp(b(log(x) − log(e)))))

The documentation states that d represents the upper asymptote, b is the slope at inflection (maximum of first derivative?), and that the curve has an inflection point at dose e. However, plotting these functions and using R to solve for when the 2nd derivative = 0 gives a value different than e for the inflection point. For example:

dd=1
bb = -5
ee = 30
curve(dd*exp(-exp(bb * (log(x) - log(ee))) ) , xlim=c(0,100))
abline(v=ee)

# 1st deriv
g <- function(x) {}
body(g) <- D( expression(dd*exp(-exp(bb * (log(x) - log(ee))) )), "x")
curve(g, xlim=c(0, 100))
abline(v=ee)

# 2nd deriv
g <- function(x) {}
body(g) <- D(D( expression(dd*exp(-exp(bb * (log(x) - log(ee))) )), "x"), "x")
curve(g, xlim=c(0, 100))
abline(v=ee)

uniroot(g, c(20,50))  # should be 30, but is not?

Is the documentation incorrect that e represents the inflection point? Or is there some other explanation?

predict cannot calculate confidence intervals for models with fixed parameters

Hey there,
I was trying to calculate RNA-seq read saturation and ran into the issue:

  • predict seems to be unable to calculate confidence intervals when using fixed parameters.

Is this related to drm returning a model with 1 less parameter? Or somewhat intended behaviour as a fixed parameter contains no uncertainty?

When using MM.2() kinetics with fixed asymptote:

# input data
> head(sat)
   saturation total_reads
        <num>       <int>
1:  0.1685059      494784
2:  0.2575534     2974401
3:  0.3329197     5445163
4:  0.3980089     7920298
5:  0.4538969    10405968
6:  0.5019354    12884013

> model.drm <- drm(saturation ~ total_reads, data = sat, fct = MM.2(fixed = c(1,NA), names=c("d","e")))
# data to extrapolate and predict confidence intervals to
> mml <- data.frame(reads = seq(0, max(sat$total_reads)*2, length.out = 1000))
> summary(model.drm)
Model fitted: Michaelis-Menten (1 parms)
Parameter estimates:

              Estimate Std. Error t-value   p-value    
e:(Intercept) 11937044     626398  19.057 2.214e-13 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

 0.03482782 (18 degrees of freedom)

# prediction fails with the error below
> pred <- predict(model.drm, newdata = mml, interval = "confidence", level = 0.95)
Error in indexMat[, groupLevels, drop = FALSE] : 
  incorrect number of dimensions

When using MM.2() kinetics with no fixed parameters:

> model.drm <- drm(sat ~ total_reads, data = sat, fct = MM.2())
> summary(model.drm)

Model fitted: Michaelis-Menten (2 parms)

Parameter estimates:

                Estimate Std. Error t-value p-value    
d:(Intercept) 9.9953e-01 1.3612e-02  73.432  <2e-16 ***
e:(Intercept) 1.1920e+07 8.0763e+05  14.759   4e-11 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

 0.03583626 (17 degrees of freedom)

> pred <- predict(model.drm, newdata = mml, interval = "confidence", level = 0.95)
> head(pred)

 Prediction      Lower      Upper
[1,] 0.00000000 0.00000000 0.00000000
[2,] 0.07677375 0.06779986 0.08574764
[3,] 0.14259479 0.12724126 0.15794832
[4,] 0.19965087 0.17974278 0.21955896
[5,] 0.24958346 0.22642738 0.27273955
[6,] 0.29364824 0.26819302 0.31910345

Session Info

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Rocky Linux 9.4 (Blue Onyx)

Matrix products: default
BLAS/LAPACK: FlexiBLAS OPENBLAS;  LAPACK version 3.11.0

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

time zone: Europe/Berlin
tzcode source: system (glibc)

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

other attached packages:
 [1] drc_3.0-1                   MASS_7.3-60.2               pbapply_1.7-2               scales_1.3.0               
 [5] rhdf5_2.48.0                glue_1.7.0                  ggtext_0.1.2                lubridate_1.9.3            
 [9] forcats_1.0.0               stringr_1.5.1               dplyr_1.1.4                 purrr_1.0.2                
[13] readr_2.1.5                 tidyr_1.3.1                 tibble_3.2.1                ggplot2_3.5.1              
[17] tidyverse_2.0.0             DropletUtils_1.24.0         SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0
[21] Biobase_2.64.0              GenomicRanges_1.56.0        GenomeInfoDb_1.40.0         IRanges_2.38.0             
[25] S4Vectors_0.42.0            BiocGenerics_0.50.0         MatrixGenerics_1.16.0       matrixStats_1.3.0          
[29] data.table_1.15.4          

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1          farver_2.1.2              R.utils_2.12.3            TH.data_1.1-2            
 [5] timechange_0.3.0          lifecycle_1.0.4           survival_3.6-4            statmod_1.5.0            
 [9] magrittr_2.0.3            compiler_4.4.0            rlang_1.1.4               tools_4.4.0              
[13] plotrix_3.8-4             utf8_1.2.4                labeling_0.4.3            S4Arrays_1.4.0           
[17] dqrng_0.4.1               DelayedArray_0.30.1       xml2_1.3.6                pkgload_1.3.4            
[21] multcomp_1.4-25           abind_1.4-5               BiocParallel_1.38.0       HDF5Array_1.32.0         
[25] withr_3.0.0               R.oo_1.26.0               grid_4.4.0                fansi_1.0.6              
[29] beachmat_2.20.0           colorspace_2.1-0          Rhdf5lib_1.26.0           edgeR_4.2.0              
[33] gtools_3.9.5              mvtnorm_1.2-4             cli_3.6.3                 crayon_1.5.3             
[37] generics_0.1.3            rstudioapi_0.16.0         httr_1.4.7                tzdb_0.4.0               
[41] DelayedMatrixStats_1.26.0 scuttle_1.14.0            splines_4.4.0             zlibbioc_1.50.0          
[45] parallel_4.4.0            XVector_0.44.0            vctrs_0.6.5               sandwich_3.1-0           
[49] Matrix_1.7-0              jsonlite_1.8.8            carData_3.0-5             car_3.1-2                
[53] hms_1.1.3                 locfit_1.5-9.9            limma_3.60.0              codetools_0.2-20         
[57] stringi_1.8.4             gtable_0.3.5              UCSC.utils_1.0.0          munsell_0.5.1            
[61] pillar_1.9.0              rhdf5filters_1.16.0       GenomeInfoDbData_1.2.12   R6_2.5.1                 
[65] sparseMatrixStats_1.16.0  lattice_0.22-6            R.methodsS3_1.8.2         gridtext_0.1.5           
[69] Rcpp_1.0.12               SparseArray_1.4.3         zoo_1.8-12                pkgconfig_2.0.3          

Best wishes,
Falko

summary(m) does not work with error: Error in solve.default(object$fit$hessian) : Lapack routine dgesv: system is exactly singular: U[1,1] = 0

dataframe <- data.frame(conc=c(0, 0.944, 2.18, 4.14, 8.37, 16.1), total=c(160, 80, 80, 80, 80, 80), response=c(3, 1, 1, 5, 8, 80))

1) summary(m) does not work as below (increasing trend)

m <- drm(response/total ~ conc,
weights=total,
data=dataframe,
fct = W1.4(),
type = "binomial")
plot(m)
summary(m)

**# Error in solve.default(object$fit$hessian) :

Lapack routine dgesv: system is exactly singular: U[1,1] = 0**

2) However, summary(m) works if I model the non-responding fractions (decreasing trend)

m <- drm((total-response)/total ~ conc,
weights=total,
data=dataframe,
fct = W1.4(),
type = "binomial")
plot(m)
summary(m)

Hessian scaling (type = "continuous")

The Hessian is being scaled by twice the residual variance when estimating the variance-covariance matrix for normally distributed responses (e.g., see scaledH on line 80 of vcov.drc.R). This appears to be inconsistent with Eq (5) from Ritz et al. (2005).

could not find function "LL.4"

Hello,

I installed drc version 2.5-12 and I am trying to use drm() but I get the error Error in LL.4() : could not find function "LL.4". Could you please help me with it?

llogistic2 model has no fixed information

I found that llogistic2 model has no fixed information

x = LL2.4(fixed = c(NA, 0, 1, NA))
x$fixed
NULL

fit <- drm(vol ~ conc, data = algae, fct = LL2.4(fixed = c(NA, 0, 200, NA)))
fit$fct$fixed
NULL

In the llogitic2 function, return list does not include "fixed" like in llogistic:

returnList <- list(fct = fct, ssfct = ssfct, names = names,
deriv1 = deriv1, deriv2 = deriv2, derivx = derivx, edfct = edfct,
bfct = bfct, inversion = invfct, name = fctName, text = fctText,
noParm = sum(is.na(fixed)), lowerAs = lowerAs, upperAs = upperAs,
monoton = monoton)

Is this missing intentional? If not, could you please add fixed to returnList?

Thanks!

Error with boxcox transformation

Hi,
Thanks a lot for this amazing package and documentation. I am trying to account for departure from normality and variance homogeneity when fitting a Weibull Type II model on several dose response curves by using a boxcox transformation as shown in the Ritz,. 2012 paper.

The function is able to run and seems to be effective based on diagnostic plots before/after transformation. However, a warning message is sent :
Error in optim(startVec, opfct, hessian = TRUE, method = "L-BFGS-B", lower = lowerLimits, : L-BFGS-B needs finite values of 'fn'

Lambda optimal value seems to be always λ=2 independently of the data, which I suspect comes from this error.

I must precise that I don't have true replicates for any of the concentration and a relatively low number of points (12) per curve. However I have a large number of curves, each of them representing a single individual (60).

Here is my code :
Chicken.W2.3<-drm(mFvFm~meanTemp_hold.adj, data=df_filt_info %>% subset(Site.name=="Chicken"), curveid = Genotype, fct=W2.3(names = c('hill', 'max', 'ed50')),upperl=c(NA,0.9,40),lowerl=c(NA,0.1,30)) Chicken.W2.3.bc=boxcox(Chicken.W2.3,lambda = seq(-2,4,by=0.25))

summary(Chicken.W2.3)

Model fitted: Weibull (type 2) with lower limit at 0 (3 parms)

Parameter estimates:

        Estimate Std. Error  t-value   p-value    

hill:1523 -17.564453 8.518489 -2.0619 0.0397087 *
hill:1512 -14.731103 3.958415 -3.7215 0.0002195 ***
hill:798 -23.705428 6.701404 -3.5374 0.0004401 ***
hill:1528 -8.971746 3.034226 -2.9568 0.0032484 **
hill:799 -23.073299 6.929115 -3.3299 0.0009300 ***
hill:1515 -15.931781 3.649070 -4.3660 1.526e-05 ***
hill:1514 -17.277075 4.086176 -4.2282 2.781e-05 ***
hill:1522 -23.529915 5.373922 -4.3785 1.444e-05 ***
hill:1519 -20.088171 4.075313 -4.9292 1.110e-06 ***
hill:1518 -22.169927 4.768053 -4.6497 4.215e-06 ***
hill:797 -18.115977 5.179171 -3.4979 0.0005090 ***
hill:806 -17.210004 4.745791 -3.6264 0.0003156 ***
hill:1501 -30.566419 19.925163 -1.5341 0.1256193
hill:1504 -21.126029 6.659423 -3.1724 0.0016009 **
hill:1507 -10.237252 2.392683 -4.2786 2.237e-05 ***
hill:1516 -20.369981 4.453983 -4.5734 5.997e-06 ***
hill:999 -59.517291 35.048855 -1.6981 0.0900792 .
hill:1534 -15.499087 4.086902 -3.7924 0.0001666 ***
hill:997 -21.419227 5.390718 -3.9734 8.082e-05 ***
hill:800 -27.293125 8.801219 -3.1011 0.0020323 **
hill:993 -20.543757 4.791741 -4.2873 2.154e-05 ***
hill:802 -17.355629 5.669505 -3.0612 0.0023176 **
hill:1533 -20.677138 4.952235 -4.1753 3.486e-05 ***
hill:1513 -20.923588 4.677666 -4.4731 9.465e-06 ***
hill:991 -15.354623 4.614543 -3.3274 0.0009381 ***
hill:995 -19.330011 5.762926 -3.3542 0.0008537 ***
hill:1524 -30.936977 24.182125 -1.2793 0.2013473
hill:1526 -48.825133 41.920247 -1.1647 0.2446654
hill:1535 -15.310950 4.250495 -3.6022 0.0003457 ***
hill:998 -17.804519 5.723226 -3.1109 0.0019668 **
hill:1532 -12.065920 3.886250 -3.1048 0.0020074 **
hill:956 -20.427318 8.558752 -2.3867 0.0173540 *
hill:1517 -51.248455 42.147868 -1.2159 0.2245638
hill:1531 -12.346202 3.412301 -3.6181 0.0003255 ***
hill:1505 -15.052659 3.908384 -3.8514 0.0001320 ***
hill:803 -20.653777 6.034773 -3.4225 0.0006692 ***
hill:990 -57.583740 37.909734 -1.5190 0.1293744
hill:805 -17.536826 4.016871 -4.3658 1.527e-05 ***
hill:804 -15.950507 3.851578 -4.1413 4.026e-05 ***
hill:987 -18.463429 5.053799 -3.6534 0.0002849 ***
hill:1502 -35.946270 41.788151 -0.8602 0.3900716
hill:1527 -9.863548 3.534892 -2.7903 0.0054575 **
hill:1503 -22.521281 4.943469 -4.5558 6.502e-06 ***
hill:1510 -17.918111 5.264542 -3.4035 0.0007162 ***
hill:1511 -12.527183 4.284945 -2.9235 0.0036108 **
hill:1530 -20.367959 5.365450 -3.7961 0.0001642 ***
hill:992 -20.823543 4.648621 -4.4795 9.194e-06 ***
hill:1529 -12.732994 3.307765 -3.8494 0.0001330 ***
hill:988 -61.138689 35.448117 -1.7247 0.0851656 .
hill:994 -20.086773 5.574165 -3.6035 0.0003439 ***
hill:1520 -30.072543 11.842742 -2.5393 0.0113952 *
hill:1525 -16.548085 4.625996 -3.5772 0.0003796 ***
hill:1000 -21.578482 4.307600 -5.0094 7.480e-07 ***
hill:1508 -8.527051 2.031115 -4.1982 3.162e-05 ***
hill:996 -86.616349 33.939286 -2.5521 0.0109908 *
hill:989 -19.892267 5.844699 -3.4035 0.0007164 ***
hill:1521 -31.475207 10.293496 -3.0578 0.0023440 **
hill:801 -22.219104 5.236290 -4.2433 2.606e-05 ***
hill:1509 -19.056915 3.935031 -4.8429 1.688e-06 ***
hill:1506 -14.260804 3.322402 -4.2923 2.107e-05 ***
max:1523 0.499006 0.024754 20.1584 < 2.2e-16 ***
max:1512 0.561418 0.026245 21.3912 < 2.2e-16 ***
max:798 0.605336 0.021523 28.1256 < 2.2e-16 ***
max:1528 0.576645 0.038080 15.1431 < 2.2e-16 ***
max:799 0.639159 0.022560 28.3315 < 2.2e-16 ***
max:1515 0.592453 0.025855 22.9145 < 2.2e-16 ***
max:1514 0.609307 0.025090 24.2846 < 2.2e-16 ***
max:1522 0.581084 0.025574 22.7212 < 2.2e-16 ***
max:1519 0.587608 0.025903 22.6853 < 2.2e-16 ***
max:1518 0.535929 0.025752 20.8113 < 2.2e-16 ***
max:797 0.614098 0.024953 24.6099 < 2.2e-16 ***
max:806 0.611887 0.026259 23.3018 < 2.2e-16 ***
max:1501 0.589201 0.026793 21.9909 < 2.2e-16 ***
max:1504 0.555444 0.023178 23.9646 < 2.2e-16 ***
max:1507 0.572616 0.031457 18.2030 < 2.2e-16 ***
max:1516 0.586710 0.025607 22.9123 < 2.2e-16 ***
max:999 0.618902 0.020989 29.4864 < 2.2e-16 ***
max:1534 0.612380 0.025003 24.4919 < 2.2e-16 ***
max:997 0.573723 0.026441 21.6980 < 2.2e-16 ***
max:800 0.590666 0.021815 27.0767 < 2.2e-16 ***
max:993 0.583774 0.024503 23.8248 < 2.2e-16 ***
max:802 0.592841 0.026209 22.6197 < 2.2e-16 ***
max:1533 0.559007 0.025346 22.0549 < 2.2e-16 ***
max:1513 0.561435 0.025413 22.0921 < 2.2e-16 ***
max:991 0.603136 0.029318 20.5720 < 2.2e-16 ***
max:995 0.618217 0.023429 26.3874 < 2.2e-16 ***
max:1524 0.607571 0.021017 28.9082 < 2.2e-16 ***
max:1526 0.519936 0.020997 24.7621 < 2.2e-16 ***
max:1535 0.569511 0.025464 22.3657 < 2.2e-16 ***
max:998 0.600423 0.026971 22.2619 < 2.2e-16 ***
max:1532 0.588578 0.025544 23.0413 < 2.2e-16 ***
max:956 0.599484 0.024232 24.7396 < 2.2e-16 ***
max:1517 0.556664 0.020991 26.5196 < 2.2e-16 ***
max:1531 0.584390 0.028500 20.5051 < 2.2e-16 ***
max:1505 0.561308 0.025656 21.8781 < 2.2e-16 ***
max:803 0.580360 0.025076 23.1440 < 2.2e-16 ***
max:990 0.602285 0.022267 27.0485 < 2.2e-16 ***
max:805 0.633366 0.025993 24.3671 < 2.2e-16 ***
max:804 0.636555 0.026074 24.4132 < 2.2e-16 ***
max:987 0.638252 0.026476 24.1065 < 2.2e-16 ***
max:1502 0.577257 0.021008 27.4777 < 2.2e-16 ***
max:1527 0.502192 0.034127 14.7155 < 2.2e-16 ***
max:1503 0.634007 0.025702 24.6675 < 2.2e-16 ***
max:1510 0.580406 0.025521 22.7427 < 2.2e-16 ***
max:1511 0.512531 0.026752 19.1584 < 2.2e-16 ***
max:1530 0.574783 0.023204 24.7707 < 2.2e-16 ***
max:992 0.573273 0.025904 22.1307 < 2.2e-16 ***
max:1529 0.598324 0.028260 21.1721 < 2.2e-16 ***
max:988 0.594199 0.022237 26.7208 < 2.2e-16 ***
max:994 0.617232 0.024698 24.9911 < 2.2e-16 ***
max:1520 0.566154 0.022246 25.4492 < 2.2e-16 ***
max:1525 0.560179 0.026400 21.2190 < 2.2e-16 ***
max:1000 0.625044 0.025416 24.5926 < 2.2e-16 ***
max:1508 0.638145 0.052030 12.2651 < 2.2e-16 ***
max:996 0.618035 0.020953 29.4968 < 2.2e-16 ***
max:989 0.600721 0.027952 21.4909 < 2.2e-16 ***
max:1521 0.510128 0.027251 18.7197 < 2.2e-16 ***
max:801 0.548662 0.025623 21.4125 < 2.2e-16 ***
max:1509 0.593231 0.025698 23.0846 < 2.2e-16 ***
max:1506 0.571380 0.026728 21.3775 < 2.2e-16 ***
ed50:1523 36.767942 0.578049 63.6070 < 2.2e-16 ***
ed50:1512 35.741915 0.445046 80.3106 < 2.2e-16 ***
ed50:798 36.580575 0.306711 119.2671 < 2.2e-16 ***
ed50:1528 35.521479 0.748981 47.4264 < 2.2e-16 ***
ed50:799 36.418127 0.341971 106.4947 < 2.2e-16 ***
ed50:1515 35.530633 0.388217 91.5227 < 2.2e-16 ***
ed50:1514 36.061960 0.380698 94.7259 < 2.2e-16 ***
ed50:1522 35.565832 0.379659 93.6783 < 2.2e-16 ***
ed50:1519 35.336718 0.349982 100.9673 < 2.2e-16 ***
ed50:1518 35.193287 0.351285 100.1845 < 2.2e-16 ***
ed50:797 36.260647 0.408771 88.7066 < 2.2e-16 ***
ed50:806 36.216726 0.427410 84.7353 < 2.2e-16 ***
ed50:1501 35.984544 0.896987 40.1171 < 2.2e-16 ***
ed50:1504 36.398551 0.392581 92.7161 < 2.2e-16 ***
ed50:1507 35.081923 0.579652 60.5224 < 2.2e-16 ***
ed50:1516 35.706923 0.374473 95.3524 < 2.2e-16 ***
ed50:999 36.881811 0.254116 145.1376 < 2.2e-16 ***
ed50:1534 36.237764 0.451425 80.2741 < 2.2e-16 ***
ed50:997 35.846452 0.436778 82.0702 < 2.2e-16 ***
ed50:800 36.259472 0.370515 97.8624 < 2.2e-16 ***
ed50:993 35.990069 0.370290 97.1942 < 2.2e-16 ***
ed50:802 36.157616 0.480121 75.3094 < 2.2e-16 ***
ed50:1533 35.760774 0.387403 92.3089 < 2.2e-16 ***
ed50:1513 35.554802 0.364493 97.5459 < 2.2e-16 ***
ed50:991 36.359135 0.525088 69.2439 < 2.2e-16 ***
ed50:995 36.576517 0.364259 100.4136 < 2.2e-16 ***
ed50:1524 36.862703 0.415135 88.7968 < 2.2e-16 ***
ed50:1526 36.720234 0.539683 68.0404 < 2.2e-16 ***
ed50:1535 36.088317 0.484100 74.5473 < 2.2e-16 ***
ed50:998 36.300174 0.465232 78.0260 < 2.2e-16 ***
ed50:1532 36.926388 0.536166 68.8712 < 2.2e-16 ***
ed50:956 36.549492 0.435006 84.0207 < 2.2e-16 ***
ed50:1517 36.750788 0.449626 81.7364 < 2.2e-16 ***
ed50:1531 35.595219 0.497707 71.5184 < 2.2e-16 ***
ed50:1505 36.065605 0.450026 80.1411 < 2.2e-16 ***
ed50:803 36.034373 0.432715 83.2752 < 2.2e-16 ***
ed50:990 37.083351 0.260990 142.0870 < 2.2e-16 ***
ed50:805 35.979165 0.388678 92.5680 < 2.2e-16 ***
ed50:804 36.130976 0.405553 89.0907 < 2.2e-16 ***
ed50:987 36.183924 0.416575 86.8604 < 2.2e-16 ***
ed50:1502 36.542293 0.896664 40.7536 < 2.2e-16 ***
ed50:1527 35.655551 0.766186 46.5364 < 2.2e-16 ***
ed50:1503 35.809500 0.369642 96.8761 < 2.2e-16 ***
ed50:1510 36.293631 0.432788 83.8600 < 2.2e-16 ***
ed50:1511 36.369731 0.576979 63.0347 < 2.2e-16 ***
ed50:1530 36.339981 0.363399 100.0002 < 2.2e-16 ***
ed50:992 35.684707 0.391926 91.0496 < 2.2e-16 ***
ed50:1529 35.466865 0.469257 75.5809 < 2.2e-16 ***
ed50:988 37.224365 0.182922 203.4982 < 2.2e-16 ***
ed50:994 36.276992 0.391385 92.6888 < 2.2e-16 ***
ed50:1520 36.086934 0.491977 73.3508 < 2.2e-16 ***
ed50:1525 36.088353 0.464797 77.6433 < 2.2e-16 ***
ed50:1000 35.687905 0.343948 103.7596 < 2.2e-16 ***
ed50:1508 33.629502 0.821242 40.9496 < 2.2e-16 ***
ed50:996 37.102049 0.100176 370.3690 < 2.2e-16 ***
ed50:989 36.194736 0.434644 83.2745 < 2.2e-16 ***
ed50:1521 35.580635 0.597806 59.5187 < 2.2e-16 ***
ed50:801 35.669867 0.396216 90.0264 < 2.2e-16 ***
ed50:1509 35.515465 0.360510 98.5144 < 2.2e-16 ***
ed50:1506 35.373542 0.434845 81.3474 < 2.2e-16 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

0.06299986 (523 degrees of freedom)

summary(Chicken.W2.3.bc)

Model fitted: Weibull (type 2) with lower limit at 0 (3 parms)

Parameter estimates:

        Estimate Std. Error  t-value   p-value    

hill:1523 -18.494658 9.573649 -1.9318 0.0539204 .
hill:1512 -14.991701 5.040968 -2.9740 0.0030754 **
hill:798 -28.962301 11.237091 -2.5774 0.0102279 *
hill:1528 -7.213380 2.411312 -2.9915 0.0029073 **
hill:799 -26.253296 8.605156 -3.0509 0.0023975 **
hill:1515 -15.872921 4.775848 -3.3236 0.0009509 ***
hill:1514 -18.521633 4.864064 -3.8079 0.0001568 ***
hill:1522 -23.537381 8.381299 -2.8083 0.0051662 **
hill:1519 -18.410739 5.943897 -3.0974 0.0020570 **
hill:1518 -20.587388 9.110372 -2.2598 0.0242458 *
hill:797 -18.595834 4.909306 -3.7879 0.0001696 ***
hill:806 -16.232345 3.855452 -4.2102 3.003e-05 ***
hill:1501 -28.384744 8.868406 -3.2007 0.0014544 **
hill:1504 -27.819525 14.485461 -1.9205 0.0553365 .
hill:1507 -11.175580 3.184672 -3.5092 0.0004883 ***
hill:1516 -20.696748 6.096816 -3.3947 0.0007393 ***
hill:999 -21.194708 5.053712 -4.1939 3.221e-05 ***
hill:1534 -15.736570 4.536297 -3.4690 0.0005654 ***
hill:997 -19.108879 5.152688 -3.7085 0.0002307 ***
hill:800 -30.210881 12.205186 -2.4752 0.0136301 *
hill:993 -21.971730 6.162031 -3.5657 0.0003962 ***
hill:802 -16.925194 4.855336 -3.4859 0.0005317 ***
hill:1533 -21.052212 6.973166 -3.0190 0.0026596 **
hill:1513 -19.889528 6.635458 -2.9975 0.0028518 **
hill:991 -11.984285 3.489891 -3.4340 0.0006419 ***
hill:995 -21.713689 6.485075 -3.3483 0.0008718 ***
hill:1524 -28.409658 21.389421 -1.3282 0.1846878
hill:1526 -39.674781 77.355447 -0.5129 0.6082453
hill:1535 -15.600412 5.211872 -2.9932 0.0028908 **
hill:998 -15.847823 3.914788 -4.0482 5.942e-05 ***
hill:1532 -12.970556 3.676416 -3.5280 0.0004555 ***
hill:956 -22.415973 10.018491 -2.2375 0.0256767 *
hill:1517 -25.412931 17.670968 -1.4381 0.1509988
hill:1531 -13.130155 4.564014 -2.8769 0.0041802 **
hill:1505 -14.610927 4.172053 -3.5021 0.0005011 ***
hill:803 -22.248500 7.303797 -3.0462 0.0024348 **
hill:990 -48.688431 56.912994 -0.8555 0.3926723
hill:805 -16.564232 3.664197 -4.5206 7.635e-06 ***
hill:804 -14.713957 3.216787 -4.5741 5.978e-06 ***
hill:987 -17.119427 3.711727 -4.6123 5.014e-06 ***
hill:1502 -23.667429 7.816101 -3.0280 0.0025830 **
hill:1527 -8.843092 3.458341 -2.5570 0.0108380 *
hill:1503 -21.909283 5.218006 -4.1988 3.154e-05 ***
hill:1510 -16.915806 4.564498 -3.7060 0.0002330 ***
hill:1511 -12.850610 4.435684 -2.8971 0.0039241 **
hill:1530 -23.608821 7.964521 -2.9642 0.0031726 **
hill:992 -19.491061 5.615323 -3.4710 0.0005613 ***
hill:1529 -12.566362 4.154752 -3.0246 0.0026122 **
hill:988 -16.708487 5.475299 -3.0516 0.0023918 **
hill:994 -20.641451 5.043753 -4.0925 4.942e-05 ***
hill:1520 -30.521082 14.077254 -2.1681 0.0306003 *
hill:1525 -14.689278 4.516849 -3.2521 0.0012194 **
hill:1000 -21.848811 5.763489 -3.7909 0.0001676 ***
hill:1508 -8.008997 2.279820 -3.5130 0.0004815 ***
hill:996 -16.561849 3.714740 -4.4584 1.011e-05 ***
hill:989 -18.842583 4.911378 -3.8365 0.0001400 ***
hill:1521 -27.776907 15.827611 -1.7550 0.0798508 .
hill:801 -22.426992 7.921978 -2.8310 0.0048191 **
hill:1509 -17.354832 5.070621 -3.4226 0.0006688 ***
hill:1506 -13.810033 4.100712 -3.3677 0.0008138 ***
max:1523 0.501389 0.019610 25.5676 < 2.2e-16 ***
max:1512 0.562599 0.018139 31.0158 < 2.2e-16 ***
max:798 0.605590 0.013543 44.7163 < 2.2e-16 ***
max:1528 0.588131 0.032682 17.9956 < 2.2e-16 ***
max:799 0.637916 0.013254 48.1291 < 2.2e-16 ***
max:1515 0.591148 0.017090 34.5908 < 2.2e-16 ***
max:1514 0.606699 0.016510 36.7474 < 2.2e-16 ***
max:1522 0.582713 0.017201 33.8758 < 2.2e-16 ***
max:1519 0.589213 0.017118 34.4205 < 2.2e-16 ***
max:1518 0.536954 0.018716 28.6892 < 2.2e-16 ***
max:797 0.613395 0.015968 38.4145 < 2.2e-16 ***
max:806 0.613446 0.016470 37.2456 < 2.2e-16 ***
max:1501 0.592354 0.016112 36.7655 < 2.2e-16 ***
max:1504 0.553082 0.014970 36.9460 < 2.2e-16 ***
max:1507 0.569727 0.020835 27.3447 < 2.2e-16 ***
max:1516 0.586915 0.017092 34.3388 < 2.2e-16 ***
max:999 0.627707 0.015854 39.5927 < 2.2e-16 ***
max:1534 0.609845 0.016203 37.6386 < 2.2e-16 ***
max:997 0.576728 0.017303 33.3303 < 2.2e-16 ***
max:800 0.591251 0.014001 42.2307 < 2.2e-16 ***
max:993 0.582012 0.016648 34.9602 < 2.2e-16 ***
max:802 0.594135 0.017106 34.7320 < 2.2e-16 ***
max:1533 0.557907 0.018173 30.7001 < 2.2e-16 ***
max:1513 0.560375 0.017929 31.2551 < 2.2e-16 ***
max:991 0.606456 0.019033 31.8639 < 2.2e-16 ***
max:995 0.617313 0.014703 41.9844 < 2.2e-16 ***
max:1524 0.608660 0.013477 45.1641 < 2.2e-16 ***
max:1526 0.521960 0.015670 33.3098 < 2.2e-16 ***
max:1535 0.569236 0.017600 32.3426 < 2.2e-16 ***
max:998 0.603522 0.016769 35.9901 < 2.2e-16 ***
max:1532 0.587966 0.016946 34.6957 < 2.2e-16 ***
max:956 0.598522 0.015826 37.8188 < 2.2e-16 ***
max:1517 0.559652 0.019152 29.2213 < 2.2e-16 ***
max:1531 0.583878 0.018542 31.4903 < 2.2e-16 ***
max:1505 0.561526 0.017900 31.3697 < 2.2e-16 ***
max:803 0.579339 0.017213 33.6565 < 2.2e-16 ***
max:990 0.602732 0.014393 41.8758 < 2.2e-16 ***
max:805 0.634311 0.015877 39.9505 < 2.2e-16 ***
max:804 0.637910 0.015854 40.2354 < 2.2e-16 ***
max:987 0.639869 0.015760 40.6000 < 2.2e-16 ***
max:1502 0.582619 0.017153 33.9670 < 2.2e-16 ***
max:1527 0.506445 0.028056 18.0515 < 2.2e-16 ***
max:1503 0.634498 0.015790 40.1824 < 2.2e-16 ***
max:1510 0.582672 0.017196 33.8835 < 2.2e-16 ***
max:1511 0.529575 0.019490 27.1723 < 2.2e-16 ***
max:1530 0.572419 0.015340 37.3160 < 2.2e-16 ***
max:992 0.576131 0.017363 33.1823 < 2.2e-16 ***
max:1529 0.597476 0.018917 31.5846 < 2.2e-16 ***
max:988 0.603518 0.018890 31.9493 < 2.2e-16 ***
max:994 0.617397 0.015708 39.3045 < 2.2e-16 ***
max:1520 0.566657 0.015140 37.4267 < 2.2e-16 ***
max:1525 0.564128 0.018264 30.8883 < 2.2e-16 ***
max:1000 0.624753 0.015944 39.1851 < 2.2e-16 ***
max:1508 0.636625 0.038387 16.5846 < 2.2e-16 ***
max:996 0.630276 0.015953 39.5093 < 2.2e-16 ***
max:989 0.601404 0.018223 33.0029 < 2.2e-16 ***
max:1521 0.517496 0.018854 27.4480 < 2.2e-16 ***
max:801 0.548864 0.018331 29.9426 < 2.2e-16 ***
max:1509 0.593670 0.016990 34.9415 < 2.2e-16 ***
max:1506 0.571556 0.018355 31.1385 < 2.2e-16 ***
ed50:1523 36.748487 0.717807 51.1955 < 2.2e-16 ***
ed50:1512 35.946444 0.520394 69.0755 < 2.2e-16 ***
ed50:798 36.679679 0.333772 109.8943 < 2.2e-16 ***
ed50:1528 35.705693 0.799854 44.6403 < 2.2e-16 ***
ed50:799 36.520430 0.338175 107.9926 < 2.2e-16 ***
ed50:1515 35.767079 0.462190 77.3861 < 2.2e-16 ***
ed50:1514 36.190496 0.418054 86.5689 < 2.2e-16 ***
ed50:1522 35.590977 0.489113 72.7663 < 2.2e-16 ***
ed50:1519 35.409818 0.423957 83.5221 < 2.2e-16 ***
ed50:1518 35.265316 0.511916 68.8889 < 2.2e-16 ***
ed50:797 36.382088 0.415372 87.5892 < 2.2e-16 ***
ed50:806 36.245268 0.415945 87.1395 < 2.2e-16 ***
ed50:1501 35.912649 0.520790 68.9580 < 2.2e-16 ***
ed50:1504 36.600929 0.445503 82.1565 < 2.2e-16 ***
ed50:1507 35.207447 0.585967 60.0844 < 2.2e-16 ***
ed50:1516 35.713417 0.449623 79.4298 < 2.2e-16 ***
ed50:999 36.228822 0.393456 92.0785 < 2.2e-16 ***
ed50:1534 36.455163 0.536000 68.0134 < 2.2e-16 ***
ed50:997 35.888149 0.461509 77.7626 < 2.2e-16 ***
ed50:800 36.392402 0.422412 86.1539 < 2.2e-16 ***
ed50:993 36.074888 0.463092 77.9001 < 2.2e-16 ***
ed50:802 36.182938 0.458110 78.9831 < 2.2e-16 ***
ed50:1533 35.891020 0.496147 72.3395 < 2.2e-16 ***
ed50:1513 35.757802 0.497946 71.8107 < 2.2e-16 ***
ed50:991 36.751491 0.606881 60.5580 < 2.2e-16 ***
ed50:995 36.603430 0.370344 98.8362 < 2.2e-16 ***
ed50:1524 36.890783 0.383714 96.1414 < 2.2e-16 ***
ed50:1526 36.626312 1.256890 29.1404 < 2.2e-16 ***
ed50:1535 36.168749 0.603443 59.9373 < 2.2e-16 ***
ed50:998 36.347488 0.433592 83.8288 < 2.2e-16 ***
ed50:1532 36.936606 0.528360 69.9080 < 2.2e-16 ***
ed50:956 36.588978 0.443689 82.4654 < 2.2e-16 ***
ed50:1517 36.386592 0.770471 47.2264 < 2.2e-16 ***
ed50:1531 35.711954 0.504104 70.8424 < 2.2e-16 ***
ed50:1505 36.177612 0.525912 68.7903 < 2.2e-16 ***
ed50:803 36.082103 0.487126 74.0715 < 2.2e-16 ***
ed50:990 37.053672 0.414481 89.3978 < 2.2e-16 ***
ed50:805 36.029475 0.386039 93.3311 < 2.2e-16 ***
ed50:804 36.209416 0.400065 90.5089 < 2.2e-16 ***
ed50:987 36.221990 0.376936 96.0958 < 2.2e-16 ***
ed50:1502 36.209192 0.487137 74.3307 < 2.2e-16 ***
ed50:1527 35.766941 0.871940 41.0200 < 2.2e-16 ***
ed50:1503 35.843233 0.386383 92.7660 < 2.2e-16 ***
ed50:1510 36.420139 0.456369 79.8041 < 2.2e-16 ***
ed50:1511 36.511329 0.633342 57.6487 < 2.2e-16 ***
ed50:1530 36.480517 0.424555 85.9265 < 2.2e-16 ***
ed50:992 35.750797 0.463211 77.1804 < 2.2e-16 ***
ed50:1529 35.609439 0.480867 74.0525 < 2.2e-16 ***
ed50:988 36.767628 0.517683 71.0234 < 2.2e-16 ***
ed50:994 36.312660 0.397860 91.2698 < 2.2e-16 ***
ed50:1520 36.216215 0.572890 63.2167 < 2.2e-16 ***
ed50:1525 36.161879 0.507860 71.2044 < 2.2e-16 ***
ed50:1000 35.708059 0.408998 87.3061 < 2.2e-16 ***
ed50:1508 33.866112 0.658763 51.4087 < 2.2e-16 ***
ed50:996 36.483989 0.392156 93.0345 < 2.2e-16 ***
ed50:989 36.304037 0.426166 85.1875 < 2.2e-16 ***
ed50:1521 35.545009 0.832777 42.6825 < 2.2e-16 ***
ed50:801 35.695354 0.523239 68.2200 < 2.2e-16 ***
ed50:1509 35.658258 0.435157 81.9434 < 2.2e-16 ***
ed50:1506 35.499497 0.497644 71.3352 < 2.2e-16 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

0.02453777 (523 degrees of freedom)

Non-normality/heterogeneity adjustment through optimal Box-Cox transformation

Estimated lambda: 2
Confidence interval for lambda: [1.79,2.06]`

Running a quick anova test shows that the correction doesn't significantly affect the results :
`Chicken.W2.3.sum=broom::tidy(Chicken.W2.3) %>% mutate(Model="W2.3")

Chicken.W2.3.bc.sum=broom::tidy(Chicken.W2.3.bc) %>% mutate(Model="W2.3.bc")
Boxcox.comp=rbind(Chicken.W2.3.sum,Chicken.W2.3.bc.sum)

aov=aov(estimate~Model,data=Boxcox.comp %>% subset(term=="ed50"))
summary(aov)
Df Sum Sq Mean Sq F value Pr(>F)
Model 1 0.05 0.05203 0.167 0.683
Residuals 118 36.68 0.31087
TukeyHSD(aov)
Tukey multiple comparisons of means
95% family-wise confidence level

Fit: aov(formula = estimate ~ Model, data = Boxcox.comp %>% subset(term == "ed50"))

$Model
diff lwr upr p adj
W2.3.bc-W2.3 0.04164715 -0.1599361 0.2432304 0.6831898`

However I am neither sure if I can trust those results, nor where the issue may come from. Any clarification or guideline would be greatly appreciated.

Thanks,

Hugo

option 'otrace' in 'drmc' documented incorrectly

I noticed that the value of argument otrace in drc::drmc() is assigned to silentVal in drc:::drmOpt() which further defines silent in try( stats::optim() ).

The documentation for drc::drmc() states:
"otrace logical. If TRUE the output from optim is displayed."
which is misleading. If TRUE, then try( optim(startVec, ....), silent = TRUE) will be executed and thus the error message (if any) will be suppressed. The argument as little to do with "the output from optim"

`predict` not returning confidence intervals for `twophase()` model

similar to #23 , confidence intervals are not returned by predict, for models with two phase() functions:

spinach_model1_ll4 <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = LL.4())
head(predict(spinach_model1_ll4, interval = "confidence"))

     Prediction    Lower    Upper
[1,]   1.879553 1.795308 1.963798
[2,]   1.879553 1.795308 1.963798
[3,]   1.879553 1.795308 1.963798
[4,]   1.186813 1.113500 1.260126
[5,]   1.186813 1.113500 1.260126
[6,]   1.186813 1.113500 1.260126
spinach_model1_tp <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = twophase())
> head(predict(spinach_model1_tp, interval = "confidence"))

[1] 1.878608 1.878608 1.878608 1.202958 1.202958 1.202958
> sessionInfo()

R version 4.3.3 (2024-02-29)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS/LAPACK: /Users/paul/mambaforge/envs/nls/lib/libopenblasp-r0.3.27.dylib;  LAPACK version 
3.12.0

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

time zone: Europe/London
tzcode source: internal

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

other attached packages:
[1] dplyr_1.1.4   ggplot2_3.5.1 drc_3.0-1     MASS_7.3-60  

loaded via a namespace (and not attached):
 [1] bit_4.0.5        Matrix_1.6-5     gtable_0.3.5     crayon_1.5.2    
 [5] compiler_4.3.3   gtools_3.9.5     plotrix_3.8-4    tidyselect_1.2.1
 [9] parallel_4.3.3   splines_4.3.3    scales_1.3.0     lattice_0.22-6  
[13] TH.data_1.1-2    readr_2.1.5      R6_2.5.1         generics_0.1.3  
[17] tibble_3.2.1     car_3.1-2        munsell_0.5.1    tzdb_0.4.0      
[21] pillar_1.9.0     rlang_1.1.4      utf8_1.2.4       multcomp_1.4-25 
[25] bit64_4.0.5      cli_3.6.2        withr_3.0.0      magrittr_2.0.3  
[29] grid_4.3.3       vroom_1.6.5      mvtnorm_1.2-5    hms_1.1.3       
[33] sandwich_3.1-0   lifecycle_1.0.4  vctrs_0.6.5      glue_1.7.0      
[37] codetools_0.2-20 zoo_1.8-12       survival_3.7-0   abind_1.4-5     
[41] carData_3.0-5    fansi_1.0.6      colorspace_2.1-0 tools_4.3.3     
[45] pkgconfig_2.0.3 

reset options(warn) in drm() on exit

I like to use options(warn=1) in my scripts. But after calling drm() the value is set to 0. That's because drm() modifies it and this change persists after the function exits. It is not very nice to mess with the users options. Please cache them and reset them with on.exit, thank you.

Example:

library(drc)
options(warn = 1)
getOption("warn")  # prints 1
drm(c(9, 8, 2, 1) ~ c(1, 2, 3, 4), fct = W1.3())
getOption("warn")  # prints 0

Which method ("1", "2", "3", "4") did W2.2() use by default to obtain starting values?

Hello,

I am using "drm(FailRate ~ Mpa, fct = W2.2(), data = my_data)" to fit my data, and interested in understanding the method W2.2() used to obtain the starting values.

After checking the source code, seems like 4 methods are available, but I couldn't figure out how drm() calls the four methods or which method is the default. Also, I didn't find any related information online either. Can you please help explain the process?

Thank you very much and I am looking forward to your response!

Error in solve.default(object$fit$hessian) :

Dear authors:
I‘m using drc package to determine the Estimated LD50, but I've encountered several errors that I cannot figure out. Would please give me some advice? The drc package is an excellent package, however I'm still new to it.

When I ran ED(KP.LL.2, 50, interval = "delta"), It returned “Error in solve.default(object$fit$hessian) :”

I have attached my test file ("inline-supplementary-material-2.xlsx"), I think it should use the code that you describe in "four typesof selenium".

here is my code:

library(openxlsx)
KP <- read.xlsx('inline-supplementary-material-2.xlsx',
startRow=2)
KP <- KP[,-2]
colnames(KP) <- c("type", "conc", "total", "dead")
KP.LL.2 <- drm(dead/total ~ conc, type, weights = total,data = KP,
fct = LL.2(), type = "binomial")
ED(KP.LL.2, 50, interval = "delta")

Normalization scrambles points and curves

Hi there, I'm a big fan of the package. I came across the following issue when using the normal = T option in plot.drc. I've included the following reproducible example.

Plotting the unnormalized data works just fine:

library(drc)
mydata <- read.csv("repex.csv")
drc.model <-  drm(abs ~ conc, drug, data = mydata, fct = LL.4())
plot(drc.model, 
     type = "average",
     normal = F, 
     col = T, 
     broken = T, 
)

image

...but when I set the normal option to TRUE, the points for labels and curves for Ap Am appear to be mismatched. The curves are correct, but the points are misplotted

plot(drc.model, 
     type = "average",
     normal = T, 
     col = T, 
     broken = T, 
)

image

Setting type = "bars" also seems to normalize the curves, but not the error bars:

plot(drc.model, 
     type = "bars",
     normal = T, 
     col = T, 
     broken = T, 
)

image

The first issue can be corrected by sorting the data alphabetically first., but in a fix it would be desirable to control the order of the points in the legend.

Happy to contribute to a potential fix. 🤓

mselect results not consistent with modelFit - LOF only 0

Dear drc-Team,

for some reason, mselect() only returns 0 values for the LOF (Lack of fit) when comparing multiple models. However, when I am running modelFit() I get p values clearly above the sign. threshold of 0.05.

To reproduce the error I used the ryegrass dataset as shown below:

> # Fitting a four-parameter log-logistic model
> ryegrass.LL.4 <- drm(rootl ~ conc, data = ryegrass, fct = LL.4())
> modelFit(ryegrass.LL.4) # LOF pvalue of 0.9451 <- this is NOT identical with the results of mselect
Lack-of-fit test

          ModelDf    RSS Df F value p value
ANOVA          17 5.1799                   
DRC model      20 5.4002  3  0.2411  0.8665

> AIC(ryegrass.LL.4) # IC = 41.82703 <- this is identical with the results of mselect
[1] 42.31029

> m.ls = list(LL.5(),LL.3(),W2.4(),W1.4())
> mselect(ryegrass.LL.4, m.ls)
        logLik       IC Lack of fit   Res var
W2.4 -15.91352 41.82703           0 0.2646283
LL.4 -16.15514 42.31029           0 0.2700107
LL.5 -15.87828 43.75656           0 0.2777393
W1.4 -17.46720 44.93439           0 0.3012075
LL.3 -18.60413 45.20827           0 0.3153724

From my understanding of the mselect() and modelFit() function the computation of the Lack of fit values is based on a more general ANOVA model. Hence it should return similar p-values, shouldn't it?

I am using drc package version 3.2.0 and R version 4.2.1 on a Windows System.

Silence drm output

I'm trying to silence all drm output, but it appears to be ignoring the options set in drmc. For example:

dose <- c(
  1.69e-10,1.69e-10,1.69e-10,1.69e-10,
  5.08e-10,5.08e-10,5.08e-10,5.08e-10,
  1.52e-09,1.52e-09,1.52e-09,1.52e-09,
  4.57e-09,4.57e-09,4.57e-09,4.57e-09,
  1.37e-08,1.37e-08,1.37e-08,1.37e-08,
  4.12e-08,4.12e-08,4.12e-08,4.12e-08,
  1.23e-07,1.23e-07,1.23e-07,1.23e-07,
  3.7e-07,3.7e-07,3.7e-07,3.7e-07,
  1.11e-06,1.11e-06,1.11e-06,1.11e-06,
  3.33e-06,3.33e-06,3.33e-06,3.33e-06,
  1e-05,1e-05,1e-05,1e-05
)

response <- c(
  0.286,0.302,0.235,0.362,
  -0.08,-0.479,0.508,0.435,
  0.004,0.676,0.04,-0.751,
  -0.789,-1.053,0.389,-0.095,
  0.326,-0.226,0.038,0.137,
  0.406,-0.223,0.066,0.743,
  -0.113,0.061,-0.244,-0.237,
  0.658,0.146,-0.191,-0.106,
  -0.636,0.145,0.043,0.58,
  0.119,-0.219,0.262,-0.226,
  0.101,0.004,0.163,0.269
)

set.seed(42)
control <- drmc(errorm = FALSE, noMessage = TRUE, warnVal = -1)
foo <- drm(response ~ dose, fct=LL.4(), control = control)

results in the output:

Error in optim(startVec, opfct, hessian = TRUE, method = optMethod, control = list(maxit = maxIt,  : 
  non-finite finite-difference value [4]
In addition: Warning message:
In log(dose/parmMat[, 4]) : NaNs produced
Warning message:
Convergence failed. The model was not fitted! 

Session Info

R version 3.5.2 (2018-12-20)
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              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] bindrcpp_0.2.2  forcats_0.4.0   stringr_1.3.1   dplyr_0.7.8    
 [5] purrr_0.2.5     readr_1.3.1     tidyr_0.8.2     tibble_2.0.1   
 [9] ggplot2_3.1.0   tidyverse_1.2.1 magrittr_1.5    furrr_0.1.0    
[13] future_1.11.1.1 broom_0.5.1     drc_3.0-6       drcData_1.0-0  
[17] sandwich_2.5-0  glmnet_2.0-16   foreach_1.4.4   Matrix_1.2-15  
[21] MASS_7.3-51.1   edgeR_3.24.3    limma_3.38.3   

loaded via a namespace (and not attached):
 [1] httr_1.4.0        jsonlite_1.6      splines_3.5.2     carData_3.0-2    
 [5] modelr_0.1.2      gtools_3.8.1      assertthat_0.2.0  cellranger_1.1.0 
 [9] yaml_2.2.0        globals_0.12.4    pillar_1.3.1      backports_1.1.3  
[13] lattice_0.20-38   glue_1.3.0        digest_0.6.18     rvest_0.3.2      
[17] colorspace_1.4-0  plyr_1.8.4        pkgconfig_2.0.2   listenv_0.7.0    
[21] haven_2.1.0       mvtnorm_1.0-8     scales_1.0.0      openxlsx_4.1.0   
[25] rio_0.5.16        generics_0.0.2    car_3.0-2         withr_2.1.2      
[29] TH.data_1.0-10    lazyeval_0.2.1    cli_1.0.1         survival_2.43-3  
[33] crayon_1.3.4      readxl_1.3.0      fansi_0.4.0       nlme_3.1-137     
[37] xml2_1.2.0        foreign_0.8-71    tools_3.5.2       data.table_1.12.0
[41] hms_0.4.2         multcomp_1.4-8    munsell_0.5.0     locfit_1.5-9.1   
[45] plotrix_3.7-4     zip_1.0.0         compiler_3.5.2    rlang_0.3.1      
[49] grid_3.5.2        iterators_1.0.10  rstudioapi_0.8    gtable_0.2.0     
[53] codetools_0.2-15  abind_1.4-5       curl_3.3          R6_2.4.0         
[57] zoo_1.8-4         lubridate_1.7.4   utf8_1.1.4        bindr_0.1.1      
[61] stringi_1.2.4     parallel_3.5.2    Rcpp_1.0.0        tidyselect_0.2.5 

drc-3.1.0 fails to install because of missing object 'bread'

Many thanks for the very nice package and the newest update to version 3.1.0. Unfortunately it fails to install with the following error message:

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'drc':
 object 'bread' not found whilst loading namespace 'drc'
Error: Laden fehlgeschlagen
Execution halted
ERROR: loading failed
* removing 'C:/Program Files/R/rw/library/drc'
* restoring previous 'C:/Program Files/R/rw/library/drc'
Error: Failed to install 'drc' from GitHub:
  (konvertiert von Warnung) installation of package ‘C:/Users/rhurlin/AppData/Local/Temp/RtmpsLoT5Y/file36a8508a31cc/drc_3.1-0.tar.gz’ had non-zero exit status

For some reason it does not found the newly introduced S3 method?

deviance

Suggest that a deviance method for "drc" class be added to the drc package.

Might also review what methods exist for "nls" and "lm" classes and add any which are applicable.

methods(class = "nls")
methods(class = "lm")

Error with `estfun` with R version 4.0.x

Calculation of robust standard errors using the sandwich package appears to fail under R 4.0.x but not under earlier versions (3.6.0).

I see this issue has already be raised and closed, and am just noting that it is reproducible on versions of R > 4.

suppressPackageStartupMessages({
  library(drc)
  library(lmtest)
  library(sandwich)
})

ryegrass.m1<-drm(rootl ~ conc, data = ryegrass, fct = LL.4())
coeftest(ryegrass.m1, vcov = sandwich)
#> Error in UseMethod("estfun"): no applicable method for 'estfun' applied to an object of class "drc"
sessionInfo()
#> R version 4.0.2 (2020-06-22)
#> Platform: i386-w64-mingw32/i386 (32-bit)
#> Running under: Windows 10 x64 (build 17134)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=English_New Zealand.1252  LC_CTYPE=English_New Zealand.1252   
#> [3] LC_MONETARY=English_New Zealand.1252 LC_NUMERIC=C                        
#> [5] LC_TIME=English_New Zealand.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] sandwich_2.5-1 lmtest_0.9-37  zoo_1.8-8      drc_3.0-1      MASS_7.3-51.6 
#> 
#> loaded via a namespace (and not attached):
#>  [1] zip_2.1.1         Rcpp_1.0.5        compiler_4.0.2    pillar_1.4.6     
#>  [5] cellranger_1.1.0  highr_0.8         forcats_0.5.0     tools_4.0.2      
#>  [9] digest_0.6.25     evaluate_0.14     tibble_3.0.3      lifecycle_0.2.0  
#> [13] lattice_0.20-41   pkgconfig_2.0.3   rlang_0.4.7       Matrix_1.2-18    
#> [17] openxlsx_4.1.5    curl_4.3          yaml_2.2.1        mvtnorm_1.1-1    
#> [21] haven_2.3.1       xfun_0.16         rio_0.5.16        stringr_1.4.0    
#> [25] knitr_1.29        vctrs_0.3.3       gtools_3.8.2      hms_0.5.3        
#> [29] grid_4.0.2        data.table_1.13.0 R6_2.4.1          plotrix_3.7-8    
#> [33] survival_3.1-12   readxl_1.3.1      foreign_0.8-80    rmarkdown_2.3    
#> [37] multcomp_1.4-13   TH.data_1.0-10    carData_3.0-4     car_3.0-9        
#> [41] magrittr_1.5      scales_1.1.1      codetools_0.2-16  splines_4.0.2    
#> [45] ellipsis_0.3.1    htmltools_0.5.0   abind_1.4-5       colorspace_1.4-1 
#> [49] stringi_1.4.6     munsell_0.5.0     crayon_1.3.4

Created on 2020-10-19 by the reprex package (v0.3.0)

But works at https://rdrr.io/snippets/ which uses R 3.4.4, but same version of drc and sandwich.


t test of coefficients:

              Estimate Std. Error t value  Pr(>|t|)    
b:(Intercept)  2.98222    0.47438  6.2865 3.882e-06 ***
c:(Intercept)  0.48141    0.12779  3.7672  0.001212 ** 
d:(Intercept)  7.79296    0.15311 50.8976 < 2.2e-16 ***
e:(Intercept)  3.05795    0.26741 11.4355 3.170e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

sh: 1: cannot create /dev/null: Permission denied
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
[1] C

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

other attached packages:
[1] sandwich_2.5-1 lmtest_0.9-37  zoo_1.8-5      drc_3.0-1      MASS_7.3-51.4 

loaded via a namespace (and not attached):
 [1] zip_2.0.1         Rcpp_1.0.1        cellranger_1.1.0  pillar_1.3.1     
 [5] compiler_3.4.4    forcats_0.4.0     tools_3.4.4       tibble_2.1.1     
 [9] lattice_0.20-38   pkgconfig_2.0.2   rlang_0.3.4       openxlsx_4.1.0   
[13] Matrix_1.2-17     curl_3.3          mvtnorm_1.0-8     haven_2.1.0      
[17] rio_0.5.16        gtools_3.8.1      hms_0.4.2         grid_3.4.4       
[21] data.table_1.12.2 plotrix_3.7-5     readxl_1.3.1      survival_2.44-1.1
[25] foreign_0.8-71    multcomp_1.4-8    TH.data_1.0-10    carData_3.0-2    
[29] car_3.0-2         magrittr_1.5      scales_1.0.0      codetools_0.2-16 
[33] splines_3.4.4     abind_1.4-5       colorspace_1.4-1  munsell_0.5.0    
[37] crayon_1.3.4    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.