1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <Eigen/Dense>
#include <iostream>
#include <string>
using namespace std;
using namespace Eigen;
main(){
MatrixXd Y(10,1);
MatrixXd X1(10,2);
MatrixXd X2(10,1);
Y<<50,51,52,54,53,60,59,65,67,70;
X1<<29,54
,39,61
,26,52
,48,70
,42,63
,64,79
,45,68
,30,65
,51,79
,44,76;
X2<<29,39,26,48,42,64,45,30,51,44;
...
}
//############################
//Analysis of Variance Table
//Model 1: Y ~ Xf
//Model 2: Y ~ Xr
// Res.Df RSS Df Sum of Sq F Pr(>F)
//1 7 29.30
//2 8 409.88 -1 -380.57 90.912 2.926e-05 ***
|