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

原创
2016/09/13 10:29
阅读数 1.4K

方差分析 C++ 库 libANOVA :

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

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();
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
4 收藏
0
分享
返回顶部
顶部