Debian Codegraph @

man/glance.sarlm.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/spdep.R
3 \name{glance.sarlm}
4 \alias{glance.sarlm}
5 \title{Glance at a(n) spatialreg object}
6 \usage{
7 \method{glance}{sarlm}(x, ...)
8 }
9 \arguments{
10 \item{x}{An object returned from \code{\link[spatialreg:ML_models]{spatialreg::lagsarlm()}}
11 or \code{\link[spatialreg:ML_models]{spatialreg::errorsarlm()}}.}
12
13 \item{...}{Additional arguments. Not used. Needed to match generic
14 signature only. \strong{Cautionary note:} Misspelled arguments will be
15 absorbed in \code{...}, where they will be ignored. If the misspelled
16 argument has a default value, the default value will be used.
17 For example, if you pass \code{conf.lvel = 0.9}, all computation will
18 proceed using \code{conf.level = 0.95}. Two exceptions here are:
19 \itemize{
20 \item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if
21 it will be ignored.
22 \item \code{augment()} methods will warn when supplied a \code{newdata} argument if it
23 will be ignored.
24 }}
25 }
26 \description{
27 Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}}
28 with exactly one row of model summaries. The summaries are typically
29 goodness of fit measures, p-values for hypothesis tests on residuals,
30 or model convergence information.
31
32 Glance never returns information from the original call to the modeling
33 function. This includes the name of the modeling function or any
34 arguments passed to the modeling function.
35
36 Glance does not calculate summary measures. Rather, it farms out these
37 computations to appropriate methods and gathers the results together.
38 Sometimes a goodness of fit measure will be undefined. In these cases
39 the measure will be reported as \code{NA}.
40
41 Glance returns the same number of columns regardless of whether the
42 model matrix is rank-deficient or not. If so, entries in columns
43 that no longer have a well-defined value are filled in with an \code{NA}
44 of the appropriate type.
45 }
46 \examples{
47 \dontshow{if (rlang::is_installed(c("spdep", "spatialreg")) && identical(Sys.getenv("NOT_CRAN"), "true")) withAutoprint(\{ # examplesIf}
48
49
50 # load libraries for models and data
51 library(spatialreg)
52 library(spdep)
53
54 # load data
55 data(oldcol, package = "spdep")
56
57 listw <- nb2listw(COL.nb, style = "W")
58
59 # fit model
60 crime_sar <-
61 lagsarlm(CRIME ~ INC + HOVAL,
62 data = COL.OLD,
63 listw = listw,
64 method = "eigen"
65 )
66
67 # summarize model fit with tidiers
68 tidy(crime_sar)
69 tidy(crime_sar, conf.int = TRUE)
70 glance(crime_sar)
71 augment(crime_sar)
72
73 # fit another model
74 crime_sem <- errorsarlm(CRIME ~ INC + HOVAL, data = COL.OLD, listw)
75
76 # summarize model fit with tidiers
77 tidy(crime_sem)
78 tidy(crime_sem, conf.int = TRUE)
79 glance(crime_sem)
80 augment(crime_sem)
81
82 # fit another model
83 crime_sac <- sacsarlm(CRIME ~ INC + HOVAL, data = COL.OLD, listw)
84
85 # summarize model fit with tidiers
86 tidy(crime_sac)
87 tidy(crime_sac, conf.int = TRUE)
88 glance(crime_sac)
89 augment(crime_sac)
90 \dontshow{\}) # examplesIf}
91 }
92 \seealso{
93 \code{\link[=glance]{glance()}}, \code{\link[spatialreg:ML_models]{spatialreg::lagsarlm()}}, \code{\link[spatialreg:ML_models]{spatialreg::errorsarlm()}},
94 \code{\link[spatialreg:ML_models]{spatialreg::sacsarlm()}}
95
96 Other spatialreg tidiers:
97 \code{\link{augment.sarlm}()},
98 \code{\link{tidy.sarlm}()}
99 }
100 \concept{spatialreg tidiers}
101 \value{
102 A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns:
103 \item{AIC}{Akaike's Information Criterion for the model.}
104 \item{BIC}{Bayesian Information Criterion for the model.}
105 \item{deviance}{Deviance of the model.}
106 \item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.}
107 \item{nobs}{Number of observations used.}
108
109 }