prebayesnecfit object.R/expand_classes.R
expand_nec.RdExtracts a range of statistics from a prebayesnecfit object.
expand_nec(
object,
formula,
x_range = NA,
resolution = 1000,
sig_val = 0.01,
loo_controls,
...
)An object of class prebayesnecfit.
Either a character string defining an
R formula or an actual formula object. See
bayesnecformula and check_formula.
A range of predictor values over which to consider extracting ECx.
The length of the predictor vector used for posterior predictions, and over which to extract ECx values. Large values will be slower but more precise.
Probability value to use as the lower quantile to test significance of the predicted posterior values against the control concentration, to estimate NEC as an interpolated NOEC value from smooth ECx curves.
A named list whose "fitting"
element holds arguments to be passed on to loo. A
single model is not weighted, so a "weights" element is accepted and not
read. See bnec.
Further arguments to internal function.
A list of model statistical output derived from
the input model object.
# \donttest{
library(bayesnec)
data(manec_example)
# one equation of the packaged model set, before its statistics are added
fit <- manec_example$mod_fits[["nec4param"]]
nec_fit <- expand_nec(fit, fit$bayesnecformula, model = "nec4param",
resolution = 50)
#> Warning: Found 2 observations with a pareto_k > 0.7 in model 'nec4param'. We recommend to set 'moment_match = TRUE' in order to perform moment matching for problematic observations.
#> Warning:
#> 3 (3.0%) p_waic estimates greater than 0.4. We recommend trying loo instead.
nec_fit$ne
#> Estimate Q2.5 Q97.5
#> 1.459350 1.388096 1.526988
# }