data(used.cars)
moran.test(spNamedVec("price.1960", used.cars), nb2listw(usa48.nb))
moran.plot(spNamedVec("price.1960", used.cars), nb2listw(usa48.nb),
labels=rownames(used.cars))
uc.lm <- lm(price.1960 ~ tax.charges, data=used.cars)
summary(uc.lm)
lm.morantest(uc.lm, nb2listw(usa48.nb))
lm.morantest.sad(uc.lm, nb2listw(usa48.nb))
lm.LMtests(uc.lm, nb2listw(usa48.nb))
uc.err <- errorsarlm(price.1960 ~ tax.charges, data=used.cars,
nb2listw(usa48.nb))
summary(uc.err)
uc.lag <- lagsarlm(price.1960 ~ tax.charges, data=used.cars,
nb2listw(usa48.nb))
summary(uc.lag)
uc.lag1 <- lagsarlm(price.1960 ~ 1, data=used.cars,
nb2listw(usa48.nb))
summary(uc.lag1)
uc.err1 <- errorsarlm(price.1960 ~ 1, data=used.cars,
nb2listw(usa48.nb))
summary(uc.err1)
Run the code above in your browser using DataLab