ANOVA with C#

I wrote an article titled “ANOVA with C#” in the October 2016 issue of Microsoft MSDN Magazine. See

ANOVA (“analysis of variance”) is a classical statistics technique that allows you to infer if the means of three or more groups are equal (or not all equal) in situations where you only have samples from the population groups.


For example, suppose you want to know if the average IQ of three different groups of people (Caucasian software engineers in Seattle, under-represented minority artists in Chicago, Hispanic service industry workers in Dallas) are the same. And suppose you somehow get 50 randomly selected target people from each group to take an IQ test and get average results of 115, 82, 91. Sure the sample means are different, but the three population means could actually be equal and the observed differences could have been due to how your samples were selected.


An ANOVA test gives you the probability that the three population means are in fact equal. For example, if you run an ANOVA analysis and get a p-value of 0.003 you’d conclude that, subject to certain math assumptions, the average IQs of the three groups are not all equal.

The program code for ANOVA is very, very deep and relies on several very clever algorithms that were developed decades ago. In my article, I explain exactly how to write ANOVA code that can be integrated into a software system (as opposed to using one of many tools, such as Excel or R, that can perform ANOVA, but are difficult or impossible to integrate).

This entry was posted in Machine Learning. Bookmark the permalink.