Learn R Programming

mapi (version 1.0.5)

MAPI_Tails: Function MAPI_Tails

Description

Determine significant continuous and discontinuous areas from the result of a MAPI analysis when run with permutations.

Usage

MAPI_Tails(resu, minQ = 0, alpha = 0.05)

Arguments

resu

A spatial object of class 'sf' resulting from a MAPI analysis done using either MAPI_RunAuto or MAPI_RunOnGrid.

minQ

Threshold under which cells with the smallest sum-of-weights percentile (range 1 .. 100) are discarded (default value = 0). This parameter allows to discard cells for which the average value of the pairwise metric is computed using either a small number and/or only long-distance ellipses.

alpha

Significance level (default=0.05)

Value

a spatial object of class 'sf' with the area and geometry of the polygons delineating the significant areas. A column provides the tail for each polygon (upper or lower).

Details

When permutations are performed, in MAPI_RunOnGrid for each cell, the proportion of permuted values that are smaller or greater than the observed value provides a lower-tailed (ltP) and upper-tailed (utP) test p-value. A false discovery rate (FDR) procedure (Benjamini and Yekutieli, 2001) is applied to account for multiple testing (number of cells) under positive dependency conditions (spatial autocorrelation). An adjusted p-value is computed for each cell using the function p.adjust from the 'stats' package with the method 'BY'. The significance level at which FDR is controlled is set through the parameter alpha. For example, when alpha is set to 0.05, this means that 5\

Significant cells belonging to the lower (or upper) tail that are spatially connected are aggregated together to form the significant areas with the lowest (or greater) average values of the pairwise metric analyzed.

References

Benjamini, Y. and Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 29, 1165<U+2013>1188.

Examples

Run this code
# NOT RUN {
data("metric")
data("samples")
# Run MAPI computation
resu <- MAPI_RunAuto(samples, metric, crs=3857, nbPermuts=1000)
# Discards the 10% cells with the smallest sum-of-weights 
#    and aggregates adjacent cells belonging to the same tail 
#    at a 5% significance level
tails <- MAPI_Tails(resu, minQ=10, alpha=0.05)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab