Field-Map Scripting

4.1.3.2.2 QuadraticMean

QuadraticMean function


Prototype:

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

Description:

Calculates quadratic mean of a specific attribute

Syntax:

variable := QuadraticMean (tab, AttributeName, 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


NullAsZero

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







Return value:

Quadratic mean



Example:


Task:

Calculate quadratic mean of DBH.


Data stored in the database.



Script:

var

 tab : TTableWrapper;

 attributeName: string;

 nullAsZero: boolean;

 x: extended;


begin

 tab:= Trees.table;

 attributeName:= 'DBH_mm';

 nullAsZero:= false;                    // dont want calculate with a null value


 x:= QuadraticMean(tab, attributeName, nullAsZero);


 ShowMessage(FloatToStr(x));

end.


Output in Field-Map Data Collector:

quadratic mean of DBH


See also:

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


Example