Field-Map Scripting

4.1.3.2.3 WeightedMean

WeightedMean function


Prototype:

function WeightedMean (TableOrLayer :TObjectWrapper; const AttributeName :string; const WeightAttribute :string; const NullAsZero :boolean) : extended;

Description:

Calculates weighted mean of a specific attribute

Syntax:

variable := WeightedMean (tab, AttributeName, WeightAttribute, NullAsZero);


Part

Description


variable

A variable declared as type of extended


tab

Table containing source variables


AttributeName

Attribute of source table containing data to enter calculations


WeightAttribute

Attribute of source table containing weights


NullAsZero

Boolean expression defining whether to exclude null (false) entries or replace nulls with zeros (true)







Return value:

Weighted mean



See also:

Mean; QuadraticMean; WeightedMean; Median; SampleVariance; StandardDeviation; StandardError; MeanError;VarianceOfMean; WeightedSampleVariance; WeightedStandardDeviation; WeightedVarianceOfMean;ConfidenceIntervalOfMean; VarianceOfTotal; ConfidenceIntervalOfTotal; StratifiedConfidenceIntervalOfTotal; SampleSize;ShowDistributionChart; ParameterizeRegressionModel; CalculateModelValue


Example