residuals.jags_analysis: Residuals

Description Usage Arguments Value See Also

Description

Get residuals with estimates using derived code in a JAGS analysis

Usage

1
2
3
4
5
## S3 method for class 'jags_analysis'
residuals(object, parm = "residual",
  model_id = default_model_id(object), derived_code = NULL,
  random_effects = NULL, level = "current", estimate = "current",
  data = NULL, ...)

Arguments

object

a jags_analysis object.

parm

a character element naming the derived parameter for which the estimates should be calculated by default = "residual"

model_id

a count or string specifying the jags model to select.

derived_code

a character element defining a block in the JAGS dialect of the BUGS language that defines one or more derived parameters for each row of data. If NULL derived_code is as defined by the JAGS model for which the JAGS analysis was performed.

random_effects

a named list which specifies which parameters to treat as random variables. If NULL random is as defined by the JAGS model for which the JAGS analysis was performed.

level

a numeric scalar specifying the significance level or a character scalar specifying which mode the level should be taken from. By default the level is as currently specified by opts_jagr in the global options.

estimate

a character scalar specifying whether the point estimate should be the "mean" or the "median" or a character scalar which mode the level should be taken from. By default the estimate is as currently specified by opts_jagr in the global options.

data

the dataset for which to calculate the residuals. By default newdata is NULL as the residuals are typically calculated on the original dataset.

...

further arguments passed to or from other methods.

Value

the input data frame with the point estimate and credibility intervals for the residuals

See Also

jags_model and jags_analysis


poissonconsulting/jaggernaut documentation built on Feb. 18, 2021, 11:10 p.m.