Sorry if it's a dumb question, but I am having trouble figuring out how to use pmodels in the drc package. I've searched everywhere online and all I can find is the definition, which is: "a data frame with a many columns as there are parameters in the non-linear function. Or a list containing a formula for each parameter in the nonlinear function." There are examples online, but I have no what it represents. For example, for the commands:
sel.m2 <- drm(dead/total~conc, type, weights=total, data=selenium, fct=LL.2(),
type="binomial", pmodels=list(~1, ~factor(type)-1))
met.as.m1<-drm(gain ~ dose, product, data = methionine, fct = AR.3(),
pmodels = list(~1, ~factor(product), ~factor(product)))
plot(met.as.m1, log = "", ylim = c(1450, 1800))
auxins.m1 <- boxcox(drm(y ~ dose, h, pmodels = data.frame(h, h, 1, h), fct = LL.4(), data = auxins), method = "anova")
I see pmodels as a list and data frame, but what does the "-1"vs "~1" mean or what does it mean to list a factor, what's the significance of the order within the parenthesis?
I agree that it's not well explained for new people. Unfortunately, I can only answer you in part. A late response but for anyone else:
Two resources are available for reference with drc: a) The writers published about drc. See main text and supplementary (S3 in this example) DOI:10.1371/journal.pone.0146021 b) See the drc.pdf and ctrl+f for pmodel to inspect the various uses.
data.frame vs. list depends on the grouping level I believe.
After playing around with my data (subsets), I found that pmodels() = parameter/pooled models aka how you set those parameters to equal (i.e., global/shared or not). With your last example using the auxins df
Shows that the top is set to 1. The order is the same as the LL.4(names...)
So if you set
as they do in the drc.pdf on pg.10, you'll see that it's to set a common/shared bottom and top.
Check out pg.9 of their supplementary article, it shows that for LL.2, the two-parameter logistic fit has pre-set top = 1 and bottom = 0. The output of
Shows that ed50 is assumed constant. Alternatively from pg.91 of the drc.pdf:
Unfortunately, it's really not clear what the object-1 means vs. just the object. A better approach might be to use the base drm() without the special case of LL.#()
Check
to see all available functions
if you're trying to fix a value at a certain value you can
Related in part; see a lot of drm functions laid out: https://stackoverflow.com/a/39257095