You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Classes > TMtxAnova Class
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
TMtxAnova Class

Visual representation of One and Two way ANOVA.

Dew_Stats_TMtxAnova
Syntax
C#
Visual Basic
public class TMtxAnova : TMtxComponent;

StatTools.cs

Encapsulates one and two way analysis of variance (ANOVA) routines. The assumptions of the one and two-way analysis of variance are:

  • The data are continuous (not discrete).
  • The data follow the normal probability distribution. Each group is normally distributed about the group mean.
  • The variances of the populations are equal.
  • The groups are independent. There is no relationship among the individuals in one group as compared to another.
  • Each group is a simple random sample from its population. Each individual in the population has an equal probability of being selected in the sample.

How to use TMtxAnova component?

  1. Drop a TMtxAnova component on the form.
  2. Define if you'll do a one-way or two-way ANOVA (the IsAnova1 property).
  3. If you'll be doing the two-way ANOVA, define the number of replications per "cell" (the crefReplications property).
  4. Define the data you wish to analyze. Depending on IsAnova1 and Replications properties Data matrix can be interpreted in different ways.
  5. Define the default number format for ANOVA table - the crefFmtString property. Default value is '0.0000'.
  6. Define (optional) the ResultDest TStringGrid. TMtxAnova results will be outputted to a crefResultDest string grid.
  7. Perform ANOVA by calling the crefRecalc method.

Results:

  1. If you specified crefResultDest then the standard ANOVA table will be written to ResultDest string grid. If ResultDest is nil, you can still use crefWriteResultToGrid or crefWriteResultToStrings methods to output ANOVA table to a TStringGrid or TStrings.
  2. crefP returns the significance probability of null hypothesis that means are equal. If P is less than desired significance crefAlpha then the result suggests, the null hypothesis (means are equal) can be rejected.

How to setup and run two sample t-test.

using Dew.Stats.Units; using Dew.Stats; using Dew.Math; namespace Dew.Examples { private void Example() { TMtxAnova an1 = new TMtxAnova(this); try { an1.Data.SetIt(6, 2, false, new 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.Recalc(); double aresult = an1.Anova2Res.FCrit; } finally { an1.Free(); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!