From d25974f643ee46b7cd5ccd8331dd7bb0b14ab27a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 26 Oct 2022 09:36:44 +0200 Subject: Don't test parhist and llhist on travis, docs --- docs/dev/articles/web_only/multistart.html | 2 +- .../figure-html/unnamed-chunk-2-1.png | Bin 61772 -> 59606 bytes .../figure-html/unnamed-chunk-3-1.png | Bin 56540 -> 55167 bytes .../figure-html/unnamed-chunk-4-1.png | Bin 39866 -> 21474 bytes docs/dev/pkgdown.yml | 2 +- docs/dev/reference/anova.saem.mmkin.html | 161 +++++++++++++ docs/dev/reference/index.html | 14 +- docs/dev/reference/llhist.html | 15 +- docs/dev/reference/logLik.saem.mmkin.html | 135 +++++++++++ docs/dev/reference/multistart-1.png | Bin 0 -> 59254 bytes docs/dev/reference/multistart-2.png | Bin 0 -> 54149 bytes docs/dev/reference/multistart.html | 31 ++- docs/dev/reference/parhist.html | 28 ++- docs/dev/reference/saem.html | 133 +++++++---- docs/dev/reference/set_nd_nq.html | 258 +++++++++++++++++++++ docs/dev/sitemap.xml | 9 + 16 files changed, 722 insertions(+), 66 deletions(-) create mode 100644 docs/dev/reference/anova.saem.mmkin.html create mode 100644 docs/dev/reference/logLik.saem.mmkin.html create mode 100644 docs/dev/reference/multistart-1.png create mode 100644 docs/dev/reference/multistart-2.png create mode 100644 docs/dev/reference/set_nd_nq.html (limited to 'docs/dev') diff --git a/docs/dev/articles/web_only/multistart.html b/docs/dev/articles/web_only/multistart.html index 8d26e55a..4af5def0 100644 --- a/docs/dev/articles/web_only/multistart.html +++ b/docs/dev/articles/web_only/multistart.html @@ -109,7 +109,7 @@

Short demo of the multistart method

Johannes Ranke

-

Last change 19 September 2022 (rebuilt 2022-09-28)

+

Last change 19 September 2022 (rebuilt 2022-10-26)

Source: vignettes/web_only/multistart.rmd diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-2-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-2-1.png index 18800fb9..e3baa59b 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-2-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png index 908989e9..d32e1214 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png index e50177cc..d72722f0 100644 Binary files a/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png and b/docs/dev/articles/web_only/multistart_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 22ed5aa7..c0cb9f4c 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -12,7 +12,7 @@ articles: compiled_models: web_only/compiled_models.html dimethenamid_2018: web_only/dimethenamid_2018.html multistart: web_only/multistart.html -last_built: 2022-09-30T10:35Z +last_built: 2022-10-26T07:25Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/dev/reference/anova.saem.mmkin.html b/docs/dev/reference/anova.saem.mmkin.html new file mode 100644 index 00000000..abe77c65 --- /dev/null +++ b/docs/dev/reference/anova.saem.mmkin.html @@ -0,0 +1,161 @@ + +Anova method for saem.mmkin objects — anova.saem.mmkin • mkin + + +
+
+ + + +
+
+ + +
+

Generate an anova object. The method to calculate the BIC is that from +the saemix package. As in other prominent anova methods, models are sorted

+
+ +
+
# S3 method for saem.mmkin
+anova(
+  object,
+  ...,
+  method = c("is", "lin", "gq"),
+  test = FALSE,
+  model.names = NULL
+)
+
+ +
+

Arguments

+
object
+

An saem.mmkin object

+ + +
...
+

further such objects

+ + +
method
+

Method for likelihood calculation: "is" (importance sampling), +"lin" (linear approximation), or "gq" (Gaussian quadrature). Passed +to saemix::logLik.SaemixObject

+ + +
test
+

Should a likelihood ratio test be performed? If TRUE, +the alternative models are tested against the first model. Should +only be done for nested models.

