From d4a49b4837de347d34b2c198de7342c34b0fab63 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 14 Apr 2020 11:45:49 +0200 Subject: Keep order of datasets in nlme_data, add a plot --- docs/reference/nlme-1.png | Bin 0 -> 70555 bytes docs/reference/nlme.html | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 docs/reference/nlme-1.png (limited to 'docs') diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png new file mode 100644 index 00000000..68ccb43f Binary files /dev/null and b/docs/reference/nlme-1.png differ diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index 696916a0..1b05f882 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -159,7 +159,7 @@ datasets.

Value

-

A function that can be used with link{nlme}

+

A function that can be used with nlme

A named vector containing mean values of the fitted degradation model parameters

A groupedData object

@@ -188,13 +188,45 @@ datasets.

mean_dp <- mean_degparms(f) grouped_data <- nlme_data(f) nlme_f <- nlme_function(f) +# These assignments are necessary for these objects to be +# visible to nlme and augPred when evaluation is done by +# pkgdown to generated the html docs. +assign("nlme_f", nlme_f, globalenv()) +assign("grouped_data", grouped_data, globalenv()) library(nlme) m_nlme <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink), data = grouped_data, fixed = parent_0 + log_k_parent_sink ~ 1, random = pdDiag(parent_0 + log_k_parent_sink ~ 1), - start = mean_dp)
#> Error in nlme_f(name, time, parent_0, log_k_parent_sink): konnte Funktion "nlme_f" nicht finden
summary(m_nlme)
#> Error in summary(m_nlme): Objekt 'm_nlme' nicht gefunden
+ start = mean_dp) +summary(m_nlme)
#> Nonlinear mixed-effects model fit by maximum likelihood +#> Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) +#> Data: grouped_data +#> AIC BIC logLik +#> 298.2781 307.7372 -144.1391 +#> +#> Random effects: +#> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1) +#> Level: ds +#> Structure: Diagonal +#> parent_0 log_k_parent_sink Residual +#> StdDev: 0.9374733 0.7098105 3.83543 +#> +#> Fixed effects: parent_0 + log_k_parent_sink ~ 1 +#> Value Std.Error DF t-value p-value +#> parent_0 101.76838 1.1445444 45 88.91606 0 +#> log_k_parent_sink -3.05444 0.4195622 45 -7.28008 0 +#> Correlation: +#> prnt_0 +#> log_k_parent_sink 0.034 +#> +#> Standardized Within-Group Residuals: +#> Min Q1 Med Q3 Max +#> -2.6169360 -0.2185329 0.0574070 0.5720937 3.0459868 +#> +#> Number of Observations: 49 +#> Number of Groups: 3
plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
# \dontrun{ # Test on some real data ds_2 <- lapply(experimental_data_for_UBA_2019[6:10], -- cgit v1.2.1