methods_spsur | R Documentation |
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 class 'spsur' anova(object, ..., lrtest = TRUE) ## S3 method for class 'spsur' coef(object, ...) ## S3 method for class 'spsur' fitted(object, ...) ## S3 method for class 'spsur' logLik(object, ...) ## S3 method for class 'spsur' residuals(object, ...) ## S3 method for class 'spsur' vcov(object, ...) ## S3 method for class 'spsur' print(x, digits = max(3L, getOption("digits") - 3L), ...) ## S3 method for class 'spsur' plot(x, ci = 0.95, viewplot = TRUE, ...)
object |
a |
... |
further arguments passed to or from other methods. |
lrtest |
logical value to compute likelihood ratio
test for nested models in 'anova' method. Default = |
x |
similar to |
digits |
number of digits to show in printed tables. Default: max(3L, getOption("digits") - 3L). |
ci |
confidence level for the intervals in 'plot' method.
Default |
viewplot |
logical value to show interactively the plots.
Default = |
Fernando Lopez | fernando.lopez@upct.es |
Roman Minguez | roman.minguez@uclm.es |
Jesus Mur | jmur@unizar.es |
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) 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) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.