1v.univar(1) Grass User's Manual v.univar(1)
2
3
4
6 v.univar - Calculates univariate statistics of vector map features.
7 Variance and standard deviation is calculated only for points if speci‐
8 fied.
9
11 vector, statistics, univariate statistics, attribute table, geometry
12
14 v.univar
15 v.univar --help
16 v.univar [-gewd] map=name [layer=string] [type=string[,string,...]]
17 [column=name] [where=sql_query] [percentile=integer] [--help]
18 [--verbose] [--quiet] [--ui]
19
20 Flags:
21 -g
22 Print the stats in shell script style
23
24 -e
25 Calculate extended statistics
26
27 -w
28 Weigh by line length or area size
29
30 -d
31 Calculate geometric distances instead of attribute statistics
32
33 --help
34 Print usage summary
35
36 --verbose
37 Verbose module output
38
39 --quiet
40 Quiet module output
41
42 --ui
43 Force launching GUI dialog
44
45 Parameters:
46 map=name [required]
47 Name of vector map
48 Or data source for direct OGR access
49
50 layer=string
51 Layer number or name
52 Vector features can have category values in different layers. This
53 number determines which layer to use. When used with direct OGR
54 access this is the layer name.
55 Default: 1
56
57 type=string[,string,...]
58 Input feature type
59 Options: point, line, boundary, centroid, area
60 Default: point,line,area
61
62 column=name
63 Name of attribute column
64
65 where=sql_query
66 WHERE conditions of SQL statement without ’where’ keyword
67 Example: income < 1000 and population >= 10000
68
69 percentile=integer
70 Percentile to calculate (requires extended statistics flag)
71 Options: 0-100
72 Default: 90
73
75 v.univar calculates univariate statistics on (by default) an attribute
76 of, or, through the -d flag on distance between, vector map features.
77 Attributes are read per feature and per category value. This means that
78 if the map contains several features with the same category value, the
79 attribute is read as many times as there are features. On the other
80 hand, if a feature has more than one category value, each attribute
81 value linked to each of the category values of the feature is read. For
82 statistics on one attribute per category value, instead of one
83 attribute per feature and per category, see v.db.univar.
84
85 Extended statistics (-e) adds median, 1st and 3rd quartiles, and 90th
86 percentile to the output.
87
89 When using the -d flag, univariate statistics of distances between vec‐
90 tor features are calculated. The distances from all features to all
91 other features are used. Since the distance from feature A to feature B
92 is the same like the distance from feature B to feature A, that dis‐
93 tance is considered only once, i.e. all pairwise distances between fea‐
94 tures are used. Depending on the selected vector type, distances are
95 calculated as follows:
96
97 · type=point: point distances are considered;
98
99 · type=line: line to line distances are considered;
100
101 · type=area: not supported, use type=centroid instead (and see
102 v.distance for calculating distances between areas)
103
105 The examples are based on the North Carolina sample dataset.
106
107 Example dataset preparation
108 g.region raster=elevation -p
109 v.random output=samples npoints=100
110 v.db.addtable map=samples columns="heights double precision"
111 v.what.rast map=samples rast=elevation column=heights
112 v.db.select map=samples
113
114 Calculate height attribute statistics
115 v.univar -e samples column=heights type=point
116 number of features with non NULL attribute: 100
117 number of missing attributes: 0
118 number of NULL attributes: 0
119 minimum: 57.2799
120 maximum: 148.903
121 range: 91.6235
122 sum: 10825.6
123 mean: 108.256
124 mean of absolute values: 108.256
125 population standard deviation: 20.2572
126 population variance: 410.356
127 population coefficient of variation: 0.187123
128 sample standard deviation: 20.3593
129 sample variance: 414.501
130 kurtosis: -0.856767
131 skewness: 0.162093
132 1st quartile: 90.531
133 median (even number of cells): 106.518
134 3rd quartile: 126.274
135 90th percentile: 135.023
136
137 Compare to statistics of original raster map
138 r.univar -e elevation
139 total null and non-null cells: 2025000
140 total null cells: 0
141 Of the non-null cells:
142 ----------------------
143 n: 2025000
144 minimum: 55.5788
145 maximum: 156.33
146 range: 100.751
147 mean: 110.375
148 mean of absolute values: 110.375
149 standard deviation: 20.3153
150 variance: 412.712
151 variation coefficient: 18.4057 %
152 sum: 223510266.558102
153 1st quartile: 94.79
154 median (even number of cells): 108.88
155 3rd quartile: 126.792
156 90th percentile: 138.66
157
158 Calculate statistic of distance between sampling points
159 v.univar -d samples type=point
160 number of primitives: 100
161 number of non zero distances: 4851
162 number of zero distances: 0
163 minimum: 69.9038
164 maximum: 18727.7
165 range: 18657.8
166 sum: 3.51907e+07
167 mean: 7254.33
168 mean of absolute values: 7254.33
169 population standard deviation: 3468.53
170 population variance: 1.20307e+07
171 population coefficient of variation: 0.478132
172 sample standard deviation: 3468.89
173 sample variance: 1.20332e+07
174 kurtosis: -0.605406
175 skewness: 0.238688
176
178 db.univar, r.univar, v.db.univar, v.distance, v.neighbors, v.qcount
179
181 Radim Blazek, ITC-irst
182
183 extended by:
184 Hamish Bowman, University of Otago, New Zealand
185 Martin Landa
186
187 Last changed: $Date: 2018-09-30 19:02:53 +0200 (Sun, 30 Sep 2018) $
188
190 Available at: v.univar source code (history)
191
192 Main index | Vector index | Topics index | Keywords index | Graphical
193 index | Full index
194
195 © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
196
197
198
199GRASS 7.4.4 v.univar(1)