aboutsummaryrefslogblamecommitdiff
path: root/docs/reference/nlme.mmkin.html
blob: af3b712cf32c072cefb16de8e2e815acfff6274d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12










                                                                                   
                                                                                                                                                                                 
                  
                                                                                                                                                                                                             
 



                                                                                                                                                                                                  
                           
                                                                                                                                                                                                        
                     
                                                                                                                                                                                          
                    
                                                                                                                                                                                             










                                                                                                                















                                                                                                                                                                                                    
                                             











                                                                                                                               
                                                                                                                                        


































                                                                                                                             

                                                                               





                                              
            
                                            


                                                    












                                                         
                                                                                                                                                 








                                                                              














                                                                                                                                                                                                                                                                                                                   
                                                  
                                                                                                                                                                                     
                                                  
                                                                                                                                                                                                   








                                                                                               
                                                                  


















































                                                                    










                                                                 



                                                                                   
                            
                                                                                            
                                                                                                    
                                                                                            




                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                              


                                                                                                                                                                                                                                                        
                                 

                                                    
                     
                                                    
                          
                                            
                                
                                                                                                                                                                                                 
                              
                              
                                                                  


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                          
                                 

                                                    


                                  
                                  
                                
                                                                                                     

















                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                    
                                                                                                                                                                                                                                                                                                                                      
                                                    

                                                                                                                                                                                                                                                                                                                                          
                                                                                                  

                                                                                                                                                                                                                                                                                                                                                                                               
                   
                                                       
                                                             
                                                             
                                                          
                                                                             

                                                                   
                          



                                                                            
                                                                            
                                                          
                                                                             
                                                                   
                                



                                                                            
                                                                            
                                                          
                                                                            

                                                                   
                                


                                                       
                                                                            
                                                                            
                                                          
                                                                             

                                                                   

                                                                                                                                                                                                                                                                                                                                                                                               
                   
                                                       
                                                                        
                                                                        
                                                          
                                                                                         

                                                                   
                          



                                                                                    
                                                                                    
                                                          
                                                                                         

                                                                   











                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                
                                                                                                                                                        
                                          
                                          
               

                              
                                                                                                                                                                                        
                              
               


                                                          
            
        


                                                                 








                                     
                                                                                










               
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
  <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>Create an nlme model for an mmkin row object — nlme.mmkin • mkin</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="Create an nlme model for an mmkin row object — nlme.mmkin" />
<meta property="og:description" content="This functions sets up a nonlinear mixed effects model for an mmkin row
object. An mmkin row object is essentially a list of mkinfit objects that
have been obtained by fitting the same model to a list of datasets." />




<!-- 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">mkin</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../reference/index.html">Functions and data</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li>
      <a href="../articles/mkin.html">Introduction to mkin</a>
    </li>
    <li>
      <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a>
    </li>
    <li>
      <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a>
    </li>
    <li>
      <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
    </li>
    <li>
      <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a>
    </li>
    <li>
      <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a>
    </li>
    <li>
      <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
    </li>
    <li>
      <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
    </li>
  </ul>
</li>
<li>
  <a href="../news/index.html">News</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://github.com/jranke/mkin/">
    <span class="fab fa fab fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
      
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      

      </header>

<div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Create an nlme model for an mmkin row object</h1>
    <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/nlme.mmkin.R'><code>R/nlme.mmkin.R</code></a></small>
    <div class="hidden name"><code>nlme.mmkin.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>This functions sets up a nonlinear mixed effects model for an mmkin row
object. An mmkin row object is essentially a list of mkinfit objects that
have been obtained by fitting the same model to a list of datasets.</p>
    </div>

    <pre class="usage"><span class='co'># S3 method for mmkin</span>
<span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span>
  <span class='va'>model</span>,
  data <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.frame</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.parent</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>,
  <span class='va'>fixed</span>,
  random <span class='op'>=</span> <span class='va'>fixed</span>,
  <span class='va'>groups</span>,
  <span class='va'>start</span>,
  correlation <span class='op'>=</span> <span class='cn'>NULL</span>,
  weights <span class='op'>=</span> <span class='cn'>NULL</span>,
  <span class='va'>subset</span>,
  method <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"ML"</span>, <span class='st'>"REML"</span><span class='op'>)</span>,
  na.action <span class='op'>=</span> <span class='va'>na.fail</span>,
  <span class='va'>naPattern</span>,
  control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='op'>)</span>,
  verbose <span class='op'>=</span> <span class='cn'>FALSE</span>
