方差分析庫 ANOVA C++ (libANOVA)

方差分析 C++ 庫 libANOVA :git

[libANOVA on GitHub] (https://github.com/Amuwa/libAnova)github

screen shot

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();
相關文章
相關標籤/搜索