drfit.Rd
Fit doseresponse relationships to doseresponse data and calculate biometric results for (eco)toxicity evaluation
drfit(data, startlogED50 = NA, chooseone = TRUE, probit = TRUE, logit = FALSE, weibull = FALSE, linlogit = FALSE, level = 0.95, linlogitWrong = NA, allWrong = NA, ps0 = 1, ls0 = 0.5, ws0 = 0.5, b0 = 2, f0 = 0, showED50 = FALSE, EDx = NULL, EDx.tolerance = 1e4)
data  A data frame containing doseresponse data. The data frame has to contain
at least a factor called “substance”, a numeric vector “dose”
with the dose values, a vector called “unit” containing the unit
used for the dose and a numeric vector “response” with the response
values of the test system normalized between 0 and 1. Such a data frame can
be easily obtained if a compliant RODBC data source is available for use in
conjunction with the function If there is a column called “ok” and it is set to “no fit” in a specific line, then the corresponding data point will be excluded from the fitting procedure, although it will be plotted. 

startlogED50  Especially for the linlogit model, a suitable log10 of the ED50 has to be given by the user, since it is not correctly estimated for data showing hormesis with the default estimation method. 
probit  A boolean defining if cumulative density curves of normal distributions

logit  A boolean defining if cumulative density curves of logistic distributions

weibull  A boolean defining if the cumulative density curves of weibull distributions
( 
linlogit  A boolean defining if the linearlogistic function

level  The level for the confidence interval listed for the log ED50. 
linlogitWrong  An optional vector containing the names of the substances for which the linlogit function produces a wrong fit. 
allWrong  An optional vector containing the names of the substances for which all functions produce a wrong fit. 
chooseone  If TRUE (default), the models are tried in the order linlogit, probit, logit, weibull, and the first model that produces a valid fit is used. If FALSE, all models that are set to TRUE and that can be fitted will be reported. 
ps0  If the probit model is fitted, 
ls0  If the logit model is fitted, 
ws0  If the weibull model is fitted, 
b0,f0  If the linearlogistic model is fitted, 
showED50  If set to TRUE, the ED50 and its confidence interval on the original dose scale (not log scale) is included in the output. 
EDx  A vector of inhibition values x in percent for which the corresponding doses EDx should be reported. 
EDx.tolerance  Tolerance of the effect level, expressed on the response scale from 0 to 1. 
A dataframe with the attribute models
holding a list of the fitted
doseresponse models of class nls
. The dataframe has at least
one line for each substance.
For the “linlogit”, “logit” and “probit” models, the
parameter a
that is reported coincides with the logED50, i.e the
logED50 is one of the model parameters that is being fitted. Therefore,
a confidence interval for the confidence level level
is calculated
using the confint.nls
function and listed.
The following variables are in the dataframe:
The name of the substance
The number of dose levels in the raw data
The total number of data points in the raw data used for the fit
The decadic logarithm of the lowest dose
The total number of data points in the raw data used for the fit
If the data did not show a mean response < 0.5 at the highest dose level, the modeltype is set to “inactive”. If the mean response at the lowest dose is smaller than 0.5, the modeltype is set to “active”. In both cases, no fitting procedure is carried out. If the fitted ED50 is higher than the highest dose, “no fit” is given here.
The decadic logarithm of the ED50
The lower bound of the confidence interval of log ED50.
The name of the column depends on the requested confidence level
.
The higher bound of the confidence interval of log ED50.
The name of the column depends on the requested confidence level
.
The unit used for the dose levels in the doseresponse data
The square root of the estimated variance of the random error as returned
by summary.nls
.
For the “linlogit”, “logit” and “probit” models, the
parameter a
coincides with the logED50. In the case of the
“weibull” model, a
is a location parameter.
Parameter b
in the case of the “linlogit” fit is the variable
b from the linlogitf
function. In the case of “probit”
fit it is the standard deviation of the fitted normal distribution, in the
case of the “logit” fit it is the scale
parameter in the
plogis
function, and in the “weibull” fit it is the
shape
parameter of the fitted pweibull
function.
Only the “linlogit” fit produces a third parameter c
which is
the variable f from the linlogitf
function.
There is a demo for each dataset that can be accessed by
demo(dataset)
Further examples are given in help pages to the datasets
antifoul
, IM1xIPC81
and
IM1xVibrio
.
Since version 0.6.1 of this package, there is a dropin replacement function
drcfit
which internally uses the drc package and also gives
confidence intervals for EDx values via this package.
data(antifoul) r < drfit(antifoul, showED50 = TRUE, EDx = c(5, 10, 20))#> #>#>#> #>#>format(r, digits = 2)#> Substance ndl n lld lhd mtype logED50 2.5% 97.5% unit sigma a #> 1 TBT 38 135 2.7 2.4 probit 0.16 0.27 0.056 microM 0.19 0.16 #> 2 Zn Pyrithion 27 81 2.1 2.0 probit 0.40 0.51 0.292 microM 0.23 0.40 #> b ED50 ED50 2.5% ED50 97.5% EDx5 EDx10 EDx20 #> 1 0.68 0.68 0.54 0.88 0.053 0.093 0.18 #> 2 0.42 0.40 0.31 0.51 0.082 0.117 0.18