r.stats.quantile1grass
Compute category quantiles using two passes.
Usage
r.stats.quantile
r.stats.quantile --help
r.stats.quantile [-rpt]
base=name
cover=name
[quantiles=integer]
[percentiles=float
[,float, ...]]
[bins=integer]
[output=name
[,name, ...]]
[file=name]
[separator=character]
[--overwrite]
[--help]
[--verbose]
[--quiet]
[--ui]
Keywords
raster, statistics, zonal statistics, percentile, quantile
Overview
r.stats.quantile is a tool to analyse exploratory statistics of a floating-point "cover layer" according to how it intersects with objects in a "base layer". It provides quantile calculations as selected "zonal statistics".
Notes
r.stats.quantile is intended to be a partial replacement for r.statistics, with support for floating-point cover maps. It provides quantile calculations, which are absent from r.stats.zonal.
Quantiles are calculated following algorithm 7 from Hyndman and Fan (1996), which is also the default in R and numpy.
Examples
In this example, the raster polygon map zipcodes in the North Carolina sample dataset is used to calculate quantile raster statistics using the elevation raster map:
g.region raster=zipcodes -p# print quantilesr.stats.quantile base=zipcodes cover=elevation quantiles=3 -p27511:0:33.333333:134.71739227511:1:66.666667:143.98572327513:0:33.333333:140.66999327513:1:66.666667:146.27944927518:0:33.333333:115.14010127518:1:66.666667:129.893723[...]# write out percentile raster mapsr.stats.quantile base=zipcodes cover=elevation percentiles=25,50,75 \output=zipcodes_elev_q25,zipcodes_elev_q50,zipcodes_elev_q75
References
- •
-
Hyndman and Fan (1996) Sample Quantiles in Statistical Packages, American Statistician. American Statistical Association. 50 (4): 361-365. DOI: 10.2307/2684934
- •
-
Engineering Statistics Handbook: Percentile, NIST
Source code
Available at: r.stats.quantile source code (history)
Accessed: Monday Feb 24 17:50:52 2025
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
Releases
5 releases since Debian 9 (Stretch); the text changed 4 times.