aboutsummaryrefslogtreecommitdiff
path: root/docs/reference/drcfit.html
blob: d08b4b0ee8216a9bdc49348a821c099f43fb386f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
  <head>
  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Fit dose-response models using the drc package — drcfit • drfit</title>

<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script>

<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>

<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>



<meta property="og:title" content="Fit dose-response models using the drc package — drcfit" />

<meta property="og:description" content="Fit dose-response relationships to dose-response data and calculate
  biometric results for (eco)toxicity evaluation using the drc package" />
<meta name="twitter:card" content="summary" />



<!-- mathjax -->
<script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->


  </head>

  <body>
    <div class="container template-reference-topic">
      <header>
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">drfit</a>
        <span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.7.1</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../index.html">
    <span class="fa fa-home fa-lg"></span>
     
  </a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
      </ul>
      
      <ul class="nav navbar-nav navbar-right">
        
      </ul>
      
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      
      </header>

<div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Fit dose-response models using the drc package</h1>
    
    <div class="hidden name"><code>drcfit.Rd</code></div>
    </div>

    <div class="ref-description">
    
    <p>Fit dose-response relationships to dose-response data and calculate
  biometric results for (eco)toxicity evaluation using the drc package</p>
    
    </div>

    <pre class="usage"><span class='fu'>drcfit</span>(<span class='no'>data</span>, <span class='kw'>chooseone</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>probit</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>logit</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
  <span class='kw'>weibull</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>linlogit</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>level</span> <span class='kw'>=</span> <span class='fl'>0.95</span>,
  <span class='kw'>showED50</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>EDx</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
    <table class="ref-arguments">
    <colgroup><col class="name" /><col class="desc" /></colgroup>
    <tr>
      <th>data</th>
      <td><p>A data frame containing dose-response data. The data frame has to contain
    at least a factor called &#8220;substance&#8221;, a numeric vector &#8220;dose&#8221;
    with the dose values, a vector called &#8220;unit&#8221; containing the unit
    used for the dose and a numeric vector &#8220;response&#8221; 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 <code>drdata</code>.</p>
<p>If there is a column called &#8220;ok&#8221; and it is set to &#8220;no fit&#8221; in
    a specific line, then the corresponding data point will be excluded from
    the fitting procedure, although it will be plotted.</p></td>
    </tr>
    <tr>
      <th>probit</th>
      <td><p>A boolean defining if cumulative density curves of normal distributions
    are fitted against the decadic logarithm of the dose.  Default ist TRUE.
    Note that the parameter definitions used in the model are different to the
    ones used in <code>drfit</code>. Parameter e from <code>LN.2</code> is listed
    as a here, and parameter b from there is listed as b.</p></td>
    </tr>
    <tr>
      <th>logit</th>
      <td><p>A boolean defining if cumulative density curves of logistic distributions
    <code>plogis</code> are fitted to the decadic logarithm of the dose.
    Default is FALSE.
    Again the parameter definitions used in the model are different to the
    ones used in <code>drfit</code>. Parameter e from <code>LL.2</code> is listed
    as a here, and parameter b from LL.2 is listed as b.</p></td>
    </tr>
    <tr>
      <th>weibull</th>
      <td><p>A boolean defining if Weibull dose-response models
    (<code>W1.2</code> are fitted to the untransformed dose. Default is FALSE.
    Note that the results differ from the ones obtained with
    <code>drfit</code>, due to a different model specification.</p></td>
    </tr>
    <tr>
      <th>linlogit</th>
      <td><p>A boolean defining if the linear-logistic function
    <code>linlogitf</code> as defined by van Ewijk and Hoekstra 1993 is
    fitted to the data. Default is FALSE. Obtaining the ED50 (and EDx values
    in general) uses <code>ED</code> internally and does not always give a
    result.</p></td>
    </tr>
    <tr>
      <th>level</th>
      <td><p>The level for the confidence interval listed for the log ED50.</p></td>
    </tr>
    <tr>
      <th>chooseone</th>
      <td><p>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.</p></td>
    </tr>
    <tr>
      <th>EDx</th>
      <td><p>A vector of inhibition values x in percent for which the corresponding doses
    EDx should be reported.</p></td>
    </tr>
    <tr>
      <th>showED50</th>
      <td><p>If set to TRUE, the ED50 and its confidence interval on the original dose
    scale (not log scale) is included in the output.</p></td>
    </tr>
    </table>
    
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>A dataframe with the attribute <code>models</code> holding a list of the fitted
  dose-response models of class <code>nls</code>. The dataframe has at least
  one line for each substance.</p>
<p>The following variables are in the dataframe:</p>
<dt>Substance</dt><dd><p>The name of the substance</p></dd>
  <dt>ndl</dt><dd><p>The number of dose levels in the raw data</p></dd>
  <dt>n</dt><dd><p>The total number of data points in the raw data used for the fit</p></dd>
  <dt>lld</dt><dd><p>The decadic logarithm of the lowest dose</p></dd>
  <dt>lhd</dt><dd><p>The total number of data points in the raw data used for the fit</p></dd>
  <dt>mtype</dt><dd><p>If the data did not show a mean response &lt; 0.5 at the highest dose level,
    the modeltype is set to &#8220;inactive&#8221;. If the mean response at the
    lowest dose is smaller than 0.5, the modeltype is set to &#8220;active&#8221;.
    In both cases, no fitting procedure is carried out. If the fitted ED50
    is higher than the highest dose, &#8220;no fit&#8221; is given here.</p></dd>
  <dt>logED50</dt><dd><p>The decadic logarithm of the ED50</p></dd>
  <dt>low %</dt><dd><p>The lower bound of the confidence interval of log ED50.
    The name of the column depends on the requested confidence <code>level</code>.</p></dd>
  <dt>high %</dt><dd><p>The higher bound of the confidence interval of log ED50.
    The name of the column depends on the requested confidence <code>level</code>.</p></dd>
  <dt>unit</dt><dd><p>The unit used for the dose levels in the dose-response data</p></dd>
  <dt>sigma</dt><dd><p>The square root of the estimated variance of the random error as returned
    by <code>summary.drc</code>.</p></dd>
  <dt>a</dt><dd><p>For the linlogit model, this is the parameter e from <code>BC.4</code>.
    For the probit and the logit model, this is the ED50. For the weibull
    model, this is parameter e from <code>W1.2</code>. Note that the Weibull
    model is fitted to the untransformed data.</p></dd>
  <dt>b</dt><dd><p>For the linlogit, probit, logit and weibull models, these are the
    parameters b from <code>BC.4</code>, <code>LN.2</code>,
    <code>LL.2</code> and <code>W1.2</code>, respectively.
    Note that the parameter definitions (and in the case of Weibull, the model
    used) are different to the ones used in <code>drfit</code>.</p></dd>
  <dt>c</dt><dd><p>Only the &#8220;linlogit&#8221; fit produces a third parameter <code>c</code>, which is
    the parameter f from the <code>BC.4</code> function.</p></dd>
  If the parameter showED50 was set to TRUE, the ED50 values and their
  confidence intervals are also included on the original dose scale.

  If one or more response leves were specified in the argument EDx,
  the corresponding dose levels are given in addition, together with their
  confidence intervals as calculated by ED from the drc package.

    
    <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>

    <p>There is a demo for each dataset that can be accessed by
  <code>demo(dataset)</code></p>
    
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <div class='dont-index'><p>Further examples are given in help pages to the datasets
  <code>antifoul</code>, <code>IM1xIPC81</code> and
  <code>IM1xVibrio</code>.</p></div>
    

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>antifoul</span>)
<span class='no'>r</span> <span class='kw'>&lt;-</span> <span class='fu'>drcfit</span>(<span class='no'>antifoul</span>, <span class='kw'>showED50</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>EDx</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>5</span>, <span class='fl'>10</span>, <span class='fl'>20</span>))</div><div class='output co'>#&gt; <span class='message'></span>
#&gt; <span class='message'>TBT: Fitting data...</span></div><div class='output co'>#&gt; <span class='message'></span>
#&gt; <span class='message'>Zn Pyrithion: Fitting data...</span></div><div class='input'><span class='fu'>format</span>(<span class='no'>r</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>2</span>)</div><div class='output co'>#&gt;      Substance ndl   n  lld lhd  mtype logED50  2.5%  97.5%   unit sigma    a
#&gt; 1          TBT  38 135 -2.7 2.4 probit   -0.16 -0.28 -0.072 microM  0.19 0.68
#&gt; 2 Zn Pyrithion  27  81 -2.1 2.0 probit   -0.40 -0.52 -0.303 microM  0.23 0.40
#&gt;       b ED50 ED50 2.5% ED50 97.5%  EDx5 EDx5 2.5% EDx5 97.5% EDx10 EDx10 2.5%
#&gt; 1 -0.64 0.68      0.52       0.85 0.053     0.015      0.091 0.093      0.040
#&gt; 2 -1.04 0.40      0.30       0.50 0.082     0.023      0.142 0.117      0.048
#&gt;   EDx10 97.5% EDx20 EDx20 2.5% EDx20 97.5%
#&gt; 1        0.15  0.18       0.11        0.26
#&gt; 2        0.19  0.18       0.10        0.26</div></pre>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
    <h2>Contents</h2>
    <ul class="nav nav-pills nav-stacked">
      <li><a href="#arguments">Arguments</a></li>
      
      <li><a href="#value">Value</a></li>

      <li><a href="#note">Note</a></li>

      <li><a href="#see-also">See also</a></li>
      
      <li><a href="#examples">Examples</a></li>
    </ul>

    <h2>Author</h2>
    
  Johannes Ranke <a href='mailto:jranke@uni-bremen.de'>jranke@uni-bremen.de</a>
  <a href='http://www.uft.uni-bremen.de/chemie/ranke'>http://www.uft.uni-bremen.de/chemie/ranke</a>
  The functionality of the drc package used under the hood in this function
  was written by Christian Ritz.

  </div>
</div>

      <footer>
      <div class="copyright">
  <p>Developed by Johannes Ranke.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>

      </footer>
   </div>

  

  </body>
</html>

Contact - Imprint