Learn R Programming

spdep (version 0.1-10)

LR.sarlm: Likelihood ratio test

Description

The function provides a likelihood ratio test for objects for which a logLik() function exists for their class, or for objects of class logLik.

Usage

LR.sarlm(x, y)
logLik.sarlm(object, ...)

Arguments

x
a logLik object or an object for which a logLik() function exists
y
a logLik object or an object for which a logLik() function exists
object
a sarlm object from lagsarlm() or errorsarlm()
...
other arguments to logLik()

Value

  • LR.sarlm() returns an object of class htest with:
  • statisticvalue of statistic
  • parameterdegrees of freedom
  • p.valueProbability value
  • estimateLog likelihood values of compared models
  • method"Likelihood ratio for spatial linear models"
  • logLik.sarlm() returns an object of class logLik

See Also

logLik.lm

Examples

Run this code
data(oldcol)
mixed <- lagsarlm(CRIME ~ HOVAL + INC, data=COL.OLD, nb2listw(COL.nb),
  type="mixed")
error <- errorsarlm(CRIME ~ HOVAL + INC, data=COL.OLD, nb2listw(COL.nb))
LR.sarlm(mixed, error)

Run the code above in your browser using DataLab