<span class='op'>)</span>

<span class='co'># S3 method for nlme.mmkin</span>
<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>

<span class='co'># S3 method for nlme.mmkin</span>
<span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</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>model</th>
      <td><p>An <code><a href='mmkin.html'>mmkin</a></code> row object.</p></td>
    </tr>
    <tr>
      <th>data</th>
      <td><p>Ignored, data are taken from the mmkin model</p></td>
    </tr>
    <tr>
      <th>fixed</th>
      <td><p>Ignored, all degradation parameters fitted in the
mmkin model are used as fixed parameters</p></td>
    </tr>
    <tr>
      <th>random</th>
      <td><p>If not specified, all fixed effects are complemented
with uncorrelated random effects</p></td>
    </tr>
    <tr>
      <th>groups</th>
      <td><p>See the documentation of nlme</p></td>
    </tr>
    <tr>
      <th>start</th>
      <td><p>If not specified, mean values of the fitted degradation
parameters taken from the mmkin object are used</p></td>
    </tr>
    <tr>
      <th>correlation</th>
      <td><p>See the documentation of nlme</p></td>
    </tr>
    <tr>
      <th>weights</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>subset</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>method</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>na.action</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>naPattern</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>control</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>verbose</th>
      <td><p>passed to nlme</p></td>
    </tr>
    <tr>
      <th>x</th>
      <td><p>An nlme.mmkin object to print</p></td>
    </tr>
    <tr>
      <th>...</th>
      <td><p>Update specifications passed to update.nlme</p></td>
    </tr>
    <tr>
      <th>object</th>
      <td><p>An nlme.mmkin object to update</p></td>
    </tr>
    </table>

    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>Upon success, a fitted nlme.mmkin object, which is an nlme object
with additional elements</p>
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <div class='dont-index'><p><code><a href='nlme_function.html'>nlme_function</a></code></p></div>

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='va'>ds</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>,
 <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span>, <span class='va'>name</span> <span class='op'>==</span> <span class='st'>"parent"</span><span class='op'>)</span><span class='op'>)</span>
<span class='va'>f</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p =  0.0195</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p =  0.011</span></div><div class='input'><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme'>nlme</a></span><span class='op'>)</span>
<span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; $distimes
#&gt;            DT50     DT90
#&gt; parent 11.96183 39.73634
#&gt; </div><div class='input'><span class='va'>f_nlme</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span>
<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
#&gt;   Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent) 
#&gt;   Data: "Not shown" 
#&gt;   Log-likelihood: -307.5269
#&gt;   Fixed: list(parent_0 ~ 1, log_k_parent ~ 1) 
#&gt;     parent_0 log_k_parent 
#&gt;    85.541149    -3.229596 
#&gt; 
#&gt; Random effects:
#&gt;  Formula: list(parent_0 ~ 1, log_k_parent ~ 1)
#&gt;  Level: ds
#&gt;  Structure: Diagonal
#&gt;         parent_0 log_k_parent Residual
#&gt; StdDev:  1.30857     1.288591 6.304906
#&gt; 
#&gt; Number of Observations: 90
#&gt; Number of Groups: 5 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span>
</div><div class='output co'>#&gt; $distimes
#&gt;            DT50     DT90
#&gt; parent 17.51545 58.18505
#&gt; </div><div class='input'><span class='co'># \dontrun{</span>
  <span class='va'>f_nlme_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span>, start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, log_k_parent_sink <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</span><span class='op'>)</span>
  <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_nlme_2</span>, random <span class='op'>=</span> <span class='va'>parent_0</span> <span class='op'>~</span> <span class='fl'>1</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
