Extracts posterior predicted estimate values from a list of class
bayesnecfit
or bayesmanecfit
model fits and
calculates a geometric mean.
average_estimates(
x,
estimate = "nec",
ecx_val = 10,
posterior = FALSE,
type = "absolute",
hormesis_def = "control",
sig_val = 0.01,
resolution = 1000,
x_range = NA,
xform = identity,
prob_vals = c(0.5, 0.025, 0.975)
)
A named list
of objects of class
bayesnecfit
or bayesmanecfit
returned by
bnec
.
The type of estimate to use in the mean. Takes values "nec", "ecx" or "nsec".
The desired percentage effect value. This must be a value between 1 and 99 (for type = "relative" and "absolute"), defaults to 10.
A logical
value indicating if the full
posterior sample of calculated ECx values should be returned instead of
just the median and 95 credible intervals.
A character
vector, taking values of
"relative", "absolute" (the default) or "direct". See Details.
A character
vector, taking values
of "max" or "control". See Details.
Probability value to use as the lower quantile to test significance of the predicted posterior values.
The number of unique x values over which to find ECx – large values will make the ECx estimate more precise.
A range of x values over which to consider extracting ECx.
A function to apply to the returned estimated concentration values.
A vector indicating the probability values over which to return the estimated ECx value. Defaults to 0.5 (median) and 0.025 and 0.975 (95 percent credible intervals).
The geometric mean of the estimates estimate values
of the bayesnecfit
or bayesmanecfit
model fits contained in x
. See Details.
The geometric mean of values are simply the mean calculated on a
log scale and back transformed through exp
, although we
have added the capacity to accommodate zero values. Note that the function
assumes that x
has been modelled on the natural scale. Often CR
models are more stable on a log-transformed or sqrt scaling. If the input
bayesnecfit
or bayesmanecfit
model fits are
already based on a re-scaling of the x (concentration) axis, it is important
to pass an appropriate xform argument to ensure these are back transformed
before the the geometric mean calculation is applied.