Learn R Programming

Irescale (version 2.3.0)

calculateMoranI: Calculates the Moran's I using the algorithm proposed by Chen chen2009Irescale.

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

Examples

Run this code
# NOT RUN {
inputFileName<-system.file("testdata", "chen.csv", package="Irescale")
input<-loadFile(inputFileName)
distM<-calculateEuclideanDistance(input$data)
I<-calculateMoranI(distM = distM,varOfInterest = input$varOfInterest)
# }

Run the code above in your browser using DataLab