#&gt;   Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent) 
#&gt;   Data: "Not shown" 
#&gt;   Log-likelihood: -404.3729
#&gt;   Fixed: list(parent_0 ~ 1, log_k_parent ~ 1) 
#&gt;     parent_0 log_k_parent 
#&gt;    75.933480    -3.555983 
#&gt; 
#&gt; Random effects:
#&gt;  Formula: parent_0 ~ 1 | ds
#&gt;            parent_0 Residual
#&gt; StdDev: 0.002416792 21.63027
#&gt; 
#&gt; Number of Observations: 90
#&gt; Number of Groups: 5 </div><div class='input'>  <span class='co'># Test on some real data</span>
  <span class='va'>ds_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>,
   <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span>
  <span class='va'>m_sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
    A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
  <span class='va'>m_sfo_sfo_ff</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
    A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
  <span class='va'>m_fomc_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
    A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
  <span class='va'>m_dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
    A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>

  <span class='va'>f_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>,
   <span class='st'>"SFO-SFO-ff"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo_ff</span>,
   <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>m_fomc_sfo</span>,
   <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>,
    <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> <span class='co'># Separate fits for datasets 3 and 4</span>
</div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'>
  <span class='va'>f_nlme_sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
  <span class='co'># plot(f_nlme_sfo_sfo) # not feasible with pkgdown figures</span>
  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># Global mixed model: Fits for datasets 3 and 4</span>
</div><div class='img'><img src='nlme.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'>
  <span class='co'># With formation fractions</span>
  <span class='va'>f_nlme_sfo_sfo_ff</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO-ff"</span>, <span class='op'>]</span><span class='op'>)</span>
  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_ff</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># chi2 different due to different df attribution</span>
</div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'>
  <span class='co'># For more parameters, we need to increase pnlsMaxIter and the tolerance</span>
  <span class='co'># to get convergence</span>
  <span class='va'>f_nlme_fomc_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='op'>]</span>,
    control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>100</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
</div><div class='output co'>#&gt; 
#&gt; **Iteration 1
#&gt; LME step: Loglik: -394.1603, nlminb iterations: 3
#&gt; reStruct  parameters:
#&gt;        ds1        ds2        ds3        ds4        ds5 
#&gt; -0.2079793  0.8563830  1.7454105  1.0917354  1.2756825 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  643.8803 
#&gt;  fixed effects: 94.17379  -5.473193  -0.6970236  -0.2025091  2.103883  
#&gt;  iterations: 100 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
#&gt;     fixed  reStruct 
#&gt; 0.7960134 0.1447728 
#&gt; 
#&gt; **Iteration 2
#&gt; LME step: Loglik: -396.3824, nlminb iterations: 7
#&gt; reStruct  parameters:
#&gt;           ds1           ds2           ds3           ds4           ds5 
#&gt; -1.712404e-01 -2.432655e-05  1.842120e+00  1.073975e+00  1.322925e+00 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  643.8035 
#&gt;  fixed effects: 94.17385  -5.473487  -0.6970404  -0.2025137  2.103871  
#&gt;  iterations: 100 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
#&gt;        fixed     reStruct 
#&gt; 5.382757e-05 1.236667e-03 
#&gt; 
#&gt; **Iteration 3
#&gt; LME step: Loglik: -396.3825, nlminb iterations: 7
#&gt; reStruct  parameters:
#&gt;           ds1           ds2           ds3           ds4           ds5 
#&gt; -0.1712499044 -0.0001499831  1.8420971364  1.0739799123  1.3229167796 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  643.7948 
#&gt;  fixed effects: 94.17386  -5.473521  -0.6970422  -0.2025144  2.10387  
#&gt;  iterations: 100 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
#&gt;        fixed     reStruct 
#&gt; 6.072817e-06 1.400857e-04 
#&gt; 
#&gt; **Iteration 4
#&gt; LME step: Loglik: -396.3825, nlminb iterations: 7
#&gt; reStruct  parameters:
#&gt;           ds1           ds2           ds3           ds4           ds5 
#&gt; -0.1712529502 -0.0001641277  1.8420957542  1.0739797181  1.3229173076 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  643.7936 
#&gt;  fixed effects: 94.17386  -5.473526  -0.6970426  -0.2025146  2.103869  
#&gt;  iterations: 100 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
#&gt;        fixed     reStruct 
#&gt; 1.027451e-06 2.275704e-05 </div><div class='input'>  <span class='va'>f_nlme_dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span>,
    control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>120</span>, tolerance <span class='op'>=</span> <span class='fl'>5e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
