From a5874ab7fce4616e80be69366ff0685332f47bf1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 27 Oct 2020 15:34:14 +0100 Subject: Add summary method for nlme.mmkin objects Improve and update docs --- docs/dev/reference/summary.nlme.mmkin.html | 446 +++++++++++++++++++++++++++++ 1 file changed, 446 insertions(+) create mode 100644 docs/dev/reference/summary.nlme.mmkin.html (limited to 'docs/dev/reference/summary.nlme.mmkin.html') diff --git a/docs/dev/reference/summary.nlme.mmkin.html b/docs/dev/reference/summary.nlme.mmkin.html new file mode 100644 index 00000000..38f53122 --- /dev/null +++ b/docs/dev/reference/summary.nlme.mmkin.html @@ -0,0 +1,446 @@ + + + + + + + + +Summary method for class "nlme.mmkin" — summary.nlme.mmkin • mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

Lists model equations, initial parameter values, optimised parameters +for fixed effects (population), random effects (deviations from the +population mean) and residual error model, as well as the resulting +endpoints such as formation fractions and DT50 values. Optionally +(default is FALSE), the data are listed in full.

+
+ +
# S3 method for nlme.mmkin
+summary(
+  object,
+  data = FALSE,
+  verbose = FALSE,
+  distimes = TRUE,
+  alpha = 0.05,
+  ...
+)
+
+# S3 method for summary.nlme.mmkin
+print(x, digits = max(3, getOption("digits") - 3), verbose = x$verbose, ...)
+ +

Arguments

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
object

an object of class nlme.mmkin

data

logical, indicating whether the full data should be included in +the summary.

verbose

Should the summary be verbose?

distimes

logical, indicating whether DT50 and DT90 values should be +included.

alpha

error level for confidence interval estimation from the t +distribution

...

optional arguments passed to methods like print.

x

an object of class summary.nlme.mmkin

digits

Number of digits to use for printing

+ +

Value

+ +

The summary function returns a list based on the nlme object +obtained in the fit, with at least the following additional components

+
nlmeversion, mkinversion, Rversion

The nlme, mkin and R versions used

+
date.fit, date.summary

The dates where the fit and the summary were +produced

+
diffs

The differential equations used in the degradation model

+
use_of_ff

Was maximum or minimum use made of formation fractions

+
data

The data

+
confint_trans

Transformed parameters as used in the optimisation, with confidence intervals

+
confint_back

Backtransformed parameters, with confidence intervals if available

+
ff

The estimated formation fractions derived from the fitted +model.

+
distimes

The DT50 and DT90 values for each observed variable.

+
SFORB

If applicable, eigenvalues of SFORB components of the model.

+The print method is called for its side effect, i.e. printing the summary. + +

Author

+ +

Johannes Ranke for the mkin specific parts +José Pinheiro and Douglas Bates for the components inherited from nlme

+ +

Examples

