From f0ef23a7598e5d19648ae4edc2b74e0fba27a41c Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 3 Feb 2021 16:41:31 +0100 Subject: Prepare for v1.0.0 - Improve authorship and copyright information - Prepare pkgdown config - Remove dependence on saemix as we need the development version which is not ready for CRAN - Temporarily remove saemix interface to check code coverage of the rest --- docs/reference/mixed.html | 279 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 docs/reference/mixed.html (limited to 'docs/reference/mixed.html') diff --git a/docs/reference/mixed.html b/docs/reference/mixed.html new file mode 100644 index 00000000..f5429f8b --- /dev/null +++ b/docs/reference/mixed.html @@ -0,0 +1,279 @@ + + + + + + + + +Create a mixed effects model from an mmkin row object — mixed • mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

Create a mixed effects model from an mmkin row object

+
+ +
mixed(object, ...)
+
+# S3 method for mmkin
+mixed(object, method = c("none"), ...)
+
+# S3 method for mixed.mmkin
+print(x, digits = max(3, getOption("digits") - 3), ...)
+ +

Arguments

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

An mmkin row object

...

Currently not used

method

The method to be used

x

A mixed.mmkin object to print

digits

Number of digits to use for printing.

+ + +

Examples

+
sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) +n_biphasic <- 8 +err_1 = list(const = 1, prop = 0.07) + +DFOP_SFO <- mkinmod( + parent = mkinsub("DFOP", "m1"), + m1 = mkinsub("SFO"), + quiet = TRUE) + +set.seed(123456) +log_sd <- 0.3 +syn_biphasic_parms <- as.matrix(data.frame( + k1 = rlnorm(n_biphasic, log(0.05), log_sd), + k2 = rlnorm(n_biphasic, log(0.01), log_sd), + g = plogis(rnorm(n_biphasic, 0, log_sd)), + f_parent_to_m1 = plogis(rnorm(n_biphasic, 0, log_sd)), + k_m1 = rlnorm(n_biphasic, log(0.002), log_sd))) + +ds_biphasic_mean <- lapply(1:n_biphasic, + function(i) { + mkinpredict(DFOP_SFO, syn_biphasic_parms[i, ], + c(parent = 100, m1 = 0), sampling_times) + } +) + +set.seed(123456L) +ds_biphasic <- lapply(ds_biphasic_mean, function(ds) { + add_err(ds, + sdfunc = function(value) sqrt(err_1$const^2 + value^2 * err_1$prop^2), + n = 1, secondary = "m1")[[1]] +}) + +# \dontrun{ +f_mmkin <- mmkin(list("DFOP-SFO" = DFOP_SFO), ds_biphasic, error_model = "tc", quiet = TRUE) + +f_mixed <- mixed(f_mmkin) +print(f_mixed) +
#> Kinetic model fitted by nonlinear regression to each dataset +#> Structural model: +#> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * +#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) +#> * parent +#> d_m1/dt = + f_parent_to_m1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g) +#> * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) * +#> exp(-k2 * time))) * parent - k_m1 * m1 +#> +#> Data: +#> 271 observations of 2 variable(s) grouped in 8 datasets +#> +#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model 1 2 3 4 5 6 7 8 +#> DFOP-SFO OK OK OK OK OK C OK OK +#> +#> OK: No warnings +#> C: Optimisation did not converge: +#> iteration limit reached without convergence (10) +#> +#> Mean fitted parameters: +#> parent_0 log_k_m1 f_parent_qlogis log_k1 log_k2 +#> 100.606304 -8.759216 -0.002001 -3.350539 -3.989549 +#> g_qlogis +#> -0.090353
plot(f_mixed) +
# } +
+
+ +
+ + + +
+ + + + + + + + -- cgit v1.2.1