Returns the deviance of a fitted model object.

# S3 method for splm
deviance(object, ...)

# S3 method for spautor
deviance(object, ...)

# S3 method for spglm
deviance(object, ...)

# S3 method for spgautor
deviance(object, ...)

Arguments

object

A fitted model object from splm(), spautor(), spglm(), or spgautor(), where estmethod is "ml" or "reml".

...

Other arguments. Not used (needed for generic consistency).

Value

The deviance.

Details

For objects estimated using "ml" or "reml", the deviance is twice the difference in log-likelihoods between the saturated (perfect-fit) model and the fitted model.

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
deviance(spmod)
#> [1] 26