While using drc package for mixture prediction on microalgae growth inhibition data, specifically the mixture function, I receive an error message "'collapse' argument should be a formula" , which I don't really understand.
I'm using almost exactly the same script present in the drc package pdf available online with the data "glymet" which also concerns growth inhibition data, with just a few changes to fit my own data. The drm function manages well to estimate the parameters of the dose-response curves concerning my data.
Being not that proficient with Rstudio as a whole, I am stuck with the error message ""'collapse' argument should be a formula" " which blocks me from doing further analysis. Does someone has any idea of what could cause this error ? I didn't find anyone raising the same issue online, and this problem doesn't happens with glymet data.
my data :
> dbp
dose rgr pct
1 0.00 1.502 100
2 0.00 1.449 100
3 0.00 1.611 100
4 0.00 1.468 100
5 0.00 1.506 100
6 0.00 1.495 100
7 1.81 1.249 100
8 1.81 1.303 100
9 1.81 1.316 100
10 3.19 0.968 100
11 3.19 1.057 100
12 3.19 1.083 100
13 5.43 1.003 100
14 5.43 0.964 100
15 5.43 0.943 100
16 8.25 0.849 100
17 8.25 0.781 100
18 8.25 0.697 100
19 15.67 0.587 100
20 15.67 0.660 100
21 15.67 0.591 100
22 26.65 0.485 100
23 26.65 0.497 100
24 26.65 0.532 100
25 45.50 0.286 100
26 45.50 0.370 100
27 45.50 0.326 100
28 0.00 1.686 75
29 0.00 1.580 75
30 0.00 1.499 75
31 0.00 1.528 75
32 0.00 1.540 75
33 0.00 1.653 75
34 1.32 1.380 75
35 1.32 1.421 75
36 1.32 1.468 75
37 2.65 1.174 75
38 2.65 1.137 75
39 2.65 1.167 75
40 5.30 0.726 75
41 5.30 0.810 75
42 5.30 0.797 75
43 10.59 0.626 75
44 10.59 0.471 75
45 10.59 0.416 75
46 21.18 0.468 75
47 21.18 0.415 75
48 21.18 0.487 75
49 42.36 0.252 75
50 42.36 0.303 75
51 42.36 0.320 75
52 0.00 1.620 50
53 0.00 1.713 50
54 0.00 1.659 50
55 0.00 1.678 50
56 0.00 1.700 50
57 0.00 1.581 50
58 1.58 1.298 50
59 1.58 1.226 50
60 1.58 1.189 50
61 3.16 1.021 50
62 3.16 1.062 50
63 3.16 0.925 50
64 6.33 0.863 50
65 6.33 0.823 50
66 6.33 0.711 50
67 12.65 0.548 50
68 12.65 0.611 50
69 12.65 0.597 50
70 25.30 0.394 50
71 25.30 0.363 50
72 25.30 0.319 50
73 50.60 0.255 50
74 50.60 0.241 50
75 50.60 0.219 50
76 0.00 1.500 25
77 0.00 1.541 25
78 0.00 1.527 25
79 0.00 1.491 25
80 0.00 1.468 25
81 0.00 1.353 25
82 1.80 1.512 25
83 1.80 1.313 25
84 1.80 1.442 25
85 3.60 1.437 25
86 3.60 1.364 25
87 3.60 1.291 25
88 7.20 1.231 25
89 7.20 1.389 25
90 7.20 1.286 25
91 14.40 0.802 25
92 14.40 1.069 25
93 14.40 0.865 25
94 28.80 0.474 25
95 28.80 0.597 25
96 28.80 0.411 25
97 57.61 0.321 25
98 57.61 0.216 25
99 57.61 0.239 25
100 0.00 1.512 0
101 0.00 1.390 0
102 0.00 1.388 0
103 0.00 1.391 0
104 0.00 1.328 0
105 0.00 1.390 0
106 1.56 1.467 0
107 1.56 1.422 0
108 1.56 1.371 0
109 2.92 1.255 0
110 2.92 1.359 0
111 2.92 1.354 0
112 5.25 1.211 0
113 5.25 1.232 0
114 5.25 1.353 0
115 7.66 1.271 0
116 7.66 1.168 0
117 7.66 0.970 0
118 17.03 0.927 0
119 17.03 0.689 0
120 17.03 1.034 0
121 31.22 0.611 0
122 31.22 0.758 0
123 31.22 0.752 0
124 55.19 0.449 0
125 55.19 0.303 0
126 55.19 0.434 0
dose is corresponding to the concentration of exposure, rgr to the growth rate and pct to the percentage of the 1st substance in the mixture.
I'm using the following script for this data:
> library(drc)
>
> dbp<-read.table("dbp.txt",header=TRUE, sep="")
>
### data glymet
> ## Fitting the model with freely varying ED50 values
> dbp.free <- drm(rgr~dose, pct, data = dbp,
+ fct = LL.3())
>
> ## Lack-of-fit test
> modelFit(dbp.free) # acceptable
Lack-of-fit test
ModelDf RSS Df F value p value
ANOVA 89 0.46595
DRC model 111 0.68575 22 1.9083 0.0181
> summary(dbp.free)
Model fitted: Log-logistic (ED50 as parameter) with lower limit at 0 (3 parms)
Parameter estimates:
Estimate Std. Error t-value p-value
b:100 0.836148 0.060986 13.710 < 2.2e-16 ***
b:75 0.990562 0.067962 14.575 < 2.2e-16 ***
b:50 0.819426 0.057170 14.333 < 2.2e-16 ***
b:25 1.651083 0.147962 11.159 < 2.2e-16 ***
b:0 1.217393 0.112309 10.840 < 2.2e-16 ***
d:100 1.511861 0.031439 48.089 < 2.2e-16 ***
d:75 1.605332 0.030678 52.329 < 2.2e-16 ***
d:50 1.658598 0.031896 52.001 < 2.2e-16 ***
d:25 1.472612 0.026126 56.365 < 2.2e-16 ***
d:0 1.414731 0.027300 51.822 < 2.2e-16 ***
e:100 10.070587 0.871177 11.560 < 2.2e-16 ***
e:75 6.293939 0.474130 13.275 < 2.2e-16 ***
e:50 5.670343 0.491531 11.536 < 2.2e-16 ***
e:25 20.022984 1.153494 17.359 < 2.2e-16 ***
e:0 27.492564 2.023952 13.584 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error:
0.07859961 (111 degrees of freedom)
> ## Plotting isobole structure
> isobole(dbp.free)
>
> ## Fitting the concentration addition model
> dbp.ca <- mixture(dbp.free, model = "CA")
Error in mixture(dbp.free, model = "CA") :
'collapse' argument should be a formula
Thank you in advance! It's my first post so don't hesitate to tell me if an information is missing.