The anova()
function provides tables of fitted
spsur models including information criteria (AIC and BIC),
log-likelihood and degrees of freedom of each fitted model. The
argument lrtest
allows to perform LR tests between nested models.
The plot()
function allows the user to plot both beta and spatial
coefficients for all equations of the spsur model. The argument
viewplot
is used to choose between interactive or non-interactive
plots. The print()
function is used to print short tables including the values of beta and
spatial coefficients as well as p-values of significance test for each
coefficient. This can be used as an alternative to
summary.spsur
when a brief output is needed.
The rest of methods works in the usual way.
# S3 method for spsur
anova(object, ..., lrtest = TRUE)# S3 method for spsur
coef(object, ...)
# S3 method for spsur
fitted(object, ...)
# S3 method for spsur
logLik(object, ...)
# S3 method for spsur
residuals(object, ...)
# S3 method for spsur
vcov(object, ...)
# S3 method for spsur
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for spsur
plot(x, ci = 0.95, viewplot = TRUE, ...)
further arguments passed to or from other methods.
logical value to compute likelihood ratio
test for nested models in `anova` method. Default = TRUE
similar to object
argument for print()
and plot
functions.
number of digits to show in printed tables. Default: max(3L, getOption("digits") - 3L).
confidence level for the intervals in `plot` method.
Default ci = 0.95
logical value to show interactively the plots.
Default = TRUE
# NOT RUN {
rm(list = ls()) # Clean memory
data(spc)
Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA
spcsur.sim <-spsurml(formula = Tformula, data = spc, type = "sim")
## Print Table
print(spcsur.sim)
# }
# NOT RUN {
spcsur.slm <-spsurml(formula = Tformula, data = spc, type = "slm",
listw = Wspc)
# ANOVA table and LR test for nested models:
anova(spcsur.sim, spcsur.slm)
## Plot spatial and beta coefficients
# Interactive plot
plot(spcsur.slm)
# Non-interactive plot
if (require(gridExtra)) {
pl <- plot(spcsur.slm, viewplot = FALSE)
grid.arrange(pl$lplbetas[[1]], pl$lplbetas[[2]],
pl$pldeltas, nrow = 3)
}
# }
Run the code above in your browser using DataLab