# r3.univar.1grass man page

**r3.univar** — Calculates univariate statistics from the non-null cells of a 3D raster map.

Statistics include number of cells counted, minimum and maximum cell values, range, arithmetic mean, population variance, standard deviation, coefficient of variation, and sum.

## Keywords

raster3d, statistics, univariate statistics

## Synopsis

**r3.univar****r3.univar --help****r3.univar** [-**get**] **map**=*name* [**zones**=*name*] [**output**=*name*] [**percentile**=*float*[,*float*,...]] [**separator**=*character*] [**--overwrite**] [**--help**] [**--verbose**] [**--quiet**] [**--ui**]

### Flags

**-g**- Print the stats in shell script style
**-e**- Calculate extended statistics
**-t**- Table output format instead of standard output format
**--overwrite**- Allow output files to overwrite existing files
**--help**- Print usage summary
**--verbose**- Verbose module output
**--quiet**- Quiet module output
**--ui**- Force launching GUI dialog

### Parameters

**map**=*name***[required]**- Name of 3D raster map
**zones**=*name*- 3D Raster map used for zoning, must be of type CELL
**output**=*name*- Name for output file (if omitted or "-" output to stdout)
**percentile**=*float[,float*,...]- Percentile to calculate (requires extended statistics flag)

Options:*0-100*

Default:*90* **separator**=*character*- Field separator

Special characters: pipe, comma, space, tab, newline

Default:*pipe*

## Description

*r3.univar* calculates the univariate statistics for a 3D raster map. This includes the number of cells counted, minimum and maximum cell values, range, arithmetic mean, population variance, standard deviation, coefficient of variation, and sum. Statistics are calculated separately for every category/zone found in the **zones** input map if given. If the **-e** extended statistics flag is given the 1st quartile, median, 3rd quartile, and given **percentile** are calculated. If the **-g** flag is given the results are presented in a format suitable for use in a shell script. If the **-t** flag is given the results are presented in tabular format with the given field separator. The table can immediately be converted to a vector attribute table which can then be linked to a vector, e.g. the vector that was rasterized to create the **zones** input raster.

## Notes

As with most GRASS raster3d modules, *r3.univar* operates on the voxel array defined by the current 3d region settings, not the original extent and resolution of the input map. See *g.region*.

This module can use large amounts of system memory when the **-e** extended statistics flag is used with a very large region setting. If the region is too large the module should exit gracefully with a memory allocation error. Basic statistics can be calculated using any size input region.

## Example

Computing univariate statistics of a 3D raster with randomly generated values:

```
# generate random map
r3.mapcalc "random_0_1 = rand(0., 1)" -s
# compute univariate statistics
r3.univar map=random_0_1
```

## Todo

*mode, skewness, kurtosis*

## See Also

*g.region, r.univar, r.mode, r.quantile, r.series, r3.stats, r.statistics, v.rast.stats, v.univar*

## Authors

Soeren Gebbert

Code is based on r.univar from

Hamish Bowman, Otago University, New Zealand

and Martin Landa

Zonal loop by Markus Metz

*Last changed: $Date: 2014-10-14 04:57:21 +0200 (Tue, 14 Oct 2014) $*

Main index | 3D raster index | Topics index | Keywords index | Full index

© 2003-2016 GRASS Development Team, GRASS GIS 7.0.4 Reference Manual