Click or drag to resize
RunBasicStatistics Method (String, Int32)
Executes some Basic statistics from given value.

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static List<string> BasicStatistics(
	string p_Value,
	int p_StatisticsFunction
)

Parameters

p_Value
Type: SystemString
The values from clipboard.
p_StatisticsFunction
Type: SystemInt32
The statistics function to use.

Return Value

Type: ListString
The result stats as a list of string.
Examples
Code sample below is a demonstration of how to get some basic statistics from a list of numeric values already in the clipboard.
Example VB.Net
Imports System
Imports System.Collections
Imports System.Text '    for StringBuilder
Imports Biolomics.BioCallback
Imports Biolomics.SharedClasses
Imports System.Windows.Forms

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim program As New Program
        'run the basic stats 
        program.RunStats()
        'run the basic stats with low percentil and high percentil
        program.RunBasicStats()
    End Sub

    Public Sub RunBasicStats()
        Dim StatsType As StatisticsEnum = StatisticsEnum.All

        '    Data should be numeric values separated by TAB, CRLF or by whitespaces
        Dim Values As String = Clipboard.GetText
        '    or something like this for testing purposes: Values = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbTab & "5" & vbTab & "6" & vbTab & "7" & vbTab & "8" & vbTab & "9"

        Dim Results As Generic.List(Of String) = Run.BasicStatistics(Values, StatsType, 0.1, 0.9)

        Dim strB As New StringBuilder(2048)
        strB.Append("Stats with maximum params " & vbCrLf)
        strB.Append("Minimum: " & Results(0) & vbCrLf)
        strB.Append("Maximum: " & Results(1) & vbCrLf)
        strB.Append("Mean: " & Results(2) & vbCrLf)
        strB.Append("Median: " & Results(3) & vbCrLf)
        strB.Append("LowPercentile: " & Results(4) & vbCrLf)
        strB.Append("HighPercentile: " & Results(5) & vbCrLf)
        strB.Append("Variance: " & Results(6) & vbCrLf)
        strB.Append("StandardDeviation: " & Results(7) & vbCrLf)
        strB.Append("Kurtosis: " & Results(8) & vbCrLf)
        strB.Append("Skewness: " & Results(9) & vbCrLf)
        strB.Append("NumberObservations: " & Results(10) & vbCrLf)

        Console.Write(strB.ToString)
    End Sub

    Public Sub RunStats()
        Dim StatsType As StatisticsEnum = StatisticsEnum.All

        '    Data should be numeric values separated by TAB, CRLF or by whitespaces
        Dim Values As String = Clipboard.GetText
        '    or something like this for testing purposes: Values = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbTab & "5" & vbTab & "6" & vbTab & "7" & vbTab & "8" & vbTab & "9"

        Dim Results As Generic.List(Of String) = Run.BasicStatistics(Values, StatsType)

        Dim strB As New StringBuilder(2048)
        strB.Append("Stats with minimum params " & vbCrLf)
        strB.Append("Minimum: " & Results(0) & vbCrLf)
        strB.Append("Maximum: " & Results(1) & vbCrLf)
        strB.Append("Mean: " & Results(2) & vbCrLf)
        strB.Append("Median: " & Results(3) & vbCrLf)
        strB.Append("LowPercentile: " & Results(4) & vbCrLf)
        strB.Append("HighPercentile: " & Results(5) & vbCrLf)
        strB.Append("Variance: " & Results(6) & vbCrLf)
        strB.Append("StandardDeviation: " & Results(7) & vbCrLf)
        strB.Append("Kurtosis: " & Results(8) & vbCrLf)
        strB.Append("Skewness: " & Results(9) & vbCrLf)
        strB.Append("NumberObservations: " & Results(10) & vbCrLf)

        Console.Write(strB.ToString)
    End Sub
End Class
See Also