Scroll to navigation

r.stats.quantile(1grass) GRASS GIS User's Manual r.stats.quantile(1grass)

NAME

r.stats.quantile - Compute category quantiles using two passes.

KEYWORDS

raster, statistics, zonal statistics, percentile, quantile

SYNOPSIS

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]

Flags:


Create reclass map with statistics as category labels

Do not create output maps; just print statistics

Print statistics in table format

Allow output files to overwrite existing files

Print usage summary

Verbose module output

Quiet module output

Force launching GUI dialog

Parameters:


Name of base raster map

Name of cover raster map

Number of quantiles

List of percentiles
Default: 50

Number of bins to use
Default: 1000

Resultant raster map(s)

Name for output file (if omitted or "-" output to stdout)

Field separator
Special characters: pipe, comma, space, tab, newline
Default: :

DESCRIPTION

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.

EXAMPLE

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 quantiles
r.stats.quantile base=zipcodes cover=elevation quantiles=3 -p
27511:0:33.333333:134.717392
27511:1:66.666667:143.985723
27513:0:33.333333:140.669993
27513:1:66.666667:146.279449
27518:0:33.333333:115.140101
27518:1:66.666667:129.893723
[...]
# write out percentile raster maps
r.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

SEE ALSO

r.quantile, r.stats.zonal, r.statistics

AUTHORS

Glynn Clements
Markus Metz

SOURCE CODE

Available at: r.stats.quantile source code (history)

Accessed: Sunday Jan 22 07:36:31 2023

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual

GRASS 8.2.1