Statsar Examples
This page contains examples for the Statsar statistics library.
You can browse each example in both C# and VB.NET.
Getting Started
| Example |
Description |
QuickStart C# VB.NET |
Loads a simple CSV file from Excel (already included as part of the distribution) and computes the average of one of the columns. |
Working with Data
| Example |
Description |
AccessDatabase C# VB.NET
|
Demonstrates how to import data from an ADO.NET data table by connecting to a Microsoft Access database and loading data. |
ImportArrays C# VB.NET |
Shows how to import data from different types of arrays including one-dimensional arrays, multidimensional arrays and jagged arrays. |
ImportReflection C# VB.NET
|
Loads an array of objects using reflection, and illustrates how to bind to a custom object model. |
FilterRows C# VB.NET |
Uses expressions to filter out unwanted rows from a data sheet. This method does not alter the data sheet. Instead a new data sheet with filtered rows is returned. |
TransformColumns C# VB.NET
|
Uses the SheetFilter class to transform data. Two columns are combined to form a new column by using an expression. |
GroupData C# VB.NET |
Illustrates how to group data. When grouping data, rows are combined together from the original data to produce a set of summary rows. |
SortData C# VB.NET |
Uses the DataSheet.Sort method to sort a data sheet. Data is sorting according to multiple columns in both ascending and descending orders. |
Statistics Calculator
| Example |
Description |
SummaryStatistics C# VB.NET
|
Uses the statistics calculator to perform summary statistics on a data sheet (e.g. mean, median and mode). |
SpreadDeviation C# VB.NET |
Uses the statistics calculator to perform spread and deviation statistics on a data sheet (e.g. variance and standard deviation). |
PercentilesRanks C# VB.NET |
Uses the statistics calculator to perform percentiles and rank statistics on a data sheet (e.g. interquartile range and percentiles). |
CentralMoments C# VB.NET
|
Uses the statistics calculator to perform central moment statistics on a data sheet (e.g. skew and kurtosis). |
SpecialFunctions C# VB.NET
|
Uses the statistics calculator to evaluate special functions (e.g. binomial coefficients and gamma functions). |
Random Number Generators
| Example |
Description |
MersenneTwisterRandom C# VB.NET
|
Illustrates how to generate random deviates using the Mersenne twister random number generator algorithm. |
Probability Distributions
| Example |
Description |
DistributionFunctions C# VB.NET |
Demonstrates how to create a probability distribution and calculate distribution functions (i.e. the PDF, CDF and inverse CDF), as well as moments (e.g. skew and kurtosis). |
DistributionRandom C# VB.NET
|
Shows how to generate random deviates which are distributed according to a probability distribution. |
Vectors, Matrices and Linear Regression
| Example |
Description |
SolveLinearSystem C# VB.NET
|
Illustrates how to solve a linear system of equations by using the matrix class Solve method. |
SimpleLinearRegression C# VB.NET
|
Explains how to perform simple linear regression by fitting a linear equation to two variables. |
MultipleLinearRegression C# VB.NET
|
Explains how to perform multiple linear regression by fitting a linear equation to multiple variables. |
PolynomialRegression C# VB.NET
|
Explains how to perform polynomial regression by fitting a polynomial curve to observed data. |
Hypothesis Tests
| Example |
Description |
OneSampleZTestDemo C# VB.NET |
Shows how to perform a statistical hypothesis test by using the one sample Z-test class. This tests if a sample comes from a particular population, by comparing means. |
OneSampleTTestDemo C# VB.NET |
Shows how to perform a statistical hypothesis test by using the one sample T-test class. This tests if a sample comes from a particular population, by comparing means. |
TwoSamplePairedTTestDemo C# VB.NET |
Shows how to perform a statistical hypothesis test by using the two sample paired T-test class. This tests if the mean of the paired differences of two samples is 0. |
Analysis of Variance
| Example |
Description |
OneWayAnovaDemo C# VB.NET |
Illustrates how to perform a one way analysis of variance by using the OneWayAnova class from the Statsar.Simplexar.Anova namespace. |
TwoWayAnovaDemo C# VB.NET |
Illustrates how to perform a two way analysis of variance by using the TwoWayAnova class from the Statsar.Simplexar.Anova namespace. |
TwoWayRepeatedAnovaDemo C# VB.NET |
Illustrates how to perform a two way repeated analysis of variance by using the TwoWayRepeatedAnova class from the Statsar.Simplexar.Anova namespace. |