glances()
repeatedly calls glance()
on several
fitted model objects and binds the output together, sorted by a column of interest.
Usage
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for splm
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spautor
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for splm_list
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spautor_list
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spglm
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spgautor
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spglm_list
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
# S3 method for spgautor_list
glances(object, ..., sort_by = "AICc", decreasing = FALSE)
Arguments
- object
A fitted model object from
splm()
,spautor()
,spglm()
, orspgautor()
.- ...
Additional fitted model objects. Ignored if
object
has classsplm_list
,spautor_list
,spglm_list
, orspgautor_list
.- sort_by
Sort by a
glance
statistic (i.e., the name of a column output fromglance()
or the order of model input (sort_by = "order"
). The default is"AICc"
.- decreasing
Should
sort_by
be decreasing or not? The default isFALSE
.
Value
A tibble where each row represents the output of glance()
for
each fitted model object.
Examples
lmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "none"
)
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
glances(lmod, spmod)
#> # A tibble: 2 × 10
#> model n p npar value AIC AICc logLik deviance pseudo.r.squared
#> <chr> <int> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 lmod 30 4 1 -1.68 0.323 0.466 0.838 26.0 0.277
#> 2 spmod 30 4 3 -5.85 0.150 1.07 2.92 26.0 0.396
glances(lmod, spmod, sort_by = "logLik", decreasing = TRUE)
#> # A tibble: 2 × 10
#> model n p npar value AIC AICc logLik deviance pseudo.r.squared
#> <chr> <int> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 spmod 30 4 3 -5.85 0.150 1.07 2.92 26.0 0.396
#> 2 lmod 30 4 1 -1.68 0.323 0.466 0.838 26.0 0.277