aboutsummaryrefslogblamecommitdiff
path: root/docs/reference/drcfit.html
blob: 8a768630a4e48e4f73b0af2f4eebf063a1a1d252 (plain) (tree)
1
2
3
4
5
6
7
8
9
               

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

                                                                               

                                                              
 
                                                    
                                                                                    

                               

                                                                                                                               



                                      

                                                             
                                                                                                                     
             
          
 
                                                      
                                     

                                                 
                                                                                    



                           
 
                                


                                                           

                                                         

          
                                 

                                                                          
          
 












                                                                                                                                                                                                                                                                                                                                                             

                                                                               

                                                                                    
                                                                            



                                                                              

                                                                              





                                                                                                                                                  

                                                                          




                                                                                                          

                                                                              




                                                                                                    

                                                                            






                                                                              

                                                                            
















                                                                                                                                                 
                                  

 
                                                    


















                                                                                   
                                                                          






                                                                         
                                                                                           


                                                               
                                                                                           





                                                                                
                                         


                                                                              

                                                                            
                                                       


                                                                        
                                                           

                                                                              



                                                                                                 
                                                                 
 

                                                                                         
 
 





                                                                                 
                                                               








                                                                                                            
                   
                                                                                    
                                                                           
                                    





















                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
        


                                                                                      

      
 

                                            


                     
                                                                                                             

      
                     
 

  
 
  
 
                
 
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><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://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" 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"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></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 data-spy="scroll" data-target="#toc">
    

    <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" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <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="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.7.4</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav"><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>

    <div id="ref-usage">
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">drcfit</span><span class="op">(</span><span class="va">data</span>, chooseone <span class="op">=</span> <span class="cn">TRUE</span>, probit <span class="op">=</span> <span class="cn">TRUE</span>, logit <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  weibull <span class="op">=</span> <span class="cn">FALSE</span>, linlogit <span class="op">=</span> <span class="cn">FALSE</span>, level <span class="op">=</span> <span class="fl">0.95</span>,</span>
<span>  showED50 <span class="op">=</span> <span class="cn">FALSE</span>, EDx <span class="op">=</span> <span class="cn">NULL</span><span class="op">)</span></span></code></pre></div>
    </div>

    <div id="arguments">
    <h2>Arguments</h2>
    <dl><dt>data</dt>
<dd><p>A data frame containing dose-response 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 <code><a href="drdata.html">drdata</a></code>.</p>
<p>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.</p></dd>

  <dt>probit</dt>
<dd><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><a href="drfit.html">drfit</a></code>. Parameter e from <code>LN.2</code> is listed
    as a here, and parameter b from there is listed as b.</p></dd>

  <dt>logit</dt>
<dd><p>A boolean defining if cumulative density curves of logistic distributions
    <code><a href="https://rdrr.io/r/stats/Logistic.html" class="external-link">plogis</a></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><a href="drfit.html">drfit</a></code>. Parameter e from <code>LL.2</code> is listed
    as a here, and parameter b from LL.2 is listed as b.</p></dd>

  <dt>weibull</dt>
<dd><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><a href="drfit.html">drfit</a></code>, due to a different model specification.</p></dd>

  <dt>linlogit</dt>
<dd><p>A boolean defining if the linear-logistic function
    <code><a href="linlogitf.html">linlogitf</a></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></dd>

  <dt>level</dt>
<dd><p>The level for the confidence interval listed for the log ED50.</p></dd>

  <dt>chooseone</dt>
<dd><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></dd>

  <dt>EDx</dt>
<dd><p>A vector of inhibition values x in percent for which the corresponding doses
    EDx should be reported.</p></dd>

  <dt>showED50</dt>
<dd><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></dd>

</dl></div>
    <div id="value">
    <h2>Value</h2>
    

<p>A dataframe with the attribute <code>models</code> holding a list of the fitted
  dose-response models of class <code><a href="https://rdrr.io/r/stats/nls.html" class="external-link">nls</a></code>. The dataframe has at least
  one line for each substance.</p>


<p>The following variables are in the dataframe:</p>
<dl><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 “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.</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><a href="drfit.html">drfit</a></code>.</p></dd>

  <dt>c</dt>
<dd><p>Only the “linlogit” fit produces a third parameter <code>c</code>, which is
    the parameter f from the <code>BC.4</code> function.</p></dd>

</dl><p>If the parameter <code>showED50</code> was set to TRUE, the ED50 values and their
  confidence intervals are also included on the original dose scale.</p>


<p>If one or more response leves were specified in the argument <code>EDx</code>,
  the corresponding dose levels are given in addition, together with their
  confidence intervals as calculated by <code>ED</code> from the drc package.</p>
    </div>
    <div id="note">
    <h2>Note</h2>
    <p>There is a demo for each dataset that can be accessed by
  <code>demo(dataset)</code></p>
    </div>
    <div id="see-also">
    <h2>See also</h2>
    <div class="dont-index"><p>Further examples are given in help pages to the datasets
  <code><a href="antifoul.html">antifoul</a></code>, <code><a href="IM1xIPC81.html">IM1xIPC81</a></code> and
  <code><a href="IM1xVibrio.html">IM1xVibrio</a></code>.</p></div>
    </div>
    <div id="author">
    <h2>Author</h2>
    <p>Johannes Ranke <a href="mailto:jranke@uni-bremen.de">jranke@uni-bremen.de</a>
  The functionality of the drc package used under the hood in this function
  was written by Christian Ritz.</p>
    </div>

    <div id="ref-examples">
    <h2>Examples</h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">antifoul</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">r</span> <span class="op">&lt;-</span> <span class="fu">drcfit</span><span class="op">(</span><span class="va">antifoul</span>, showED50 <span class="op">=</span> <span class="cn">TRUE</span>, EDx <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">5</span>, <span class="fl">10</span>, <span class="fl">20</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> TBT: Fitting data...</span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> </span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> Zn Pyrithion: Fitting data...</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/format.html" class="external-link">format</a></span><span class="op">(</span><span class="va">r</span>, digits <span class="op">=</span> <span class="fl">2</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span>      Substance ndl   n  lld lhd  mtype logED50  2.5%  97.5%   unit sigma    a</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1          TBT  38 135 -2.7 2.4 probit   -0.16 -0.28 -0.072 microM  0.19 0.68</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 Zn Pyrithion  27  81 -2.1 2.0 probit   -0.40 -0.52 -0.303 microM  0.23 0.40</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>       b ED50 ED50 2.5% ED50 97.5%  EDx5 EDx5 2.5% EDx5 97.5% EDx10 EDx10 2.5%</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 -0.64 0.68      0.52       0.85 0.053     0.015      0.091 0.093      0.040</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 -1.04 0.40      0.30       0.50 0.082     0.023      0.142 0.117      0.048</span>
<span class="r-out co"><span class="r-pr">#&gt;</span>   EDx10 97.5% EDx20 EDx20 2.5% EDx20 97.5%</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1        0.15  0.18       0.11        0.26</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2        0.19  0.18       0.10        0.26</span>
</code></pre></div>
    </div>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
    <nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
    </nav></div>
</div>


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

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

      </footer></div>

  


  

  </body></html>

Contact - Imprint