Learn R Programming

spdep (version 0.1-10)

localmoran.sad: Saddlepoint approximation of local Moran's Ii tests

Description

The function implements Tiefelsdorf's application of the Saddlepoint approximation to local Moran's Ii's reference distribution. Tests are reported for separately for each zone selected, and may be summarised using summary.localmoransad. Values of local Moran's Ii agree with those from localmoran(), but in that function, the standard deviate - here the Saddlepoint approximation - is based on the randomisation assumption.

Usage

localmoran.sad(model, select, nb, glist=NULL, style="W", zero.policy=FALSE,
  alternative="greater", spChk=NULL, save.Vi=FALSE)
as.data.frame.localmoransad(x, row.names=NULL, optional=FALSE) 
print.localmoransad(x, ...)
summary.localmoransad(object, ...)
print.summary.localmoransad(x, ...)
listw2star(listw, ireg, style, n, D, a, zero.policy=FALSE)

Arguments

model
an object of class lm returned by lm; weights and offsets should not be used
select
an integer vector of the id. numbers of zones to be tested
nb
a list of neighbours of class nb
glist
a list of general weights corresponding to neighbours
style
can take values W, B, C, and S
zero.policy
if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
alternative
a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided.
spChk
should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption()
save.Vi
if TRUE, return the star-shaped weights lists for each zone tested
x
object to be printed
row.names
ignored argument to as.data.frame.localmoransad; row names assigned from localmoransad object
optional
ignored argument to as.data.frame.localmoransad; row names assigned from localmoransad object
object
object to be summarised
...
arguments to be passed through
listw
a listw object created for example by nb2listw
ireg
a zone number
n
internal value depending on listw and style
D
internal value depending on listw and style
a
internal value depending on listw and style

Value

  • A list with class localmoransad containing "select" lists, each with class moransad with the following components:
  • statisticthe value of the saddlepoint approximation of the standard deviate of local Moran's Ii.
  • p.valuethe p-value of the test.
  • estimatethe value of the observed local Moran's Ii.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string giving the method used.
  • data.namea character string giving the name(s) of the data.
  • internal1Saddlepoint omega, r and u
  • dfdegrees of freedom
  • taumaximum and minimum analytical eigenvalues
  • izone tested

Details

The function implements the analytical eigenvalue calculation together with trace shortcuts given or suggested in Tiefelsdorf (2002), partly following remarks by J. Keith Ord, and uses the Saddlepoint analytical solution from Tiefelsdorf's SPSS code. No n by n matrices are needed at any point, the star-shaped weights matrices being handled as listw lists.

References

Tiefelsdorf, M. 2002 The Saddlepoint approximation of Moran's I and local Moran's Ii reference distributions and their numerical evaluation. Geographical Analysis, 34, pp. 187--206; see also Tiefelsdorf's SPSS code: http://geog-www.sbs.ohio-state.edu/faculty/tiefelsdorf/GeoStat.htm.

See Also

localmoran, lm.morantest, lm.morantest.sad

Examples

Run this code
data(eire)
e.lm <- lm(OWNCONS ~ ROADACC, data=eire.df)
e.locmor <- summary(localmoran.sad(e.lm, eire.nb, select=1:nrow(eire.df)))
mean(e.locmor[,1])
lm.morantest(e.lm, nb2listw(eire.nb))

Run the code above in your browser using DataLab