WksStatistics Object

The WksStatistics object holds results calculated by the WksRange.Statistics method. Once calculated, the statistics stored in this object do not change, even if the cells in the source WksRange change.

The following table provides the properties of the WksStatistics object. All these properties are read-only properties.

Property

Description

Application

Returns the application object.

AverageDeviation

Returns the average deviation of the data values in the column from which the statistics were calculated.

CoefficientOfVariation

Returns the coefficient of variation of the data values in the column from which the statistics were calculated.

ColumnCount

Returns the number of columns for which statistics are stored.

ConfidenceInterval95

Returns the 95% confidence interval for the mean of the data values in the column from which the statistics were calculated.

ConfidenceInterval99

Returns the 99% confidence interval for the mean of the data values in the column from which the statistics were calculated.

Count

Returns the number of data values in the column from which the statistics were calculated.

FirstQuartile

Returns the first quartile (25th percentile) of the data values in the column from which the statistics were calculated.

FirstRow

Returns the first row from which the data were retrieved

KSCriticalValue90

Returns the 90% critical value of the Kolmogorov-Smirnov statistic for the number of data values in the column from which the statistics were calculated.

KSCriticalValue95

Returns the 95% critical value of the Kolmogorov-Smirnov statistic for the number of data values in the column from which the statistics were calculated.

KSCriticalValue99

Returns the 99% critical value of the Kolmogorov-Smirnov statistic for the number of data values in the column from which the statistics were calculated.

KSStatistic

Returns the Kolmogorov-Smirnov goodness-of-fit statistic (versus a normal probablility curve) for the data values in the column from which the statistics were calculated.

Kurtosis

Returns the coefficient of kurtosis for the data values in the column from which the statistics were calculated.

Label

Returns the label for the column containing the data from which the statistics were calculated.

LastRow

Returns the last row from which the data were retrieved

Maximum

Returns the maximum of the data values in the column from which the statistics were calculated.

Mean

Returns the mean of the data values in the column from which the statistics were calculated.

Median

Returns the median of the data values in the column from which the statistics were calculated.

Minimum

Returns the mimimum of the data values in the column from which the statistics were calculated.

Missing

Returns the number of missing data values in the column from which the statistics were calculated.

Mode

Returns the data value or values that appear most often in the column from which the statistics were calculated.

Parent

Returns the worksheet from which the Statistics were calculated.

Range

Returns the difference between the maximum and minimum data values in the column from which the statistics were calculated.

Skewness

Returns the coefficient of skewness for the data values in the column from which the statistics were calculated.

StandardDeviation

Returns the standard deviation of the data values in the column from which the statistics were calculated.

StandardError

Returns the standard error of the data values in the column from which the statistics were calculated.

Sum

Returns the sum of the data values in the column from which the statistics were calculated.

ThirdQuartile

Returns the third quartile (75th percentile) of the data values in the column from which the statistics were calculated.

Variance

Returns the variance of the data values in the column from which the statistics were calculated.

Example

The following script demonstrates how the WksStatistics object is used in reference to the WksRange object.

Sub Main

 

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns it

'to the variable named "SurferApp"

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Wks as an object

Dim Wks As Object

 

'Opens a worksheet document in Surfer and assigns it to the

'variable named "Wks"

Set Wks = SurferApp.Documents.Open(FileName:=SurferApp.Path+"\Samples\demogrid.dat")

 

'Declares WksRange as an object

Dim WksRange As Object

 

'Assigns columns A, B, and C to the variable named "WksRange"

Set WksRange = Wks.Columns(Col1:=1, Col2:=3)

 

'Uses the WksRange object statistics method to store statistics

Set Stats = WksRange.Statistics(Sample:=True, Header:=True, Flags:=wksStatsAll)

 

End Sub