dispersion: Calculate a measure for dispersion

View source: R/dispersion_check.R

dispersionR Documentation

Calculate a measure for dispersion

Description

The measure is calculated as the average of the squared Pearson residuals

Usage

dispersion(observed, fitted, variance)

Arguments

observed

the observed values

fitted

the fitted values

variance

the variance of the fitted values

See Also

Other statistics: fitted,inla-method, get_observed(), residuals,inla-method

Examples

library(INLA)
set.seed(20181202)
model <- inla(
  poisson ~ 1,
  family = "poisson",
  data = data.frame(
    poisson = rpois(20, lambda = 10),
    base = 1
  ),
  control.predictor = list(compute = TRUE)
)
dispersion(
  observed = get_observed(model),
  fitted = fitted(model),
  variance = fitted(model)
)

inbo/inlatools documentation built on Sept. 17, 2022, 2:13 p.m.