+
+# Generate five datasets following SFO kinetics +sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) +dt50_sfo_in_pop <- 50 +k_in_pop <- log(2) / dt50_sfo_in_pop +set.seed(1234) +k_in <- rlnorm(5, log(k_in_pop), 0.5) +SFO <- mkinmod(parent = mkinsub("SFO")) + +pred_sfo <- function(k) { + mkinpredict(SFO, + c(k_parent = k), + c(parent = 100), + sampling_times) +} + +ds_sfo_mean <- lapply(k_in, pred_sfo) +names(ds_sfo_mean) <- paste("ds", 1:5) + +ds_sfo_syn <- lapply(ds_sfo_mean, function(ds) { + add_err(ds, + sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2), + n = 1)[[1]] +}) + +# Evaluate using mmkin and nlme +library(nlme) +f_mmkin <- mmkin("SFO", ds_sfo_syn, quiet = TRUE, error_model = "tc", cores = 1) +
#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.00371
f_nlme <- nlme(f_mmkin) +
#> Warning: Iteration 3, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)
summary(f_nlme, data = TRUE) +
#> nlme version used for fitting: 3.1.150.1 +#> mkin version used for pre-fitting: 0.9.50.4 +#> R version used for fitting: 4.0.3 +#> Date of fit: Tue Oct 27 15:25:23 2020 +#> Date of summary: Tue Oct 27 15:25:23 2020 +#> +#> Equations: +#> d_parent/dt = - k_parent * parent +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Model predictions using solution type analytical +#> +#> Fitted in 0.581 s using 5 iterations +#> +#> Variance model: Two-component variance function +#> +#> Mean of starting values for individual parameters: +#> parent_0 log_k_parent +#> 97.849556 -4.455036 +#> +#> Fixed degradation parameter values: +#> None +#> +#> Results: +#> +#> AIC BIC logLik +#> 555.792 570.7908 -271.896 +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> lower est. upper +#> parent_0 94.701336 97.763446 100.82556 +#> log_k_parent -5.007574 -4.461767 -3.91596 +#> +#> Correlation: +#> prnt_0 +#> log_k_parent 0.024 +#> +#> Backtransformed parameters with asymmetric confidence intervals: +#> lower est. upper +#> parent_0 94.701335804 97.76344625 100.82555670 +#> k_parent 0.006687109 0.01154195 0.01992142 +#> Random effects: +#> Formula: list(parent_0 ~ 1, log_k_parent ~ 1) +#> Level: ds +#> Structure: Diagonal +#> parent_0 log_k_parent Residual +#> StdDev: 16.65969 3.516961 5.709013 +#> +#> Variance function: +#> Structure: Constant plus proportion of variance covariate +#> Formula: ~fitted(.) +#> Parameter estimates: +#> const prop +#> 1.55075176 0.05680853 +#> +#> Estimated disappearance times: +#> DT50 DT90 +#> parent 60.05 199.5 +#> +#> Data: +#> ds name time observed predicted residual std standardized +#> ds 1 parent 0 103.6 97.42 6.17540 5.748 1.074413 +#> ds 1 parent 0 95.9 97.42 -1.52460 5.748 -0.265253 +#> ds 1 parent 1 95.4 96.72 -1.31719 5.709 -0.230721 +#> ds 1 parent 1 95.3 96.72 -1.41719 5.709 -0.248237 +#> ds 1 parent 3 91.6 95.32 -3.71774 5.633 -0.660046 +#> ds 1 parent 3 94.5 95.32 -0.81774 5.633 -0.145181 +#> ds 1 parent 7 88.1 92.58 -4.47930 5.483 -0.816920 +#> ds 1 parent 7 89.6 92.58 -2.97930 5.483 -0.543355 +#> ds 1 parent 14 90.3 87.97 2.32502 5.233 0.444318 +#> ds 1 parent 14 96.0 87.97 8.02502 5.233 1.533602 +#> ds 1 parent 28 80.2 79.44 0.75809 4.772 0.158862 +#> ds 1 parent 28 77.9 79.44 -1.54191 4.772 -0.323118 +#> ds 1 parent 60 59.3 62.92 -3.61742 3.896 -0.928458 +#> ds 1 parent 60 59.6 62.92 -3.31742 3.896 -0.851459 +#> ds 1 parent 90 59.4 50.56 8.83825 3.264 2.707613 +#> ds 1 parent 90 51.0 50.56 0.43825 3.264 0.134260 +#> ds 1 parent 120 38.8 40.63 -1.83247 2.781 -0.658968 +#> ds 1 parent 120 38.9 40.63 -1.73247 2.781 -0.623007 +#> ds 2 parent 0 103.2 97.17 6.02995 5.734 1.051655 +#> ds 2 parent 0 95.1 97.17 -2.07005 5.734 -0.361027 +#> ds 2 parent 1 88.3 95.59 -7.28901 5.647 -1.290694 +#> ds 2 parent 1 102.4 95.59 6.81099 5.647 1.206048 +#> ds 2 parent 3 88.4 92.50 -4.10371 5.479 -0.748984 +#> ds 2 parent 3 95.2 92.50 2.69629 5.479 0.492110 +#> ds 2 parent 7 83.5 86.63 -3.12863 5.160 -0.606349 +#> ds 2 parent 7 96.4 86.63 9.77137 5.160 1.893751 +#> ds 2 parent 14 77.3 77.23 0.06920 4.653 0.014871 +#> ds 2 parent 14 76.0 77.23 -1.23080 4.653 -0.264497 +#> ds 2 parent 28 61.7 61.38 0.31692 3.816 0.083043 +#> ds 2 parent 28 56.5 61.38 -4.88308 3.816 -1.279513 +#> ds 2 parent 60 35.1 36.31 -1.21343 2.581 -0.470178 +#> ds 2 parent 60 32.2 36.31 -4.11343 2.581 -1.593868 +#> ds 2 parent 90 21.2 22.20 -0.99906 1.999 -0.499832 +#> ds 2 parent 90 23.3 22.20 1.10094 1.999 0.550800 +#> ds 2 parent 120 14.1 13.57 0.52931 1.732 0.305638 +#> ds 2 parent 120 16.9 13.57 3.32931 1.732 1.922443 +#> ds 3 parent 0 92.4 94.12 -1.71979 5.567 -0.308917 +#> ds 3 parent 0 94.0 94.12 -0.11979 5.567 -0.021517 +#> ds 3 parent 1 95.7 91.97 3.72634 5.450 0.683712 +#> ds 3 parent 1 90.8 91.97 -1.17366 5.450 -0.215343 +#> ds 3 parent 3 86.7 87.83 -1.12709 5.225 -0.215720 +#> ds 3 parent 3 85.8 87.83 -2.02709 5.225 -0.387976 +#> ds 3 parent 7 77.1 80.09 -2.98635 4.807 -0.621300 +#> ds 3 parent 7 81.5 80.09 1.41365 4.807 0.294104 +#> ds 3 parent 14 69.1 68.15 0.95467 4.170 0.228922 +#> ds 3 parent 14 62.4 68.15 -5.74533 4.170 -1.377682 +#> ds 3 parent 28 49.1 49.34 -0.23911 3.203 -0.074644 +#> ds 3 parent 28 47.2 49.34 -2.13911 3.203 -0.667787 +#> ds 3 parent 60 21.9 23.58 -1.68477 2.049 -0.822090 +#> ds 3 parent 60 23.6 23.58 0.01523 2.049 0.007431 +#> ds 3 parent 90 12.4 11.81 0.59388 1.690 0.351500 +#> ds 3 parent 90 13.8 11.81 1.99388 1.690 1.180112 +#> ds 3 parent 120 4.9 5.91 -1.00993 1.587 -0.636506 +#> ds 3 parent 120 7.5 5.91 1.59007 1.587 1.002137 +#> ds 4 parent 0 91.8 101.72 -9.92097 5.983 -1.658171 +#> ds 4 parent 0 104.6 101.72 2.87903 5.983 0.481194 +#> ds 4 parent 1 117.5 101.27 16.23017 5.958 2.723944 +#> ds 4 parent 1 99.3 101.27 -1.96983 5.958 -0.330602 +#> ds 4 parent 3 94.0 100.37 -6.37355 5.909 -1.078583 +#> ds 4 parent 3 98.7 100.37 -1.67355 5.909 -0.283212 +#> ds 4 parent 7 109.2 98.60 10.59529 5.812 1.822915 +#> ds 4 parent 7 89.2 98.60 -9.40471 5.812 -1.618075 +#> ds 4 parent 14 103.3 95.58 7.71609 5.647 1.366386 +#> ds 4 parent 14 103.0 95.58 7.41609 5.647 1.313261 +#> ds 4 parent 28 90.8 89.82 0.98290 5.333 0.184310 +#> ds 4 parent 28 88.7 89.82 -1.11710 5.333 -0.209477 +#> ds 4 parent 60 74.8 77.91 -3.10870 4.690 -0.662879 +#> ds 4 parent 60 75.3 77.91 -2.60870 4.690 -0.556262 +#> ds 4 parent 90 71.1 68.18 2.91738 4.172 0.699234 +#> ds 4 parent 90 78.0 68.18 9.81738 4.172 2.353017 +#> ds 4 parent 120 59.1 59.67 -0.57073 3.728 -0.153107 +#> ds 4 parent 120 53.8 59.67 -5.87073 3.728 -1.574902 +#> ds 5 parent 0 94.9 98.38 -3.48183 5.800 -0.600307 +#> ds 5 parent 0 101.8 98.38 3.41817 5.800 0.589332 +#> ds 5 parent 1 96.1 96.75 -0.65141 5.711 -0.114065 +#> ds 5 parent 1 97.1 96.75 0.34859 5.711 0.061040 +#> ds 5 parent 3 93.8 93.57 0.22881 5.537 0.041323 +#> ds 5 parent 3 85.8 93.57 -7.77119 5.537 -1.403444 +#> ds 5 parent 7 87.6 87.52 0.07909 5.208 0.015186 +#> ds 5 parent 7 94.0 87.52 6.47909 5.208 1.244026 +#> ds 5 parent 14 82.5 77.86 4.64101 4.687 0.990182 +#> ds 5 parent 14 81.7 77.86 3.84101 4.687 0.819498 +#> ds 5 parent 28 60.0 61.62 -1.61729 3.829 -0.422433 +#> ds 5 parent 28 61.0 61.62 -0.61729 3.829 -0.161236 +#> ds 5 parent 60 32.5 36.10 -3.59608 2.571 -1.398750 +#> ds 5 parent 60 35.5 36.10 -0.59608 2.571 -0.231854 +#> ds 5 parent 90 21.8 21.86 -0.06415 1.987 -0.032287 +#> ds 5 parent 90 24.4 21.86 2.53585 1.987 1.276317 +#> ds 5 parent 120 14.1 13.24 0.85643 1.724 0.496877 +#> ds 5 parent 120 12.1 13.24 -1.14357 1.724 -0.663473
+
+
+ +
+ + + +
+ + + + + + + + -- cgit v1.2.1