diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-10-25 21:45:30 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-10-25 21:45:30 +0200 |
commit | a8ff8bed72dc537fe70cf2995ea769d3f519f877 (patch) | |
tree | 781e776ea30c95392c0e96df7e42ae7709d32cb3 /tests/testthat/test_confidence.R | |
parent | 92bd47bf45cebe660c5e7f392a4ee19f704d8a19 (diff) |
Change DFOP mixed model data in tests, updates
Diffstat (limited to 'tests/testthat/test_confidence.R')
-rw-r--r-- | tests/testthat/test_confidence.R | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testthat/test_confidence.R b/tests/testthat/test_confidence.R index 36e9738d..6c645ca4 100644 --- a/tests/testthat/test_confidence.R +++ b/tests/testthat/test_confidence.R @@ -1,5 +1,19 @@ context("Confidence intervals and p-values") +# We set up some models and fits with nls for comparisons +SFO_trans <- function(t, parent_0, log_k_parent_sink) { + parent_0 * exp(- exp(log_k_parent_sink) * t) +} +SFO_notrans <- function(t, parent_0, k_parent_sink) { + parent_0 * exp(- k_parent_sink * t) +} +f_1_nls_trans <- nls(value ~ SFO_trans(time, parent_0, log_k_parent_sink), + data = FOCUS_2006_A, + start = list(parent_0 = 100, log_k_parent_sink = log(0.1))) +f_1_nls_notrans <- nls(value ~ SFO_notrans(time, parent_0, k_parent_sink), + data = FOCUS_2006_A, + start = list(parent_0 = 100, k_parent_sink = 0.1)) + test_that("The confint method 'quadratic' is consistent with the summary", { expect_equivalent( confint(fit_nw_1, parm = "parent_0", method = "quadratic"), |