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

Performs a one-way (single-factor) analysis of variance (ANOVA).

Pascal
function ANOVA1(const Data: TMtx; out p: double; Alpha: double = 0.05): TANOVA1Result; overload;
Parameters 
Description 
Data 
Data matrix, each column is separate group. 
Returns the significance probability of null hypothesis that two means are equal. If p is less than desired significance alpha then the result suggests the null hypothesis (two means are equal) can be rejected. 
Alpha 
Desired significance level. 

Performs a one-way (single-factor) analysis of variance.

The following example will perform ANOVA1 on 4 variables.

Uses MtxExpr, Regress, Math387;
procedure Example;
  var Data: Matrix;
  ANOVARes : TANOVA1Result;
  SigProb : double;
begin
  Data.SetIt(4,4,false,[3.2, 2.5, 5.5, 7.0,
                        6.2, 12.0, 3.0, 4.1,
                        1.5, 5.7, 4.9, 3.5,
                        2.5, 3.1, 3.2, 3.4]);
  ANOVARes := ANOVA1(Data,SigProb);
  // ANOVARes = (SS1:12.771875; SS2:82.1475; SSTotal:94.919375;
  // Deg1:3; Deg2:12; DegTotal:15; MS1:4.2572916667;
  // MS2:6.845625; FDist:0.62189963176; FCrit:3.4902948195
  // SigProb = 0.614256442
end;
#include "MtxExpr.hpp"
#include "Regress.hpp"
#include "Math387.hpp"
void __fastcall Example()
{
  sMatrix Data;
  TANOVA1Result ANOVAResult;
  double signprob;
  Data.SetIt(4,4,false,OPENARRAY(double,(3.2, 2.5, 5.5, 7.0,
                        6.2, 12.0, 3.0, 4.1,
                        1.5, 5.7, 4.9, 3.5,
                        2.5, 3.1, 3.2, 3.4)));
  ANOVAResult = ANOVA1(Data,signprob,0.05);
  // ANOVARes = (SS1:12.771875; SS2:82.1475; SSTotal:94.919375;
  // Deg1:3; Deg2:12; DegTotal:15; MS1:4.2572916667;
  // MS2:6.845625; FDist:0.62189963176; FCrit:3.4902948195
  // SigProb = 0.614256442
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!