varcomp function

Variability component comparison

Variability component comparison

Compare the proportion of total variability explained by the fixed effects and each variance parameter.

varcomp(object, ...) ## S3 method for class 'splm' varcomp(object, ...) ## S3 method for class 'spautor' varcomp(object, ...) ## S3 method for class 'spglm' varcomp(object, ...) ## S3 method for class 'spgautor' varcomp(object, ...)

Arguments

  • object: A fitted model object (e.g., from splm(), spautor(), spglm(), or spgautor()).
  • ...: Other arguments. Not used (needed for generic consistency).

Returns

A tibble that partitions the the total variability by the fixed effects and each variance parameter. The proportion of variability explained by the fixed effects is the pseudo R-squared obtained by psuedoR2(). The remaining proportion is spread accordingly among each variance parameter: "de", "ie", and if random effects are used, each named random effect. If spautor() objects have unconnected sites, a list is returned with three elements: "connected" for a variability comparison among the connected sites; "unconnected" for a variability comparison among the unconnected sites; and "ratio" for the ratio of the variance of the connected sites relative to the variance of the unconnected sites.

Examples

spmod <- splm(z ~ water + tarp, data = caribou, spcov_type = "exponential", xcoord = x, ycoord = y ) varcomp(spmod)
  • Maintainer: Michael Dumelle
  • License: GPL-3
  • Last published: 2025-03-12