+ + +
model.names
+

Optional character vector of model names

+ +
+
+

Value

+ + +

an "anova" data frame; the traditional (S3) result of anova()

+
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.6.

+
+ +
+ + + + + + + + diff --git a/docs/dev/reference/index.html b/docs/dev/reference/index.html index cbd44762..3d9d40b7 100644 --- a/docs/dev/reference/index.html +++ b/docs/dev/reference/index.html @@ -216,6 +216,14 @@ degradation models and one or more error models

summary(<saem.mmkin>) print(<summary.saem.mmkin>)

Summary method for class "saem.mmkin"

+ +

anova(<saem.mmkin>)

+ +

Anova method for saem.mmkin objects

+ +

logLik(<saem.mmkin>)

+ +

logLik method for saem.mmkin objects

nlme_function() nlme_data()

@@ -237,7 +245,7 @@ degradation models and one or more error models

Confidence intervals for parameters in saem.mmkin objects

-

multistart() print(<multistart>)

+

multistart() print(<multistart>) best() which.best()

Perform a hierarchical model fit with multiple starting values

@@ -340,6 +348,10 @@ degradation models and one or more error models

f_time_norm_focus()

Normalisation factors for aerobic soil degradation according to FOCUS guidance

+ +

set_nd_nq() set_nd_nq_focus()

+ +

Set non-detects and unquantified values in residue series without replicates

max_twa_parent() max_twa_sfo() max_twa_fomc() max_twa_dfop() max_twa_hs()

