You are here: Symbol Reference > Dew.Stats Namespace > Regress Class > Regress Methods > ANOVA1 Method > ANOVA1 Method (TVec, TVec, TSample, TSample)
Dew Stats for .NET
Contents
PreviousUpNext
Regress.ANOVA1 Method (TVec, TVec, TSample, TSample)

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

C#
public TANOVA1Result ANOVA1(TVec Data, TVec GroupIndex, ref double p, double alpha);
Parameters
Parameters 
Description 
Data 
Data vector of single variable. 
GroupIndex 
Stores group indexes. 
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. 

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

using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
  private void Example()
  {
    Vector Data = new Vector(0);
    Vector GroupIndex = new Vector(0);
    double signprob;
    TANOVA1Result ar;
    Data.SetIt(false, new double[] {1,2,3,4,5,6,7,8,9,10,11,12});
    GroupIndex.SetIt(false, new double[] {0,0,0,0,1,1,1,1,2,2,2,2});
    ar = Regress.ANOVA1(Data,GroupIndex,out 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
  }
}
What do you think about this topic? Send feedback!
Copyright (c) 1999-2010 by Dew Research. All rights reserved.