You are here: Symbol Reference > Regress Namespace > Functions > Regress.ANOVA1 Function
Stats Master VCL
ContentsIndex
Example

The following example will perform ANOVA on single variable with three groups (0,1,2 - stored in GroupIndex vector).

Use MtxExpr, Math387, Regress;
var GroupIndex : Vector;
  Data: Vector;
  ANOVARes : TANOVA1Result;
  SigProb : double;
begin
  Data.SetIt(false,[1,2,3,4,5,6,7,8,9,10,11,12]);
  GroupIndex.SetIt(false,[0,0,0,0,1,1,1,1,2,2,2,2]);
  ANOVARes := ANOVA1(Data,GroupIndex,SigProb);
  // ANOVARes = (SS1:128; SS2:15; SSTotal:143;
  // Deg1:2; Deg2:9; DegTotal:11; MS1:64;
  // MS2:1.6666666667; FDist:38.4; FCrit:4.2564947291)
  // SigProb = 3.9210149408e-05
end;
#include "MtxExpr.hpp"
#include "Regress.hpp"
#include "Math387.hpp"
void __fastcall Example()
{
  sVector Data, GroupIndex;
  TANOVA1Result ANOVAResult;
  double signprob;
  Data.SetIt(false,OPENARRAY(double,(1,2,3,4,5,6,7,8,9,10,11,12)));
  GroupIndex.SetIt(false,OPENARRAY(double,(0,0,0,0,1,1,1,1,2,2,2,2)));
  ANOVAResult = ANOVA1(Data,GroupIndex,signprob,0.05);
  // ANOVARes = (SS1:128; SS2:15; SSTotal:143;
  // Deg1:2; Deg2:9; DegTotal:11; MS1:64;
  // MS2:1.6666666667; FDist:38.4; FCrit:4.2564947291)
  // signprob = 3.9210149408e-05
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.