方差分析 C++ 库 libANOVA :
[libANOVA on GitHub] (https://github.com/Amuwa/libAnova)
Include the header
#include "../../anova/libAnova.h"
Define the experiments
vector<int> eCols;
eCols.push_back(3);//the 3rd (0-based) column is the empty column
ANOVA a(4, eCols);//total 4 columns with the last column as the error column
Add experimental data
vector<double> x1;
x1.push_back(1); //0-th column
x1.push_back(10); //1st column
x1.push_back(30); //2nd column
x1.push_back(2); //3rd column
double y1 = 30.4; //the y value/response
//
a.AddData(x1,y1); //add a row of data into the ANOVA objects
Set names for sources
//set the name of each column (the source)
a.SetColumnName(0,"Factor-1");
a.SetColumnName(1,"Factor-2");
a.SetColumnName(2,"Factor-3");
Do ANOVA
a.doANOVA();