Learn R Programming

spmodel (version 0.8.0)

varcomp: Variability component comparison

Description

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

Usage

varcomp(object, ...)

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

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

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

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

Value

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.

Arguments

object

A fitted model object (e.g., from splm(), spautor(), spglm(), or spgautor()).

...

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

Examples

Run this code
spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
varcomp(spmod)

Run the code above in your browser using DataLab