Regress.ANOVA1 Method

Overload List

#SignatureDescription
1function ANOVA1(const Data: TMtx; out p: Double; Alpha: Double): TANOVA1Result;Performs a one-way (single-factor) analysis of variance (ANOVA).
2function ANOVA1(const Data: TVec; const GroupIndex: TVecInt; out p: Double; Alpha: Double): TANOVA1Result;Perform the one-way analysis of variance where Data vector (one variable) is indexed by a second grouping GroupIndex vector variable.

Overload 1: function ANOVA1(const Data: TMtx; out p: Double; Alpha: Double): TANOVA1Result;

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

#NameDescription
1DataData matrix, each column is separate group.
2AlphaDesired significance level.
3pReturns 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.

Returns: TANOVA1Result

Remarks:

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

Examples
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;

Overload 2: function ANOVA1(const Data: TVec; const GroupIndex: TVecInt; out p: Double; Alpha: Double): TANOVA1Result;

Perform the one-way analysis of variance where Data vector (one variable) is indexed by a second grouping GroupIndex vector variable.

#NameDescription
1DataData vector of single variable.
2AlphaDesired significance level.
3GroupIndexStores group indexes.
4pReturns 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.

Returns: TANOVA1Result

Examples
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;
See Also: Regress.ANOVA2