Skip to contents

Extracts the Gelman-Rubin convergence diagnostics from the BMA results of a fitted amerasfit object.

Usage

Rhat(x, ...)

# S3 method for class 'amerasfit'
Rhat(x, ...)

Arguments

x

A fitted model object of class amerasfit, as returned by ameras, with BMA results present.

...

Additional arguments, currently unused.

Value

A data frame with columns Rhat and n.eff, containing the Gelman-Rubin statistic and effective sample size for each parameter. Values of Rhat substantially above 1.05 indicate potential convergence problems, in which case longer chains via niter.BMA and nburnin.BMA are recommended.

Examples

# \donttest{
data("data", package="ameras")
dosevars <- paste0("V", 1:10)
fit <- ameras(Y.binomial ~ dose(all_of(dosevars), model="ERR"),
              data=data, family="binomial", methods="BMA")
#> Note: BMA may require extensive computation time
#> Error in resolve_dose_selection(sel_args, data):  In argument: `all_of(dosevars)`.
#> Caused by error:
#> ! object 'dosevars' not found
Rhat(fit)
#> Error: object 'fit' not found
# }