Running an ANOVA using .NET 4.5
The relevant methods are in the namespace System.Web.UI.DataVisualization.Charting. (Add it to your class.) Add the reference System.Web.DataVisualization to your solution.
If you have a Chart object, you can get an ANOVA result using:
chart.DataManipulator.Statistics.Anova([significance level], "[dataset1],[dataset2],[dataset3]");
e.g. chart.DataManipulator.Statistics.Anova(0.05, "gender,age,result");
To get your data into a chart object, use the DataSource property. The input to this property could be many things.
If you have multiple independent variables, use a DataTable like so:
- Add columns to datatable, setting column names
-For each combination of variables, add a row:
m,10,10.4
m,67,30.5
f,10,59.4
f,67,55.7