Generates a summary for objects fitted by `bnec`

.
`object`

should be of class `bayesnecfit`

or
`bayesmanecfit`

.

- object
An object of class

`bayesnecfit`

or`bayesmanecfit`

.- ...
Unused.

- ecx
Should summary ECx values be calculated? Defaults to FALSE.

- ecx_vals
ECx targets (between 1 and 99). Only relevant if ecx = TRUE. If no value is specified by the user, returns calculations for EC10, EC50, and EC90.

A summary of the fitted model. In the case of a
`bayesnecfit`

object, the summary contains most of the original
contents of a `brmsfit`

object with the addition of
an R2. In the case of a `bayesmanecfit`

object, summary
displays the family distribution information, model weights and averaging
method, and Bayesian R2 estimates for each individual model.
Warning messages are also printed to screen in case
model fits are not satisfactory with regards to their Rhats.

The summary method for both `bayesnecfit`

and
`bayesmanecfit`

also returns a no-effect toxicity
estimate. Where the fitted model(s) are NEC models (threshold models,
containing a step function) the no-effect estimate is a true
no-effect-concentration (NEC, see Fox 2010). Where the fitted model(s) are
smooth ECx models with no step function, the no-effect estimate is a
no-significant-effect-concentration (NSEC, see Fisher and Fox 2023). In the
case of a `bayesmanecfit`

that contains a mixture of both NEC and
ECx models, the no-effect estimate is a model averaged combination of the NEC
and NSEC estimates, and is reported as the N(S)EC (see Fisher et al. 2023).

Fisher R, Fox DR (2023). Introducing the no significant effect concentration (NSEC).Environmental Toxicology and Chemistry, 42(9), 2019–2028. doi: 10.1002/etc.5610.

Fisher R, Fox DR, Negri AP, van Dam J, Flores F, Koppel D (2023). Methods for estimating no-effect toxicity concentrations in ecotoxicology. Integrated Environmental Assessment and Management. doi:10.1002/ieam.4809.

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.

```
# \donttest{
library(bayesnec)
summary(manec_example)
#> Warning: The ESS has been capped to avoid unstable estimates.
#> Warning: Parts of the model have not converged (some Rhats are > 1.05). Be careful when analysing the results! We recommend running more iterations and/or setting stronger priors.
#> Object of class bayesmanecfit
#>
#> Family: gaussian
#> Links: mu = identity; sigma = identity
#>
#> Number of posterior draws per model: 100
#>
#> Model weights (Method: pseudobma_bb_weights):
#> waic wi
#> nec4param 170.76 0.91
#> ecx4param 186.59 0.09
#>
#>
#> Summary of weighted N(S)EC posterior estimates:
#> NB: Model set contains a combination of ECx and NEC
#> models, and is therefore a model averaged
#> combination of NEC and NSEC estimates.
#> Estimate Q2.5 Q97.5
#> N(S)EC 1.46 0.67 1.51
#>
#>
#> Bayesian R2 estimates:
#> Estimate Est.Error Q2.5 Q97.5
#> nec4param 0.87 0.01 0.84 0.88
#> ecx4param 0.85 0.01 0.83 0.87
#>
#>
#> Warning: The following model had Rhats > 1.05 (no convergence):
#> - nec4param
#> Consider dropping them (see ?amend)
nec4param <- pull_out(manec_example, "nec4param")
#> Pulling out model(s): nec4param
summary(nec4param)
#> Warning: The ESS has been capped to avoid unstable estimates.
#> Warning: Parts of the model have not converged (some Rhats are > 1.05). Be careful when analysing the results! We recommend running more iterations and/or setting stronger priors.
#> Object of class bayesnecfit containing the nec4param model
#>
#> Family: gaussian
#> Links: mu = identity; sigma = identity
#> Formula: y ~ bot + (top - bot) * exp(-exp(beta) * (x - nec) * step(x - nec))
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> Data: data (Number of observations: 100)
#> Draws: 2 chains, each with iter = 200; warmup = 150; thin = 1;
#> total post-warmup draws = 100
#>
#> Population-Level Effects:
#> Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
#> bot -9.39 1.54 -12.50 -6.38 1.08 25 78
#> top 2.17 0.06 2.03 2.29 1.01 200 121
#> beta -0.77 0.19 -1.08 -0.40 1.10 23 69
#> nec 1.46 0.04 1.38 1.51 1.03 119 80
#>
#> Family Specific Parameters:
#> Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
#> sigma 0.53 0.03 0.46 0.59 1.02 93 77
#>
#> Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
#> and Tail_ESS are effective sample size measures, and Rhat is the potential
#> scale reduction factor on split chains (at convergence, Rhat = 1).
#>
#>
#> Estimate Q2.5 Q97.5
#> NEC 1.46 1.38 1.51
#>
#>
#> Bayesian R2 estimates:
#> Estimate Est.Error Q2.5 Q97.5
#> R2 0.87 0.01 0.84 0.88
#>
#>
# }
```