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).

Value

A tibble that partitions the total variability by the fixed effects and each variance parameter (see Details). 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.

Details

The total variability in the response is decomposed into a portion explained by the fixed effects and a portion explained by each variance parameter in the fitted covariance structure:

  • de: the spatially dependent (correlated) random error variance, commonly referred to as a partial sill.

  • ie: the spatially independent (uncorrelated) random error variance, commonly referred to as a nugget.

  • random effects: if object was fit with a random argument, one additional variance parameter per named random effect term (e.g., a random intercept's grouping variable), representing the variance attributable to that grouping.

See spcov_params() abd spcov_initial() for more on de/ie and splm() (or spglm()) for more on random effects. The proportion of variability explained by the fixed effects is the pseudo R-squared returned by pseudoR2(). The remaining 1 - pseudoR2 proportion is then split among de, ie, and any random effect variances, in proportion to their share of the total variance (the sum of de, ie, and all random effect variances).

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
varcomp(spmod)
#> # A tibble: 3 × 2
#>   varcomp            proportion
#>   <chr>                   <dbl>
#> 1 Covariates (PR-sq)      0.397
#> 2 de                      0.498
#> 3 ie                      0.105