Irescale (version 0.2.6)

resamplingI: Calculates n permutations of the variable of interest to calculate n different I in order to create the \(Null\) distribution.

Description

resamplingI Permute n-1 times the values of the variable of interest to calculate a Null distribution for I. It is done n-1, because one order is the original one, to make sure it is included.

Usage

resamplingI(n, distM, varOfInterest, scaling = TRUE)

Arguments

n

number of permutations.

distM

the distance matrix. Although the equation requires a weighted distant matrix, the only parameter that will be needed is the distance matrix. This procedure is able to calculate the weighted distance matrix by itself.

varOfInterest

the variable name or position of the variable we are interested to calculate the spatial autocorrelation.

scaling

The default value is TRUE. However, if the values are previously scaled, this parameter must be set to FALSE..

Value

A vector with the n calculated Moran's I.

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)
vI<-resamplingI(1000,distM, input$varOfInterest)
# }

Run the code above in your browser using DataCamp Workspace