From d518c4cfa22994db5ba81a6b01c6cb4c4186872e Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 15 Apr 2020 20:42:29 +0200 Subject: Adapt endpoint() to also work for nlme.mmkin objects --- docs/reference/endpoints.html | 29 ++++++++++++++++++++++------- docs/reference/nlme.mmkin.html | 29 ++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 10 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/endpoints.html b/docs/reference/endpoints.html index 68af5fcf..ef38c521 100644 --- a/docs/reference/endpoints.html +++ b/docs/reference/endpoints.html @@ -154,13 +154,17 @@ advantage that the SFORB model can also be used for metabolites.

fit -

An object of class mkinfit.

+

An object of class mkinfit or +nlme.mmkin

Value

-

A list with the components mentioned above.

+

A list with a matrix of dissipation times named distimes, + and, if applicable, a vector of formation fractions named ff + and, if the SFORB model was in use, a vector of eigenvalues + of these SFORB models, equivalent to DFOP rate constants

Note

The function is used internally by summary.mkinfit.

@@ -168,13 +172,24 @@ advantage that the SFORB model can also be used for metabolites.

Examples

fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) - endpoints(fit)
#> $ff -#> logical(0) -#> -#> $distimes + endpoints(fit)
#> $distimes #> DT50 DT90 DT50back #> parent 1.785233 15.1479 4.559973 -#>
+#>
# \dontrun{ + fit_2 <- mkinfit("SFORB", FOCUS_2006_C, quiet = TRUE) + endpoints(fit_2)
#> $ff +#> parent_free_sink +#> 1 +#> +#> $SFORB +#> parent_b1 parent_b2 +#> 0.4595574 0.0178488 +#> +#> $distimes +#> DT50 DT90 DT50_parent_b1 DT50_parent_b2 +#> parent 1.886925 21.25106 1.508293 38.83438 +#>
# } +
#> $distimes +#> DT50 DT90 +#> parent 11.96183 39.73634 +#>
f_nlme <- nlme(f) print(f_nlme)
#> Nonlinear mixed-effects model fit by maximum likelihood #> Model: value ~ deg_func(name, time, parent_0, log_k_parent_sink) #> Data: "Not shown" @@ -270,7 +273,10 @@ parameters taken from the mmkin object are used

#> StdDev: 1.30857 1.288591 6.304906 #> #> Number of Observations: 90 -#> Number of Groups: 5
f_nlme_2 <- nlme(f, start = c(parent_0 = 100, log_k_parent_sink = 0.1)) +#> Number of Groups: 5
endpoints(f_nlme)
#> $distimes +#> DT50 DT90 +#> parent 17.51545 58.18505 +#>
f_nlme_2 <- nlme(f, start = c(parent_0 = 100, log_k_parent_sink = 0.1)) update(f_nlme_2, random = parent_0 ~ 1)
#> Nonlinear mixed-effects model fit by maximum likelihood #> Model: value ~ deg_func(name, time, parent_0, log_k_parent_sink) #> Data: "Not shown" @@ -410,7 +416,24 @@ parameters taken from the mmkin object are used

#> f_nlme_fomc_sfo 2 11 818.5149 853.0087 -398.2575 1 vs 2 21.33913 <.0001 #> f_nlme_sfo_sfo 3 9 1085.1821 1113.4042 -533.5910 2 vs 3 270.66712 <.0001
anova(f_nlme_dfop_sfo, f_nlme_sfo_sfo) # if we ignore FOMC
#> Model df AIC BIC logLik Test L.Ratio p-value #> f_nlme_dfop_sfo 1 13 843.8541 884.6194 -408.927 -#> f_nlme_sfo_sfo 2 9 1085.1821 1113.4042 -533.591 1 vs 2 249.328 <.0001
# } +#> f_nlme_sfo_sfo 2 9 1085.1821 1113.4042 -533.591 1 vs 2 249.328 <.0001
+ endpoints(f_nlme_sfo_sfo)
#> $ff +#> parent_sink parent_A1 A1_sink +#> 0.5912435 0.4087565 1.0000000 +#> +#> $distimes +#> DT50 DT90 +#> parent 19.13517 63.56565 +#> A1 66.02149 219.31865 +#>
endpoints(f_nlme_dfop_sfo)
#> $ff +#> parent_A1 parent_sink A1_sink +#> 0.2768571 0.7231429 1.0000000 +#> +#> $distimes +#> DT50 DT90 DT50_k1 DT50_k2 +#> parent 11.07092 104.6325 4.462389 46.2085 +#> A1 162.30937 539.1801 NA NA +#>
# }