For each posterior draw, calculates the decline from the predicted control response to the response at x, as a percentage of the distance from the control to the floor selected by type.

epx(
  object,
  x,
  resolution = 500,
  x_range = NA,
  type = "absolute",
  x_scale = c("recorded", "fitted"),
  prob_vals = c(0.5, 0.025, 0.975),
  ...,
  posterior = FALSE,
  pool = NULL,
  x_control = "own",
  extrapolate = FALSE,
  dpar = NULL,
  which = "combined"
)

Arguments

object

A bayesnecfit, bayesmanecfit, bayesnecgroupfit, bayesnecjointfit or bayesnechurdlefit object.

x

One finite concentration. It is on the recorded predictor scale by default.

resolution

Number of grid points used to find the floor for type = "range" and to interpolate the response of a hurdle pair at x. The default is 500.

x_range

Prediction range on the recorded scale; NA uses the fit's range.

type

"absolute" measures towards zero, "relative" towards the equation's theoretical asymptote, and "range" towards its lowest predicted response over the original prediction range. "direct" is unavailable because it names a response rather than a percentage.

x_scale

"recorded" (the default) reads x on the recorded scale; "fitted" reads it on the scale fitted by crf() and converts it to the recorded scale before prediction.

prob_vals

Summary probabilities, in central, lower, upper order.

...

Further arguments passed to methods. Unused arguments are refused.

posterior

Return one value per posterior draw instead of quantiles.

pool

How observed group levels are combined: "none", "mixture", "mean_estimate" or "mean_curve". See ecx().

x_control

The control concentration: "own", "shared" or a single finite number. See ecx().

extrapolate

FALSE uses the prediction range. One finite upper limit or two finite limits may extend it on the recorded scale. The floor for type = "range" is still read over the original range.

dpar

On a joint two-block fit, "mu", "hu" or "zi" selects one block; NULL uses the combined curve. See ecx().

which

On a bayesnechurdlefit, "combined", "growth" or "survival". See ecx().

Value

Named quantiles or, with posterior = TRUE, one percentage per draw. Grouped and joint fits return the same per-level structure as ecx().

Details

The draw-level calculation is (control - response_at_x) / (control - floor) * 100. "relative" is refused for the combined curve of a joint two-block fit and for a hurdle pair, as in ecx(). Values are not truncated: a response below zero can give more than 100 percent under "absolute", and a response above the control, such as the rising limb of nechorme, gives a negative value. At the control concentration every draw is exactly zero. A concentration outside the prediction range is refused unless x_range or extrapolate includes it.

See also

Examples

# \donttest{
data(manec_example)
epx(manec_example, x = 2)
#>       Q50      Q2.5     Q97.5 
#> 115.78177  93.06859 126.89894 
#> attr(,"x")
#> [1] 2
#> attr(,"resolution")
#> [1] 500
#> attr(,"toxicity_estimate")
#> [1] "epx"
# }