NMath Stats User's Guide

TOC | Previous | Next | Index

12.4 Analysis of Variance (.NET, C#, CSharp, VB, Visual Basic, F#)

NMath Stats provides the classes PLS1Anova and PLS2Anova for performing a classic analysis of variance (ANOVA) for PLS1 and PLS2 regression models. These classes calculate the sum of squares total, sum of squares residual, mean square error for prediction, and the coefficient of determination. For instance:

Code Example – C# partial least squares (PLS)

var plsAnova = new PLS2Anova(pls);
DoubleVector ssTotal = plsAnova.SumOfSquaresTotal;
DoubleVector ssResiduals = plsAnova.SumOfSquaresResiduals;
DoubleVector se = plsAnova.StandardError;
DoubleVector rms = plsAnova.RootMeanSqrErrorPrediction;
DoubleVector rSquared = plsAnova.CoefficientOfDetermination;