logo-header

 
 

 syntax

definition

  1. var(a) results in a parameter with the variance of the non null values of attribute a.
  2. var(a, relation) results in an attribute with the variance of the non null values of attribute a, grouped by the relation attribute. The domain unit of the resulting attribute is the values unit of the relation attribute.

description

The variance is calculated as the square of the sum of the differences of each value and the mean value of the distribution. This square is divided by the number of values (n). This way of calculating the variance is different from e.g. the ms Excel VAR function, which divides the sum of the differences by n-1.

applies to

Attribute with Numeric value type
Relation attribute with value type of the group CanBeDomainUnit

conditions

The value type of argument a and the resulting data item must match.

The domain of arguments a and relation must match.

since version

5.15

example

parameter<float32> varNrInh := var(float32(City/NrInhabitants));
result = 24166.67
attribute<float32>  varNrInhRegion (Region)
:= var(float32(City/NrInhabitants), City/Region_rel);
City/NrInhabitants City/Region_rel
550 0
525 1
300 2
500 1
200 3
175 null
null 3
domain City, nr of rows = 7

varNrInhRegion
0
156.25
0
0
null
domain Region, nr of rows = 5

OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904