calculateMoranI {Irescale}R Documentation

Calculates the Moran's I using the algorithm proposed by Chen (Chen 2013).

Description

calculateMoranI Moran's I computing method.

I = varOfInterest^t \times weightedM \times varOfInterest

Usage

calculateMoranI(distM, varOfInterest, scaling = TRUE)

Arguments

distM

the distance matrix. Altough the equation asks for weighted distant matrix, the paramenter that is required is only the distance matrix because this procedure calculate calculates the weighted distance mantrix by itself.

varOfInterest

the variable of interest to calculate Moran's I.

scaling

if the values are previously scaled, set this parameter to False. The default value is TRUE.

Value

Moran's I

References

Chen Y (2013). “New approaches for calculating Moran’s index of spatial autocorrelation.” PloS one, 8(7), e68336.

Examples

inputFileName<-system.file("testdata", "chen.csv", package="Irescale")
input<-loadFile(inputFileName)
distM<-calculateEuclideanDistance(input$data)
I<-calculateMoranI(distM = distM,varOfInterest = input$varOfInterest)

[Package Irescale version 2.3.0 Index]