You are here: Symbol Reference > StatTools Namespace > Classes > TMtxAnova Class
Stats Master VCL
ContentsIndex
Example

How to setup, run and output to table two way ANOVA: 

 

var MtxANOVA1: TMtxAnova;
begin
  MTxANOVA1 := TMtxANOVA.Create;
  try
    // setup data
    MtxANOVA1.Data.SetIt(6,2,false,[1,2,
                                  2,3,
                                  5,7,
                                  12,1,
                                  5,8,
                                  3,8]);
    MtxANOVA1.IsAnova1 := false; // do two-way ANOVA
    MtxANOVA1.Replications := 3; // three rows per "group"
    // output ANOVA table to StringGrid1
    MtxANOVA1.ResultDest := StringGrid1;
    MtxANOVA1.Recalc;
  finally
    MtxANOVA.Free;
  end;
end;
#include "MtxExpr.hpp"
#include "StatTools.hpp"
void __fastcall Example(TStringGrid *grid1)
{
  TMtxAnova *an1 = new TMtxAnova(this);
  try
  {
    an1->Data->SetIt(6,2,false,OPENARRAY(double,(1,2,
                                  2,3,
                                  5,7,
                                  12,1,
                                  5,8,
                                  3,8)));
    an1->IsAnova1 = false; // do two-way ANOVA
    an1->Replications = 3; // three rows per "group"
    // output ANOVA table to grid1
    an1->ResultDest = grid1;
    an1->Recalc();
  }
  __finally
  {
    an1->Free();
  }
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.