# NOT RUN {
example(aple)
plt_out <- aple.plot(as.vector(scale(wheat$yield_detrend, scale=FALSE)),
nb2listw(nbr12, style="W"), cex=0.6)
crossprod(plt_out$Y, plt_out$X)/crossprod(plt_out$X)
lm_obj <- lm(Y ~ X, plt_out)
abline(lm_obj)
abline(v=0, h=0, lty=2)
zz <- summary(influence.measures(lm_obj))
infl <- as.integer(rownames(zz))
points(plt_out$X[infl], plt_out$Y[infl], pch=3, cex=0.6, col="red")
wheat$localAple <- localAple(as.vector(scale(wheat$yield_detrend, scale=FALSE)),
nb2listw(nbr12, style="W"))
mean(wheat$localAple)
hist(wheat$localAple)
spl <- list("sp.text", coordinates(wheat)[infl,], rep("*", length(infl)))
spplot(wheat, "localAple", sp.layout=spl)
# }
Run the code above in your browser using DataLab