Central Moments Example (VB.NET)
[VB.NET]
' COPYRIGHT(C), SIMPLEXAR SOFTWARE LIMITED, 2006-2008.
' All rights reserved.
'
' Use of this copyright notice is precautionary only, and does not imply
' publication or disclosure. The content of this work contains confidential
' and proprietary information of Simplexar Software Limited. Any duplication,
' modification, distribution, or disclosure in any form, in whole, or in part,
' is strictly prohibited without express prior written permission.
' Get namespaces.
Imports System
Imports Simplexar.Statsar
' Start namespace.
Namespace Simplexar.Examples.Statsar
' This example uses the statistics calculator to perform central moment
' statistics on a data sheet (e.g. skew and kurtosis).
Module Example
' The application entry point.
Public Sub Main()
Try
RunExample()
Catch exception As Exception
Console.WriteLine(exception)
End Try
Console.WriteLine("Press ENTER to terminate.")
Console.ReadLine()
End Sub
Private Sub RunExample()
' Create a calculator.
Dim calculator As New StatsCalculator()
' Use the calculator to load the sheet.
Dim sheet As DataSheet = calculator.Load( _
"..\..\..\..\..\Data\ExamResults.csv")
Console.WriteLine(sheet)
' Calculate central moment statistics for
' the math result column.
Console.WriteLine("Skew: {0}", _
calculator.Skew("MathResult"))
Console.WriteLine("Kurtosis: {0}", _
calculator.Kurtosis("MathResult"))
Console.WriteLine("5th standard moment: {0}", _
calculator.StandardMoment("MathResult", 5))
Console.WriteLine("6th central moment: {0}", _
calculator.CentralMoment("MathResult", 6))
End Sub
End Module
End Namespace