diff --git a/docs/dev/reference/llhist.html b/docs/dev/reference/llhist.html index 2eb77a82..e110416e 100644 --- a/docs/dev/reference/llhist.html +++ b/docs/dev/reference/llhist.html @@ -1,7 +1,6 @@ -Plot the distribution of log likelihoods from multistart objects — llhist • mkinPlot the distribution of log likelihoods from multistart objects — llhist • mkin @@ -46,11 +45,14 @@ a red vertical line.">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -85,9 +87,8 @@ a red vertical line.">
    -

    Produces a histogram of log-likelihoods, and an overlayed kernel density -estimate. In addition, the likelihood of the original fit is shown as -a red vertical line.

    +

    Produces a histogram of log-likelihoods. In addition, the likelihood of the +original fit is shown as a red vertical line.

    diff --git a/docs/dev/reference/logLik.saem.mmkin.html b/docs/dev/reference/logLik.saem.mmkin.html new file mode 100644 index 00000000..9694232c --- /dev/null +++ b/docs/dev/reference/logLik.saem.mmkin.html @@ -0,0 +1,135 @@ + +logLik method for saem.mmkin objects — logLik.saem.mmkin • mkin + + +
    +
    + + + +
    +
    + + +
    +

    logLik method for saem.mmkin objects

    +
    + +
    +
    # S3 method for saem.mmkin
    +logLik(object, ..., method = c("lin", "is", "gq"))
    +
    + +
    +

    Arguments

    +
    object
    +

    The fitted saem.mmkin object

    + + +
    ...
    +

    Passed to saemix::logLik.SaemixObject

    + + +
    method
    +

    Passed to saemix::logLik.SaemixObject

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/dev/reference/multistart-1.png b/docs/dev/reference/multistart-1.png new file mode 100644 index 00000000..ee9c1b5a Binary files /dev/null and b/docs/dev/reference/multistart-1.png differ diff --git a/docs/dev/reference/multistart-2.png b/docs/dev/reference/multistart-2.png new file mode 100644 index 00000000..e54938ab Binary files /dev/null and b/docs/dev/reference/multistart-2.png differ diff --git a/docs/dev/reference/multistart.html b/docs/dev/reference/multistart.html index 714cb2fc..83af8dbb 100644 --- a/docs/dev/reference/multistart.html +++ b/docs/dev/reference/multistart.html @@ -112,7 +112,17 @@ mixed-effects models by Duchesne et al (2021).

    multistart(object, n = 50, cores = 1, cluster = NULL, ...) # S3 method for multistart -print(x, ...)
    +print(x, ...) + +best(object, ...) + +# S3 method for default +best(object, ...) + +which.best(object, ...) + +# S3 method for default +which.best(object, ...)
    @@ -149,6 +159,12 @@ for parallel execution.

    A list of saem.mmkin objects, with class attributes 'multistart.saem.mmkin' and 'multistart'.

    + + +

    The object with the highest likelihood

    + + +

    The index of the object with the highest likelihood

    Details

    @@ -187,11 +203,14 @@ doi: 10.1186/s12859-021-04373-4.

    f_mmkin <- mmkin("DFOP", dmta_ds, error_model = "tc", cores = 7, quiet = TRUE) f_saem_full <- saem(f_mmkin) f_saem_full_multi <- multistart(f_saem_full, n = 16, cores = 16) -#> Warning: all scheduled cores encountered errors in user code parhist(f_saem_full_multi, lpos = "bottomright") -#> Error in UseMethod("parms", object): no applicable method for 'parms' applied to an object of class "try-error" + +illparms(f_saem_full) +#> [1] "sd(log_k2)" -f_saem_reduced <- update(f_saem_full, covariance.model = diag(c(1, 1, 0, 1))) +f_saem_reduced <- update(f_saem_full, no_random_effect = "log_k2") +illparms(f_saem_reduced) +#> character(0) # On Windows, we need to create a cluster first. When working with # such a cluster, we need to export the mmkin object to the cluster # nodes, as it is referred to when updating the saem object on the nodes. @@ -200,10 +219,8 @@ doi: 10.1186/s12859-021-04373-4.

    clusterExport(cl, "f_mmkin") #> Error in get(name, envir = envir): object 'f_mmkin' not found f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl) -#> Error in checkForRemoteErrors(val): 12 nodes produced errors; first error: object 'f_mmkin' not found parhist(f_saem_reduced_multi, lpos = "bottomright") -#> Error in parhist(f_saem_reduced_multi, lpos = "bottomright"): object 'f_saem_reduced_multi' not found -#> Warning: calling par(new=TRUE) with no plot + # }
    diff --git a/docs/dev/reference/parhist.html b/docs/dev/reference/parhist.html index bc230c21..27fc116f 100644 --- a/docs/dev/reference/parhist.html +++ b/docs/dev/reference/parhist.html @@ -1,6 +1,7 @@ -Plot parameter distributions from multistart objects — parhist • mkinPlot parameter distributions from multistart objects — parhist • mkin @@ -87,12 +88,20 @@ using their medians as in the paper by Duchesne et al. (2021)."> -

    Produces a boxplot with all parameters from the multiple runs, divided by -using their medians as in the paper by Duchesne et al. (2021).

    +

    Produces a boxplot with all parameters from the multiple runs, scaled +either by the parameters of the run with the highest likelihood, +or by their medians as proposed in the paper by Duchesne et al. (2021).

    -
    parhist(object, lpos = "bottomleft", main = "", ...)
    +
    parhist(
    +  object,
    +  llmin = -Inf,
    +  scale = c("best", "median"),
    +  lpos = "bottomleft",
    +  main = "",
    +  ...
    +)
    @@ -101,6 +110,15 @@ using their medians as in the paper by Duchesne et al. (2021).

    The multistart object

    +
    llmin
    +

    The minimum likelihood of objects to be shown

    + + +
    scale
    +

    By default, scale parameters using the best available fit. +If 'median', parameters are scaled using the median parameters from all fits.

    + +
    lpos

    Positioning of the legend.

    diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html index ce3d428c..c8a7504f 100644 --- a/docs/dev/reference/saem.html +++ b/docs/dev/reference/saem.html @@ -46,11 +46,14 @@ Expectation Maximisation algorithm (SAEM).">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models
  • - Example evaluation of FOCUS Example Dataset Z + Short demo of the multistart method
  • Performance benefit by using compiled model definitions in mkin
  • +
  • + Example evaluation of FOCUS Example Dataset Z +
  • Calculation of time weighted average concentrations with mkin
  • @@ -101,6 +104,10 @@ Expectation Maximisation algorithm (SAEM).

    test_log_parms = TRUE, conf.level = 0.6, solution_type = "auto", + covariance.model = "auto", + covariates = NULL, + covariate_models = NULL, + no_random_effect = NULL, nbiter.saemix = c(300, 100), control = list(displayProgress = FALSE, print = FALSE, nbiter.saemix = nbiter.saemix, save = FALSE, save.graphs = FALSE), @@ -118,13 +125,17 @@ Expectation Maximisation algorithm (SAEM).

    solution_type = "auto", transformations = c("mkin", "saemix"), degparms_start = numeric(), + covariance.model = "auto", + no_random_effect = NULL, + covariates = NULL, + covariate_models = NULL, test_log_parms = FALSE, conf.level = 0.6, verbose = FALSE, ... ) -saemix_data(object, verbose = FALSE, ...) +saemix_data(object, covariates = NULL, verbose = FALSE, ...) # S3 method for saem.mmkin parms(object, ci = FALSE, ...)
    @@ -171,6 +182,29 @@ for parameter that are tested if requested by 'test_log_parms'.

    automatic choice is not desired

    +
    covariance.model
    +

    Will be passed to saemix::SaemixModel(). Per +default, uncorrelated random effects are specified for all degradation +parameters.

    + + +
    covariates
    +

    A data frame with covariate data for use in +'covariate_models', with dataset names as row names.

    + + +
    covariate_models
    +

    A list containing linear model formulas with one explanatory +variable, i.e. of the type 'parameter ~ covariate'. Covariates must be available +in the 'covariates' data frame.

    + + +
    no_random_effect
    +

    Character vector of degradation parameters for +which there should be no variability over the groups. Only used +if the covariance model is not explicitly specified.

    + +
    nbiter.saemix

    Convenience option to increase the number of iterations

    @@ -249,40 +283,43 @@ using mmkin.

    f_saem_sfo <- saem(f_mmkin_parent["SFO", ]) f_saem_fomc <- saem(f_mmkin_parent["FOMC", ]) f_saem_dfop <- saem(f_mmkin_parent["DFOP", ]) -illparms(f_saem_dfop) -#> [1] "sd(g_qlogis)" -update(f_saem_dfop, covariance.model = diag(c(1, 1, 1, 0))) -#> Kinetic nonlinear mixed-effects model fit by SAEM -#> 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 +anova(f_saem_sfo, f_saem_fomc, f_saem_dfop) +#> Data: 90 observations of 1 variable(s) grouped in 5 datasets #> -#> Data: -#> 90 observations of 1 variable(s) grouped in 5 datasets +#> npar AIC BIC Lik +#> f_saem_sfo 5 624.26 622.31 -307.13 +#> f_saem_fomc 7 467.87 465.13 -226.93 +#> f_saem_dfop 9 493.98 490.47 -237.99 +anova(f_saem_sfo, f_saem_dfop, test = TRUE) +#> Data: 90 observations of 1 variable(s) grouped in 5 datasets #> -#> Likelihood computed by importance sampling -#> AIC BIC logLik -#> 490.6 487.5 -237.3 +#> npar AIC BIC Lik Chisq Df Pr(>Chisq) +#> f_saem_sfo 5 624.26 622.31 -307.13 +#> f_saem_dfop 9 493.98 490.47 -237.99 138.28 4 < 2.2e-16 *** +#> --- +#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 +illparms(f_saem_dfop) +#> [1] "sd(g_qlogis)" +f_saem_dfop_red <- update(f_saem_dfop, no_random_effect = "g_qlogis") +anova(f_saem_dfop, f_saem_dfop_red, test = TRUE) +#> Data: 90 observations of 1 variable(s) grouped in 5 datasets #> -#> Fitted parameters: -#> estimate lower upper -#> parent_0 93.902 91.3695 96.4339 -#> log_k1 -2.936 -3.9950 -1.8762 -#> log_k2 -3.091 -4.9290 -1.2523 -#> g_qlogis -0.366 -0.6484 -0.0836 -#> a.1 2.385 2.0033 2.7664 -#> SD.parent_0 2.476 0.3890 4.5623 -#> SD.log_k1 1.195 0.4381 1.9517 -#> SD.log_k2 2.092 0.7906 3.3932 -AIC(f_saem_dfop) -#> [1] 493.9811 +#> npar AIC BIC Lik Chisq Df Pr(>Chisq) +#> f_saem_dfop_red 8 490.64 487.52 -237.32 +#> f_saem_dfop 9 493.98 490.47 -237.99 0 1 1 +anova(f_saem_sfo, f_saem_fomc, f_saem_dfop) +#> Data: 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> npar AIC BIC Lik +#> f_saem_sfo 5 624.26 622.31 -307.13 +#> f_saem_fomc 7 467.87 465.13 -226.93 +#> f_saem_dfop 9 493.98 490.47 -237.99 # The returned saem.mmkin object contains an SaemixObject, therefore we can use # functions from saemix library(saemix) #> Loading required package: npde -#> Package saemix, version 3.1 +#> Package saemix, version 3.2 #> please direct bugs, questions and feedback to emmanuelle.comets@inserm.fr #> #> Attaching package: ‘saemix’ @@ -308,11 +345,12 @@ using mmkin.

    f_mmkin_parent_tc <- update(f_mmkin_parent, error_model = "tc") f_saem_fomc_tc <- saem(f_mmkin_parent_tc["FOMC", ]) -compare.saemix(f_saem_fomc$so, f_saem_fomc_tc$so) -#> Likelihoods calculated by importance sampling -#> AIC BIC -#> 1 467.8664 465.1324 -#> 2 469.8018 466.6773 +anova(f_saem_fomc, f_saem_fomc_tc, test = TRUE) +#> Data: 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> npar AIC BIC Lik Chisq Df Pr(>Chisq) +#> f_saem_fomc 7 467.87 465.13 -226.93 +#> f_saem_fomc_tc 8 469.80 466.68 -226.90 0.0645 1 0.7995 sfo_sfo <- mkinmod(parent = mkinsub("SFO", "A1"), A1 = mkinsub("SFO")) @@ -370,11 +408,11 @@ using mmkin.

    plot(f_saem_dfop_sfo) summary(f_saem_dfop_sfo, data = TRUE) -#> saemix version used for fitting: 3.1 +#> saemix version used for fitting: 3.2 #> mkin version used for pre-fitting: 1.1.2 #> R version used for fitting: 4.2.1 -#> Date of fit: Fri Sep 16 10:30:47 2022 -#> Date of summary: Fri Sep 16 10:30:47 2022 +#> Date of fit: Wed Oct 26 09:20:37 2022 +#> Date of summary: Wed Oct 26 09:20:37 2022 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -389,7 +427,7 @@ using mmkin.

    #> #> Model predictions using solution type analytical #> -#> Fitted in 9.651 s +#> Fitted in 8.902 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Constant variance @@ -410,13 +448,20 @@ using mmkin.

    #> 842 836.9 -408 #> #> Optimised parameters: -#> est. lower upper -#> parent_0 93.7701 91.1458 96.3945 -#> log_k_A1 -5.8116 -7.5998 -4.0234 -#> f_parent_qlogis -0.9608 -1.3654 -0.5562 -#> log_k1 -2.5841 -3.6876 -1.4805 -#> log_k2 -3.5228 -5.3254 -1.7203 -#> g_qlogis -0.1027 -0.8719 0.6665 +#> est. lower upper +#> parent_0 93.7701 91.1458 96.3945 +#> log_k_A1 -5.8116 -7.5998 -4.0234 +#> f_parent_qlogis -0.9608 -1.3654 -0.5562 +#> log_k1 -2.5841 -3.6876 -1.4805 +#> log_k2 -3.5228 -5.3254 -1.7203 +#> g_qlogis -0.1027 -0.8719 0.6665 +#> a.1 1.8856 1.6676 2.1037 +#> SD.parent_0 2.7682 0.7668 4.7695 +#> SD.log_k_A1 1.7447 0.4047 3.0848 +#> SD.f_parent_qlogis 0.4525 0.1620 0.7431 +#> SD.log_k1 1.2423 0.4560 2.0285 +#> SD.log_k2 2.0390 0.7601 3.3180 +#> SD.g_qlogis 0.4439 -0.3069 1.1947 #> #> Correlation: #> parnt_0 lg_k_A1 f_prnt_ log_k1 log_k2 diff --git a/docs/dev/reference/set_nd_nq.html b/docs/dev/reference/set_nd_nq.html new file mode 100644 index 00000000..26a28339 --- /dev/null +++ b/docs/dev/reference/set_nd_nq.html @@ -0,0 +1,258 @@ + +Set non-detects and unquantified values in residue series without replicates — set_nd_nq • mkin + + +
    +
    + + + +
    +
    + + +
    +

    This function automates replacing unquantified values in residue time and +depth series. For time series, the function performs part of the residue +processing proposed in the FOCUS kinetics guidance for parent compounds +and metabolites. For two-dimensional residue series over time and depth, +it automates the proposal of Boesten et al (2015).

    +
    + +
    +
    set_nd_nq(res_raw, lod, loq = NA, time_zero_presence = FALSE)
    +
    +set_nd_nq_focus(
    +  res_raw,
    +  lod,
    +  loq = NA,
    +  set_first_sample_nd = TRUE,
    +  first_sample_nd_value = 0,
    +  ignore_below_loq_after_first_nd = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    res_raw
    +

    Character vector of a residue time series, or matrix of +residue values with rows representing depth profiles for a specific sampling +time, and columns representing time series of residues at the same depth. +Values below the limit of detection (lod) have to be coded as "nd", values +between the limit of detection and the limit of quantification, if any, have +to be coded as "nq". Samples not analysed have to be coded as "na". All +values that are not "na", "nd" or "nq" have to be coercible to numeric

    + + +
    lod
    +

    Limit of detection (numeric)

    + + +
    loq
    +

    Limit of quantification(numeric). Must be specified if the FOCUS rule to +stop after the first non-detection is to be applied

    + + +
    time_zero_presence
    +

    Do we assume that residues occur at time zero? +This only affects samples from the first sampling time that have been +reported as "nd" (not detected).

    + + +
    set_first_sample_nd
    +

    Should the first sample be set to "first_sample_nd_value" +in case it is a non-detection?

    + + +
    first_sample_nd_value
    +

    Value to be used for the first sample if it is a non-detection

    + + +
    ignore_below_loq_after_first_nd
    +

    Should we ignore values below the LOQ after the first +non-detection that occurs after the quantified values?

    + +
    +
    +

    Value

    + + +

    A numeric vector, if a vector was supplied, or a numeric matrix otherwise

    +
    +
    +

    Functions

    + +
    • set_nd_nq_focus(): Set non-detects in residue time series according to FOCUS rules

    • +
    +
    +

    References

    +

    Boesten, J. J. T. I., van der Linden, A. M. A., Beltman, W. H. +J. and Pol, J. W. (2015). Leaching of plant protection products and their +transformation products; Proposals for improving the assessment of leaching +to groundwater in the Netherlands — Version 2. Alterra report 2630, Alterra +Wageningen UR (University & Research centre)

    +

    FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation +Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, +18 December 2014, p. 251

    +
    + +
    +

    Examples

    +
    # FOCUS (2014) p. 75/76 and 131/132
    +parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd")
    +set_nd_nq(parent_1, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_2 <- c(.12, .09, .05, .03, "nd", "nd", .03, "nd", "nd", "nd")
    +set_nd_nq(parent_2, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.03 0.01   NA   NA
    +set_nd_nq_focus(parent_2, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01   NA   NA   NA   NA   NA
    +parent_3 <- c(.12, .09, .05, .03, "nd", "nd", .06, "nd", "nd", "nd")
    +set_nd_nq(parent_3, 0.02)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +set_nd_nq_focus(parent_3, 0.02, loq = 0.05)
    +#>  [1] 0.12 0.09 0.05 0.03 0.01 0.01 0.06 0.01   NA   NA
    +metabolite <- c("nd", "nd", "nd", 0.03, 0.06, 0.10, 0.11, 0.10, 0.09, 0.05, 0.03, "nd", "nd")
    +set_nd_nq(metabolite, 0.02)
    +#>  [1]   NA   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +set_nd_nq_focus(metabolite, 0.02, 0.05)
    +#>  [1] 0.00   NA 0.01 0.03 0.06 0.10 0.11 0.10 0.09 0.05 0.03 0.01   NA
    +#
    +# Boesten et al. (2015), p. 57/58
    +table_8 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nq", 2), rep("nd", 2),
    +    10, 10, 10, "nq", "nd", "nd",
    +    "nq", 10, "nq", rep("nd", 3),
    +    "nd", "nq", "nq", rep("nd", 3),
    +    rep("nd", 6), rep("nd", 6)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_8, 0.5, 1.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25 0.25   NA   NA
    +#> [2,] 10.00 10.00  1.00 1.00 0.25   NA
    +#> [3,] 10.00 10.00 10.00 1.00 0.25   NA
    +#> [4,]  1.00 10.00  1.00 0.25   NA   NA
    +#> [5,]  0.25  1.00  1.00 0.25   NA   NA
    +#> [6,]    NA  0.25  0.25   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +table_10 <- matrix(
    +  c(10, 10, rep("nd", 4),
    +    10, 10, rep("nd", 4),
    +    10, 10, 10, rep("nd", 3),
    +    "nd", 10, rep("nd", 4),
    +    rep("nd", 18)),
    +  ncol = 6, byrow = TRUE)
    +set_nd_nq(table_10, 0.5, time_zero_presence = TRUE)
    +#>       [,1]  [,2]  [,3] [,4] [,5] [,6]
    +#> [1,] 10.00 10.00  0.25   NA   NA   NA
    +#> [2,] 10.00 10.00  0.25   NA   NA   NA
    +#> [3,] 10.00 10.00 10.00 0.25   NA   NA
    +#> [4,]  0.25 10.00  0.25   NA   NA   NA
    +#> [5,]    NA  0.25    NA   NA   NA   NA
    +#> [6,]    NA    NA    NA   NA   NA   NA
    +#> [7,]    NA    NA    NA   NA   NA   NA
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.6.

    +
    + +
    + + + + + + + + diff --git a/docs/dev/sitemap.xml b/docs/dev/sitemap.xml index 5ba14939..86bf9185 100644 --- a/docs/dev/sitemap.xml +++ b/docs/dev/sitemap.xml @@ -99,6 +99,9 @@ https://pkgdown.jrwb.de/mkin/reference/add_err.html + + https://pkgdown.jrwb.de/mkin/reference/anova.saem.mmkin.html + https://pkgdown.jrwb.de/mkin/reference/aw.html @@ -153,6 +156,9 @@ https://pkgdown.jrwb.de/mkin/reference/logLik.mkinfit.html + + https://pkgdown.jrwb.de/mkin/reference/logLik.saem.mmkin.html + https://pkgdown.jrwb.de/mkin/reference/logistic.solution.html @@ -264,6 +270,9 @@ https://pkgdown.jrwb.de/mkin/reference/schaefer07_complex_case.html + + https://pkgdown.jrwb.de/mkin/reference/set_nd_nq.html + https://pkgdown.jrwb.de/mkin/reference/sigma_twocomp.html -- cgit v1.2.1