</div><div class='output co'>#&gt; 
#&gt; **Iteration 1
#&gt; LME step: Loglik: -404.9582, nlminb iterations: 1
#&gt; reStruct  parameters:
#&gt;        ds1        ds2        ds3        ds4        ds5        ds6 
#&gt; -0.4114355  0.9798697  1.6990037  0.7293315  0.3354323  1.7113046 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  630.3644 
#&gt;  fixed effects: 93.82269  -5.455991  -0.6788957  -1.862196  -4.199671  0.05532828  
#&gt;  iterations: 120 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0005):
#&gt;     fixed  reStruct 
#&gt; 0.7885368 0.5822683 
#&gt; 
#&gt; **Iteration 2
#&gt; LME step: Loglik: -407.7755, nlminb iterations: 11
#&gt; reStruct  parameters:
#&gt;          ds1          ds2          ds3          ds4          ds5          ds6 
#&gt; -0.371224133  0.003056179  1.789939402  0.724671158  0.301602977  1.754200729 
#&gt;  Beginning PNLS step: ..  completed fit_nlme() step.
#&gt; PNLS step: RSS =  630.3633 
#&gt;  fixed effects: 93.82269  -5.455992  -0.6788958  -1.862196  -4.199671  0.05532831  
#&gt;  iterations: 120 
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0005):
#&gt;        fixed     reStruct 
#&gt; 4.789774e-07 2.200661e-05 </div><div class='input'>  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
</div><div class='img'><img src='nlme.mmkin-4.png' alt='' width='700' height='433' /></div><div class='input'>  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_fomc_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
</div><div class='img'><img src='nlme.mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'>
  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
</div><div class='img'><img src='nlme.mmkin-6.png' alt='' width='700' height='433' /></div><div class='input'>  <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
</div><div class='img'><img src='nlme.mmkin-7.png' alt='' width='700' height='433' /></div><div class='input'>
  <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_fomc_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span>
</div><div class='output co'>#&gt;                 Model df       AIC       BIC    logLik   Test   L.Ratio p-value
#&gt; f_nlme_dfop_sfo     1 13  843.8547  884.6201 -408.9273                         
#&gt; f_nlme_fomc_sfo     2 11  818.5149  853.0087 -398.2575 1 vs 2  21.33975  &lt;.0001
#&gt; f_nlme_sfo_sfo      3  9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716  &lt;.0001</div><div class='input'>  <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> <span class='co'># if we ignore FOMC</span>
</div><div class='output co'>#&gt;                 Model df       AIC       BIC    logLik   Test  L.Ratio p-value
#&gt; f_nlme_dfop_sfo     1 13  843.8547  884.6201 -408.9273                        
#&gt; f_nlme_sfo_sfo      2  9 1085.1821 1113.4043 -533.5910 1 vs 2 249.3274  &lt;.0001</div><div class='input'>
  <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span>
</div><div class='output co'>#&gt; $ff
#&gt; parent_sink   parent_A1     A1_sink 
#&gt;   0.5912432   0.4087568   1.0000000 
#&gt; 
#&gt; $distimes
#&gt;            DT50     DT90
#&gt; parent 19.13518  63.5657
#&gt; A1     66.02155 219.3189
#&gt; </div><div class='input'>  <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span>
</div><div class='output co'>#&gt; $ff
#&gt;   parent_A1 parent_sink 
#&gt;   0.2768574   0.7231426 
#&gt; 
#&gt; $distimes
#&gt;             DT50     DT90 DT50back  DT50_k1  DT50_k2
#&gt; parent  11.07091 104.6320 31.49738 4.462384 46.20825
#&gt; A1     162.30536 539.1667       NA       NA       NA
#&gt; </div><div class='input'><span class='co'># }</span>
</div></pre>
  </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>Developed by Johannes Ranke.</p>
</div>

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

      </footer>
   </div>

  


  </body>
</html>


Contact - Imprint