```
nec(
object,
posterior = FALSE,
xform = identity,
prob_vals = c(0.5, 0.025, 0.975)
)
```

## Arguments

- object
An object of class `bayesnecfit`

or
`bayesmanecfit`

returned by `bnec`

.

- posterior
A `logical`

value indicating if the full
posterior sample of calculated NEC values should be returned instead of
just the median and 95% credible intervals.

- xform
A function to apply to the returned estimated concentration
values.

- prob_vals
A vector indicating the probability values over which to
return the estimated NEC value. Defaults to 0.5 (median) and 0.025 and
0.975 (95 percent credible intervals).

## Value

A vector containing the estimated NEC value, including upper and
lower 95% credible interval bounds (or other interval as specified by
prob_vals).

## Details

The NEC is a parameter in a threshold model (for example,
see Fox 2010), and is a true measure
of No-effect-concentration (the minimum concentration above which an effect
is predicted to occur.

## References

Fox DR (2010). A Bayesian Approach for Determining the No Effect
Concentration and Hazardous Concentration in Ecotoxicology. Ecotoxicology
and Environmental Safety, 73(2), 123–131. doi: 10.1016/j.ecoenv.2009.09.012.

## Examples

```
library(bayesnec)
data(manec_example)
nec(manec_example)
#> bayesmanecfit contains ecx model types and therefore nec estimate includes nsec values.
#> Q50 Q2.5 Q97.5
#> 1.4503481 0.7487292 1.5273698
#> attr(,"toxicity_estimate")
#> [1] "nec"
```