RunBasicStatistics Method (String, Int32, Double, Double) |
Namespace: Biolomics.BioCallback
public static List<string[]> BasicStatistics( string p_Value, int p_StatisticsFunction, double p_LowPercentile, double p_HighPercentile )
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