Skip to contents

Compares a scalar statistic derived from the posterior with one or more fixed values

Usage

evaluatePointEstimateQTL(
  data,
  posterior,
  metric,
  stat = mean,
  observedMetric,
  statusCol = Status,
  lower = NULL,
  upper = NULL
)

Arguments

data

the tibble containing site-level observed metrics (KRIs)

posterior

the tibble containing the posterior distribution of the

metric

the column in posterior on which the metric should be based

stat

the summary statistic to be calculated from the values in metric. Default: mean.

observedMetric

the column in data containing the site level observed metrics (KRIs)

statusCol

the name of the column to be added to data that will contain the site-level flags comparing the corresponding KRI to the QTL thresholds defined by lower and upper

lower

a scalar or vector of lower limits, or NULL. See Usage Notes below.

upper

a scalar or vector of upper limits, or NULL. See Usage Notes below.

Value

a list of three elements named status, data and qtl. If status is "OK", no breach of the QTL was detected. Otherwise, status is equal to name of the most serious breach of the QTL as determined by the values in either lower or upper. qtl contains the value of the stat function when applied to metric.

Usage Notes

Both lower and upper cannot be NULL. In what follows, limit refers to both lower and upper.

If limit has names, those names are used. Otherwise, names are assigned based on the length of limit. If length(limit) is 1, the single element is named "action". If length(limit) is 2, the two elements are named "warn" and "action". (In this case, limit is first sorted appropriately.) If length(limit) is >2, its elements are named "1" to "n" where n is length(limit).

Examples

post <- (berrySummary %>% fitBayesBinomialModel(Subjects, Events))$tab
#> Loading required namespace: rjags
#> INFO [2024-11-01 09:30:45] Status of model fitting: OK