Sub Main

'Declare the variable that will reference the application
	Dim GrapherApp As Object
	Set GrapherApp = CreateObject("Grapher.Application")
	GrapherApp.Visible = True

'Declares Wks As an Object
	Dim Wks As Object

'Opens a data file in the worksheet
	Set Wks = GrapherApp.Documents.Open(GrapherApp.Path+"\samples\bar chart orientations.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(1, 3)

'Uses the WksRange object statistics method to store statistics for columns A, B and C.
	Set Stats = WksRange.Statistics(True, True, wksStatsAll)

'Returns the number of columns for which the statistics are stored
	Debug.Print "Number of columns: "; WksRange.ColumnCount

'Returns the Average Deviation statistic value for columns A, B and C.
	Debug.Print "Average Deviation, colA: "; Stats.AverageDeviation(1)
	Debug.Print "Average Deviation, colB: "; Stats.AverageDeviation(2)
	Debug.Print "Average Deviation, colC: "; Stats.AverageDeviation(3)

'Returns the first row, last row, column label, number of values, and missing values used from column C
	Debug.Print "First Input Row:   "; Stats.FirstRow(3)
	Debug.Print "Last Input Row:  "; Stats.LastRow(3)
	Debug.Print "Label:  "; Stats.Label(3)
	Debug.Print "Number of Values, colC:  "; Stats.Count(3)
	Debug.Print "Number of Missing Values  "; Stats.Missing(3)

'Returns the other statistic values for column C
	Debug.Print "Sample Coefficient of Variation  "; Stats.CoefficientOfVariation(3)
	Debug.Print "Sample 95% Confidence Interval for the Mean  "; Stats.ConfidenceInterval95(3)
	Debug.Print "Sample 99% Confidence Interval for the Mean  "; Stats.ConfidenceInterval99(3)
	Debug.Print "First Quartile (25th percentile)  "; Stats.FirstQuartile(3)
	Debug.Print "Critical Value of the K-S Statistic at 90%  "; Stats.KSCriticalValue90(3)
	Debug.Print "Critical Value of the K-S Statistic at 95%  "; Stats.KSCriticalValue95(3)
	Debug.Print "Critical Value of the K-S Statistic at 99%  "; Stats.KSCriticalValue99(3)
	Debug.Print "Sample Kolmogorov-Smirnov Goodness of Fit  "; Stats.KSStatistic(3)
	Debug.Print "Sample Kurtosis  "; Stats.Kurtosis(3)
	Debug.Print "Maximum  "; Stats.Maximum(3)
	Debug.Print "Mean  "; Stats.Mean(3)
	Debug.Print "Median  "; Stats.Median(3)
	Debug.Print "Minimum  "; Stats.Minimum(3)
	Debug.Print "Range  "; Stats.Range(3)
	Debug.Print "Sample Skewness  "; Stats.Skewness(3)
	Debug.Print "Sample Standard Deviation  "; Stats.StandardDeviation(3)
	Debug.Print "Sample Standard Error of the Mean  "; Stats.StandardError(3)
	Debug.Print "Sum  "; Stats.Sum(3)
	Debug.Print "Third Quartile (75th percentile)  "; Stats.ThirdQuartile(3)
	Debug.Print "Sample Variance  "; Stats.Variance(3)

End Sub
