methods_spsur: Methods for class spsur

methods_spsurR Documentation

Methods for class spsur

Description

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.

Usage

## 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, ...)

Arguments

object

a spsur object created by spsurml, spsur3sls or spsurtime.

...

further arguments passed to or from other methods.

lrtest

logical value to compute likelihood ratio test for nested models in 'anova' method. Default = TRUE

x

similar to object argument for print() and plot functions.

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 ci = 0.95

viewplot

logical value to show interactively the plots. Default = TRUE

Author(s)

Fernando Lopez fernando.lopez@upct.es
Roman Minguez roman.minguez@uclm.es
Jesus Mur jmur@unizar.es

Examples

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)
}


spsur documentation built on Oct. 30, 2022, 1:06 a.m.