Function Math Statistics Class

ZTst

Returns the two-tailed P-value of a z-test.

Signature (Visual Basic / VBA)

Public Function ZTst( _
      ByRef vValues As Variant _
    , ByVal vX As Variant _
    , Optional ByVal vStdDev As Variant _
    ) As Variant

Code Example

    ZTst(SampleData, 140) = 1.86856876203254E-02
    ZTst(SampleData, 145) = 0.47548674795769
    ZTst(SampleData, 150) = 0.974926913222556

Parameters

Parameter Description
vValues Numeric-type array or Variant array containing only numeric elements. This function is NOT affected by the current setting of the StatVarType Property. It assumes that vValues is an array that contains only numeric elements.
vX The value to be tested against the data in vValues.
vStdDev Optional known standard deviation to be used within the cumulative distribution function. Function uses the sample standard deviation if vStdDev is missing.

Return Value

Function returns the two-tailed P-value of a z-test. Function returns Null if the array is empty, if vX cannot be interpreted as a number, or if there is some type of error, such as if the argument is a Variant array which contains an Object reference or String.