diff options
Diffstat (limited to 'docs/dev/reference/confint.mkinfit.html')
-rw-r--r-- | docs/dev/reference/confint.mkinfit.html | 225 |
1 files changed, 123 insertions, 102 deletions
diff --git a/docs/dev/reference/confint.mkinfit.html b/docs/dev/reference/confint.mkinfit.html index 5b683355..745f2dc4 100644 --- a/docs/dev/reference/confint.mkinfit.html +++ b/docs/dev/reference/confint.mkinfit.html @@ -79,7 +79,7 @@ method of Venzon and Moolgavkar (1988)." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.3</span> + <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.4</span> </span> </div> @@ -127,7 +127,7 @@ method of Venzon and Moolgavkar (1988)." /> </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="http://github.com/jranke/mkin/"> + <a href="https://github.com/jranke/mkin/"> <span class="fab fa fab fa-github fa-lg"></span> </a> @@ -146,7 +146,7 @@ method of Venzon and Moolgavkar (1988)." /> <div class="col-md-9 contents"> <div class="page-header"> <h1>Confidence intervals for parameters of mkinfit objects</h1> - <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/confint.mkinfit.R'><code>R/confint.mkinfit.R</code></a></small> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/confint.mkinfit.R'><code>R/confint.mkinfit.R</code></a></small> <div class="hidden name"><code>confint.mkinfit.Rd</code></div> </div> @@ -162,20 +162,20 @@ method of Venzon and Moolgavkar (1988).</p> </div> <pre class="usage"><span class='co'># S3 method for mkinfit</span> -<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>( - <span class='no'>object</span>, - <span class='no'>parm</span>, - <span class='kw'>level</span> <span class='kw'>=</span> <span class='fl'>0.95</span>, - <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>1</span> - <span class='no'>level</span>, - <span class='no'>cutoff</span>, - <span class='kw'>method</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"quadratic"</span>, <span class='st'>"profile"</span>), - <span class='kw'>transformed</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, - <span class='kw'>backtransform</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, - <span class='kw'>cores</span> <span class='kw'>=</span> <span class='kw pkg'>parallel</span><span class='kw ns'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span>(), - <span class='kw'>rel_tol</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, - <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, - <span class='no'>...</span> -)</pre> +<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span> + <span class='va'>object</span>, + <span class='va'>parm</span>, + level <span class='op'>=</span> <span class='fl'>0.95</span>, + alpha <span class='op'>=</span> <span class='fl'>1</span> <span class='op'>-</span> <span class='va'>level</span>, + <span class='va'>cutoff</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'>"quadratic"</span>, <span class='st'>"profile"</span><span class='op'>)</span>, + transformed <span class='op'>=</span> <span class='cn'>TRUE</span>, + backtransform <span class='op'>=</span> <span class='cn'>TRUE</span>, + cores <span class='op'>=</span> <span class='fu'>parallel</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span><span class='op'>(</span><span class='op'>)</span>, + rel_tol <span class='op'>=</span> <span class='fl'>0.01</span>, + quiet <span class='op'>=</span> <span class='cn'>FALSE</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"> @@ -257,68 +257,79 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, 87–94.</p> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> - <pre class="examples"><div class='input'><span class='no'>f</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='st'>"SFO"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>)</div><div class='output co'>#> 2.5% 97.5% + <pre class="examples"><div class='input'><span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>FOCUS_2006_C</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% #> parent_0 71.8242430 93.1600766 #> k_parent 0.2109541 0.4440528 #> sigma 1.9778868 7.3681380</div><div class='input'> <span class='co'># \dontrun{</span> -<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"profile"</span>)</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> 2.5% 97.5% +<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f</span>, method <span class='op'>=</span> <span class='st'>"profile"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> 2.5% 97.5% #> parent_0 73.0641834 92.1392181 #> k_parent 0.2170293 0.4235348 #> sigma 3.1307772 8.0628314</div><div class='input'> <span class='co'># Set the number of cores for the profiling method for further examples</span> -<span class='kw'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span>(<span class='st'>"NOT_CRAN"</span>), <span class='st'>"true"</span>)) { - <span class='no'>n_cores</span> <span class='kw'><-</span> <span class='kw pkg'>parallel</span><span class='kw ns'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span>() - <span class='fl'>1</span> -} <span class='kw'>else</span> { - <span class='no'>n_cores</span> <span class='kw'><-</span> <span class='fl'>1</span> -} -<span class='kw'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span>(<span class='st'>"TRAVIS"</span>) <span class='kw'>!=</span> <span class='st'>""</span>) <span class='no'>n_cores</span> <span class='kw'>=</span> <span class='fl'>1</span> -<span class='kw'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span>()[<span class='st'>"sysname"</span>] <span class='kw'>==</span> <span class='st'>"Windows"</span>) <span class='no'>n_cores</span> <span class='kw'>=</span> <span class='fl'>1</span> - -<span class='no'>SFO_SFO</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>SFO_SFO.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>f_d_1</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>FOCUS_2006_D</span>, <span class='no'>value</span> <span class='kw'>!=</span> <span class='fl'>0</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span>(<span class='no'>ci_profile</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_1</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"profile"</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>))</div><div class='output co'>#> user system elapsed -#> 3.810 0.964 3.430 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> +<span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span><span class='op'>(</span><span class='st'>"NOT_CRAN"</span><span class='op'>)</span>, <span class='st'>"true"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> + <span class='va'>n_cores</span> <span class='op'><-</span> <span class='fu'>parallel</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>1</span> +<span class='op'>}</span> <span class='kw'>else</span> <span class='op'>{</span> + <span class='va'>n_cores</span> <span class='op'><-</span> <span class='fl'>1</span> +<span class='op'>}</span> +<span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span><span class='op'>(</span><span class='st'>"TRAVIS"</span><span class='op'>)</span> <span class='op'>!=</span> <span class='st'>""</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> +<span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='st'>"sysname"</span><span class='op'>]</span> <span class='op'>==</span> <span class='st'>"Windows"</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> + +<span class='va'>SFO_SFO</span> <span class='op'><-</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'>"m1"</span><span class='op'>)</span>, m1 <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'>SFO_SFO.ff</span> <span class='op'><-</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'>"m1"</span><span class='op'>)</span>, m1 <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'>f_d_1</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> user system elapsed +#> 3.829 1.000 3.519 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> <span class='co'># If we additionally exclude parent_0 (the confidence of which is often of</span> <span class='co'># minor interest), we get a nice performance improvement from about 50</span> <span class='co'># seconds to about 12 seconds if we use at least four cores</span> -<span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span>(<span class='no'>ci_profile_no_parent_0</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_1</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"profile"</span>, - <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"k_parent_sink"</span>, <span class='st'>"k_parent_m1"</span>, <span class='st'>"k_m1_sink"</span>, <span class='st'>"sigma"</span>), <span class='kw'>cores</span> <span class='kw'>=</span> <span class='no'>n_cores</span>))</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> <span class='warning'>Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected</span></div><div class='output co'>#> <span class='error'>Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0.015 0.029 0.198</span></div><div class='input'><span class='no'>ci_profile</span></div><div class='output co'>#> 2.5% 97.5% +<span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile_no_parent_0</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"k_parent_sink"</span>, <span class='st'>"k_parent_m1"</span>, <span class='st'>"k_m1_sink"</span>, <span class='st'>"sigma"</span><span class='op'>)</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> <span class='warning'>Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected</span></div><div class='output co'>#> <span class='error'>Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0.011 0.029 0.241</span></div><div class='input'><span class='va'>ci_profile</span> +</div><div class='output co'>#> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892605 6.702778e-03 +#> k_m1 0.003892606 6.702775e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 -#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='no'>ci_quadratic_transformed</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_1</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>) -<span class='no'>ci_quadratic_transformed</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 -#> k_parent 0.090823790 1.072543e-01 -#> k_m1 0.004012216 6.897547e-03 -#> f_parent_to_m1 0.469118713 5.595960e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='no'>ci_quadratic_untransformed</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_1</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>, <span class='kw'>transformed</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) -<span class='no'>ci_quadratic_untransformed</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 -#> k_parent 0.090491931 1.069035e-01 -#> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 +#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +<span class='va'>ci_quadratic_transformed</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403833585 102.79311650 +#> k_parent 0.090823771 0.10725430 +#> k_m1 0.004012219 0.00689755 +#> f_parent_to_m1 0.469118824 0.55959615 +#> sigma 2.396089689 3.85491806</div><div class='input'><span class='va'>ci_quadratic_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> +<span class='va'>ci_quadratic_untransformed</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403833589 1.027931e+02 +#> k_parent 0.090491913 1.069035e-01 +#> k_m1 0.003835485 6.685823e-03 +#> f_parent_to_m1 0.469113477 5.598387e-01 #> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='co'># Against the expectation based on Bates and Watts (1988), the confidence</span> <span class='co'># intervals based on the internal parameter transformation are less</span> <span class='co'># congruent with the likelihood based intervals. Note the superiority of the</span> <span class='co'># interval based on the untransformed fit for k_m1_sink</span> -<span class='no'>rel_diffs_transformed</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span>((<span class='no'>ci_quadratic_transformed</span> - <span class='no'>ci_profile</span>)/<span class='no'>ci_profile</span>) -<span class='no'>rel_diffs_untransformed</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span>((<span class='no'>ci_quadratic_untransformed</span> - <span class='no'>ci_profile</span>)/<span class='no'>ci_profile</span>) -<span class='no'>rel_diffs_transformed</span> <span class='kw'><</span> <span class='no'>rel_diffs_untransformed</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 TRUE TRUE +<span class='va'>rel_diffs_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_transformed</span> <span class='op'>-</span> <span class='va'>ci_profile</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile</span><span class='op'>)</span> +<span class='va'>rel_diffs_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_untransformed</span> <span class='op'>-</span> <span class='va'>ci_profile</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile</span><span class='op'>)</span> +<span class='va'>rel_diffs_transformed</span> <span class='op'><</span> <span class='va'>rel_diffs_untransformed</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 FALSE FALSE #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span>(<span class='no'>rel_diffs_transformed</span>, <span class='fl'>3</span>)</div><div class='output co'>#> 2.5% 97.5% +#> sigma TRUE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_transformed</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% #> parent_0 0.000541 0.000222 #> k_parent 0.000960 0.000900 #> k_m1 0.030700 0.029100 #> f_parent_to_m1 0.004690 0.002780 -#> sigma 0.055000 0.032700</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span>(<span class='no'>rel_diffs_untransformed</span>, <span class='fl'>3</span>)</div><div class='output co'>#> 2.5% 97.5% +#> sigma 0.055000 0.032700</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_untransformed</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% #> parent_0 0.000541 0.000222 #> k_parent 0.004610 0.002370 #> k_m1 0.014700 0.002530 @@ -326,66 +337,76 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, #> sigma 0.055000 0.032700</div><div class='input'> <span class='co'># Investigate a case with formation fractions</span> -<span class='no'>f_d_2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>FOCUS_2006_D</span>, <span class='no'>value</span> <span class='kw'>!=</span> <span class='fl'>0</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0165</span></div><div class='input'><span class='no'>ci_profile_ff</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_2</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"profile"</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='no'>n_cores</span>)</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='input'><span class='no'>ci_profile_ff</span></div><div class='output co'>#> 2.5% 97.5% +<span class='va'>f_d_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.ff</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>ci_profile_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='input'><span class='va'>ci_profile_ff</span> +</div><div class='output co'>#> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892605 6.702778e-03 +#> k_m1 0.003892606 6.702775e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 -#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='no'>ci_quadratic_transformed_ff</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_2</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>) -<span class='no'>ci_quadratic_transformed_ff</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 -#> k_parent 0.090823790 1.072543e-01 -#> k_m1 0.004012216 6.897547e-03 -#> f_parent_to_m1 0.469118713 5.595960e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='no'>ci_quadratic_untransformed_ff</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_d_2</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>, <span class='kw'>transformed</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) -<span class='no'>ci_quadratic_untransformed_ff</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 -#> k_parent 0.090491931 1.069035e-01 -#> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='no'>rel_diffs_transformed_ff</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span>((<span class='no'>ci_quadratic_transformed_ff</span> - <span class='no'>ci_profile_ff</span>)/<span class='no'>ci_profile_ff</span>) -<span class='no'>rel_diffs_untransformed_ff</span> <span class='kw'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span>((<span class='no'>ci_quadratic_untransformed_ff</span> - <span class='no'>ci_profile_ff</span>)/<span class='no'>ci_profile_ff</span>) +#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +<span class='va'>ci_quadratic_transformed_ff</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403833585 102.79311650 +#> k_parent 0.090823771 0.10725430 +#> k_m1 0.004012219 0.00689755 +#> f_parent_to_m1 0.469118824 0.55959615 +#> sigma 2.396089689 3.85491806</div><div class='input'><span class='va'>ci_quadratic_untransformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> +<span class='va'>ci_quadratic_untransformed_ff</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403833589 1.027931e+02 +#> k_parent 0.090491913 1.069035e-01 +#> k_m1 0.003835485 6.685823e-03 +#> f_parent_to_m1 0.469113477 5.598387e-01 +#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='va'>rel_diffs_transformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_transformed_ff</span> <span class='op'>-</span> <span class='va'>ci_profile_ff</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile_ff</span><span class='op'>)</span> +<span class='va'>rel_diffs_untransformed_ff</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_untransformed_ff</span> <span class='op'>-</span> <span class='va'>ci_profile_ff</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile_ff</span><span class='op'>)</span> <span class='co'># While the confidence interval for the parent rate constant is closer to</span> <span class='co'># the profile based interval when using the internal parameter</span> <span class='co'># transformation, the interval for the metabolite rate constant is 'better</span> <span class='co'># without internal parameter transformation.</span> -<span class='no'>rel_diffs_transformed_ff</span> <span class='kw'><</span> <span class='no'>rel_diffs_untransformed_ff</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 TRUE TRUE +<span class='va'>rel_diffs_transformed_ff</span> <span class='op'><</span> <span class='va'>rel_diffs_untransformed_ff</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 FALSE FALSE #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE</div><div class='input'><span class='no'>rel_diffs_transformed_ff</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.0005408080 0.0002217794 -#> k_parent 0.0009596417 0.0009003876 -#> k_m1 0.0307277370 0.0290579182 -#> f_parent_to_m1 0.0046884130 0.0027782556 -#> sigma 0.0550252516 0.0327066836</div><div class='input'><span class='no'>rel_diffs_untransformed_ff</span></div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.0005408085 0.0002217799 -#> k_parent 0.0046100096 0.0023730229 -#> k_m1 0.0146746469 0.0025301011 -#> f_parent_to_m1 0.0046997599 0.0023460223 +#> sigma TRUE FALSE</div><div class='input'><span class='va'>rel_diffs_transformed_ff</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 0.0005408689 0.0002217234 +#> k_parent 0.0009598532 0.0009001864 +#> k_m1 0.0307283044 0.0290588365 +#> f_parent_to_m1 0.0046881768 0.0027780063 +#> sigma 0.0550252516 0.0327066836</div><div class='input'><span class='va'>rel_diffs_untransformed_ff</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 0.0005408689 0.0002217233 +#> k_parent 0.0046102155 0.0023732281 +#> k_m1 0.0146740688 0.0025291817 +#> f_parent_to_m1 0.0046995211 0.0023457712 #> sigma 0.0550252516 0.0327066836</div><div class='input'> <span class='co'># The profiling for the following fit does not finish in a reasonable time,</span> <span class='co'># therefore we use the quadratic approximation</span> -<span class='no'>m_synth_DFOP_par</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"DFOP"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</span>)), - <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>M2</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='no'>DFOP_par_c</span> <span class='kw'><-</span> <span class='no'>synthetic_data_for_UBA_2014</span><span class='kw'>[[</span><span class='fl'>12</span>]]$<span class='no'>data</span> -<span class='no'>f_tc_2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>m_synth_DFOP_par</span>, <span class='no'>DFOP_par_c</span>, <span class='kw'>error_model</span> <span class='kw'>=</span> <span class='st'>"tc"</span>, - <span class='kw'>error_model_algorithm</span> <span class='kw'>=</span> <span class='st'>"direct"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_tc_2</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>)</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 94.59613833 106.19939215 -#> k_M1 0.03760542 0.04490759 -#> k_M2 0.00856874 0.01087675 -#> f_parent_to_M1 0.02146166 0.62023888 -#> f_parent_to_M2 0.01516502 0.37975343 -#> k1 0.27389751 0.33388078 -#> k2 0.01861456 0.02250379 -#> g 0.67194349 0.73583256 -#> sigma_low 0.25128383 0.83992146 -#> rsd_high 0.04041100 0.07662001</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span>(<span class='no'>f_tc_2</span>, <span class='st'>"parent_0"</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"quadratic"</span>)</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 94.59614 106.1994</div><div class='input'># } +<span class='va'>m_synth_DFOP_par</span> <span class='op'><-</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='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span><span class='op'>)</span>, + M1 <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>, + M2 <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'>DFOP_par_c</span> <span class='op'><-</span> <span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[[</span><span class='fl'>12</span><span class='op'>]</span><span class='op'>]</span><span class='op'>$</span><span class='va'>data</span> +<span class='va'>f_tc_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>m_synth_DFOP_par</span>, <span class='va'>DFOP_par_c</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, + error_model_algorithm <span class='op'>=</span> <span class='st'>"direct"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_tc_2</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 94.596126334 106.19944007 +#> k_M1 0.037605408 0.04490759 +#> k_M2 0.008568739 0.01087675 +#> f_parent_to_M1 0.021463787 0.62023881 +#> f_parent_to_M2 0.015166531 0.37975349 +#> k1 0.273897467 0.33388084 +#> k2 0.018614555 0.02250379 +#> g 0.671943606 0.73583278 +#> sigma_low 0.251283766 0.83992113 +#> rsd_high 0.040411014 0.07662005</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_tc_2</span>, <span class='st'>"parent_0"</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 94.59613 106.1994</div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> @@ -402,7 +423,7 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> </div> </footer> |