Unit
StatTools
Hierarchy
TMtxAnova
Subclasses
None
Encapsulates one and two way analysis of variance (ANOVA) routines. The assumptions of the one and two-way analysis of variance are:
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.
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(); } }
| 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. |
| Name | Summary |
|---|---|
| Loaded | |
| Recalc | Triggers ANOVA recalculation. |
| WriteResultToGrid | Outputs results to string grid. |
| WriteResultToStrings | Outputs results to string list. |
| Copyright 2008 Dew Research |