Field-Map Scripting

4.1.3.2.6 StandardDeviation

StandardDeviation function


Prototype:

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

Description:

Calculates standard deviation of a specific attribute

Syntax:

variable := StandardDeviation (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:

Standard deviation





Example:


Task:

Calculate standard deviation 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:= StandardDeviation(tab, attributeName, nullAsZero);


 ShowMessage(FloatToStr(x));

end.


Output in Field-Map Data Collector:

standard deviation 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