anova.sarlm: Comparison of simultaneous autoregressive models

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/anova.sarlm.R

Description

One of a number of tools for comparing simultaneous autoregressive models, in particular nested models. The function is based on anova.lme() for comparing linear mixed models, and follows that function in using the "anova" generic name.

Usage

1
2
## S3 method for class 'sarlm'
anova(object, ...)

Arguments

object

object is of class sarlm

...

other objects of class sarlm or class lm

Details

If successive models have different numbers of degrees of freedom, a likelihood ratio test will be performed between them. It is important to recall that tests apply to nested models, and this function at least attempts to make sure that the response variable in the models being compared has the same name. Useless results can still be generated when incomparable models are compared, it being the responsibility of the user to check.

Value

The function returns a data frame printed by default functions

Author(s)

Roger Bivand [email protected]

See Also

LR.sarlm, AIC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (require(rgdal, quietly=TRUE)) {
example(columbus, package="spData")
lm.mod <- lm(CRIME ~ HOVAL + INC, data=columbus)
lag <- lagsarlm(CRIME ~ HOVAL + INC, data=columbus, nb2listw(col.gal.nb))
mixed <- lagsarlm(CRIME ~ HOVAL + INC, data=columbus, nb2listw(col.gal.nb),
  type="mixed")
error <- errorsarlm(CRIME ~ HOVAL + INC, data=columbus, nb2listw(col.gal.nb))
LR.sarlm(mixed, error)
anova(lag, lm.mod)
anova(lag, error, mixed)
AIC(lag, error, mixed)
}

spdep documentation built on Aug. 15, 2018, 5:03 p.m.