1v.db.univar(1)              GRASS GIS User's Manual             v.db.univar(1)
2
3
4

NAME

6       v.db.univar   - Calculates univariate statistics on selected table col‐
7       umn for a GRASS vector map.
8

KEYWORDS

10       vector, statistics, attribute table
11

SYNOPSIS

13       v.db.univar
14       v.db.univar --help
15       v.db.univar     [-eg]     map=name      [layer=string]      column=name
16       [where=sql_query]    [percentile=float[,float,...]]   [--help]  [--ver‐
17       bose]  [--quiet]  [--ui]
18
19   Flags:
20       -e
21           Extended statistics (quartiles and 90th percentile)
22
23       -g
24           Print stats in shell script style
25
26       --help
27           Print usage summary
28
29       --verbose
30           Verbose module output
31
32       --quiet
33           Quiet module output
34
35       --ui
36           Force launching GUI dialog
37
38   Parameters:
39       map=name [required]
40           Name of vector map
41           Or data source for direct OGR access
42
43       layer=string
44           Layer number or name
45           Vector features can have category values in different layers.  This
46           number determines which layer to use. When used with direct OGR ac‐
47           cess this is the layer name.
48           Default: 1
49
50       column=name [required]
51           Name of attribute column on which to calculate statistics (must  be
52           numeric)
53
54       where=sql_query
55           WHERE conditions of SQL statement without ’where’ keyword
56           Example: income < 1000 and population >= 10000
57
58       percentile=float[,float,...]
59           Percentile to calculate (requires extended statistics flag)
60           Options: 0-100
61           Default: 90
62

DESCRIPTION

64       v.db.univar  calculates  basic  univariate  statistics  for numeric at‐
65       tributes in a vector attribute table. It will calculate minimum,  maxi‐
66       mum,  range,  mean, standard deviation, variance, coefficient of varia‐
67       tion, quartiles, median, and 90th percentile.
68
69       v.db.univar uses db.univar which in turn uses db.select to get the  at‐
70       tribute  values on which it calculates the statistics.  This means that
71       statistics are calculated based on the entries in the attribute  table,
72       not  based on the features in the map. One attribute value is read from
73       each line in the attribute table, whether there are no, one or  several
74       features  with  the  category value referenced by that line, or whether
75       any features have more than one category value.  For feature-based, in‐
76       stead of attribute table-based, univariate statistics on attributes see
77       v.univar.  NOTES A database connection must be defined for the selected
78       vector layer.
79

EXAMPLES

81   Univariate statistics on attribute table column
82       In this example, the 30 years precipitation data table is statistically
83       analysed (North Carolina sample dataset) and univariate statistics per‐
84       formed:
85       # show columns of attribute table connected to precipitation map
86       v.info -c precip_30ynormals
87       # univariate statistics on 30 years annual precipitation in NC
88       v.db.univar precip_30ynormals column=annual
89        Number of values: 136
90        Minimum: 947.42
91        Maximum: 2329.18
92        Range: 1381.76
93        Mean: 1289.31147058823
94        [...]
95
96   Univariate statistics on randomly sampled data points
97       In  this  example,  random  points  are  sampled from the elevation map
98       (North Carolina sample dataset) and univariate statistics performed:
99       g.region raster=elevation -p
100       v.random output=samples n=100
101       v.db.addtable samples column="heights double precision"
102       v.what.rast samples raster=elevation column=heights
103       v.db.select samples
104       v.db.univar samples column=heights
105

SEE ALSO

107        db.univar, r.univar, v.univar, db.select, d.vect.thematic, v.random
108
109        GRASS SQL interface
110

AUTHORS

112       Michael Barton, Arizona State University
113
114       and authors of r.univar.sh (Markus Neteler et al.)
115

SOURCE CODE

117       Available at: v.db.univar source code (history)
118
119       Accessed: Mon Jun 20 16:47:46 2022
120
121       Main index | Vector index | Topics index | Keywords index  |  Graphical
122       index | Full index
123
124       © 2003-2022 GRASS Development Team, GRASS GIS 8.2.0 Reference Manual
125
126
127
128GRASS 8.2.0                                                     v.db.univar(1)
Impressum