anova.sarlm {spdep} | R Documentation

## Comparison of simultaneous autoregressive models

### 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

    anova.sarlm(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 Roger.Bivand@nhh.no

### See Also

`LR.sarlm`, `AIC`

### Examples

    data(columbus)
    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)

[Package spdep version 0.3-25 Index]