Dew Stats Master .NET
TMtxAnova Component
Summary
Visual representation of One and Two way ANOVA.

Unit
StatTools

Hierarchy
TMtxAnova

Subclasses
None

Description

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

  1. The data are continuous (not discrete).
  2. The data follow the normal probability distribution. Each group is normally distributed about the group mean.
  3. The variances of the populations are equal.
  4. The groups are independent. There is no relationship among the individuals in one group as compared to another.
  5. 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 Replications 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 FmtString property. Default value is '0.0000'
6) Define (optional) the ResultDest TStringGrid. TMtxAnova results will be outputted to a ResultDest string grid.
7) Perform ANOVA by calling the Recalc method

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

Categories
ANOVA routines.
Regression routines.

Example 1

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.Destroy; end; end;
#include "MtxVecCpp.h" #include "StatTools.hpp" void __fastcall Example(TStringGrid *grid1) { TMtxANOVA *an1 = new TMtxANOVA(this); try { an1->Data->SetIt(6,2,false,OPENARRAY(TSample,(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(); } }


Properties

 Name  Summary 
Alpha Desired significance probability. 
Anova1Res Results of the one way ANOVA. 
Anova2Res Results of the two way ANOVA. 
AutoUpdate  
Data Data for ANOVA. 
Dirty  
FmtString Numeric format for ANOVA table cells. 
IsAnova1 One or two-way ANOVA. 
P Calculated significance probability of null hypothesis. 
Replications Number of observations per data matrix "cell". 
ResultDest Outputs ANOVA table. 

Methods

 Name  Summary 
Loaded  
Recalc Triggers ANOVA recalculation. 
WriteResultToGrid Outputs results to string grid. 
WriteResultToStrings Outputs results to string list. 

Copyright 2008 Dew Research
http://www.dewresearch.com