LazStats: improved report layout of BlkAnovaUnit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7491 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-06-23 22:10:44 +00:00
parent 82c367cb71
commit 8eaf0586a4
3 changed files with 399 additions and 413 deletions

View File

@ -574,7 +574,7 @@ object BlksAnovaFrm: TBlksAnovaFrm
OnChange = VarChange
ReadOnly = True
TabOrder = 3
Text = 'Edit1'
Text = 'Factor1'
end
end
object Panel3: TPanel
@ -654,7 +654,7 @@ object BlksAnovaFrm: TBlksAnovaFrm
OnChange = VarChange
ReadOnly = True
TabOrder = 3
Text = 'Edit1'
Text = 'Factor2'
end
end
object Panel4: TPanel
@ -734,7 +734,7 @@ object BlksAnovaFrm: TBlksAnovaFrm
OnChange = VarChange
ReadOnly = True
TabOrder = 3
Text = 'Edit1'
Text = 'Factor3'
end
end
object Bevel1: TBevel

View File

@ -86,42 +86,43 @@ type
private
{ private declarations }
FAutoSized: Boolean;
NoSelected, N : integer;
ColNoSelected : IntDyneVec;
outline, cellstring : string;
SSDep, SSErr, SSF1, SSF2, SSF3, SSF1F2, SSF1F3, SSF2F3, SSF1F2F3 : double;
MSDep, MSErr, MSF1, MSF2, MSF3, MSF1F2, MSF1F3, MSF2F3, MSF1F2F3 : double;
DFTot, DFErr, DFF1, DFF2, DFF3, DFF1F2, DFF1F3, DFF2F3, DFF1F2F3 : double;
Omega, OmegaF1, OmegaF2, OmegaF3, OmegaF1F2, F, MinSize, MaxSize : double;
OmegaF1F3, OmegaF2F3, OmegaF1F2F3 : double;
FF1, FF2, FF1F2, ProbF1, ProbF2, ProbF3, ProbF1F2, ProbF1F3 : double;
FF3, FF2F3, FF1F3, FF1F2F3, ProbF2F3, ProbF1F2F3 : double;
DepVarCol, F1Col, F2Col, F3Col, Nf1cells, Nf2cells, Nf3cells : integer;
NoSelected, N: integer;
ColNoSelected: IntDyneVec;
outline, cellstring: string;
SSDep, SSErr, SSF1, SSF2, SSF3, SSF1F2, SSF1F3, SSF2F3, SSF1F2F3: double;
MSDep, MSErr, MSF1, MSF2, MSF3, MSF1F2, MSF1F3, MSF2F3, MSF1F2F3: double;
DFTot, DFErr, DFF1, DFF2, DFF3, DFF1F2, DFF1F3, DFF2F3, DFF1F2F3: double;
Omega, OmegaF1, OmegaF2, OmegaF3, OmegaF1F2, F: Double;
MinSize: Double;
OmegaF1F3, OmegaF2F3, OmegaF1F2F3: double;
FF1, FF2, FF1F2, ProbF1, ProbF2, ProbF3, ProbF1F2, ProbF1F3: double;
FF3, FF2F3, FF1F3, FF1F2F3, ProbF2F3, ProbF1F2F3: double;
DepVarCol, F1Col, F2Col, F3Col, Nf1cells, Nf2cells, Nf3cells: integer;
MeanDep, MeanF1, MeanF2, MeanF3: double;
minf1, maxf1, minf2, maxf2, minf3, maxf3, nofactors, totcells : integer;
cellcnts : IntDyneVec; // array of cell counts
cellvars : DblDyneVec; // arrray of cell sums of squares then variances
cellsums : DblDyneVec; // array of cell sums then means
equal_grp : boolean; // check for equal groups for post-hoc tests
counts : IntDyneMat; // matrix for 2-way containing cell sizes
sums : DblDyneMat; // matrix for 2-way containing cell sums
vars : DblDyneMat; // matrix for 2-way containing sums of squares
RowSums : DblDyneVec; // 2 way row sums
ColSums : DblDyneVec; // 2 way col sums
RowCount : IntDyneVec; // 2 way row count
ColCount : IntDyneVec; // 2 way col count
SlcSums : DblDyneVec; // 3 way slice sums
SlcCount : IntDyneVec; // 3 way slice counts
NoGrpsA, NoGrpsB, NoGrpsC : integer;
OrdMeansA, OrdMeansB, OrdMeansC : DblDyneVec; // reordered means for f1, f2, f3
allAlpha, PostHocAlpha : double; // alphas for tests
minf1, maxf1, minf2, maxf2, minf3, maxf3, nofactors, totcells: integer;
cellcnts: IntDyneVec; // array of cell counts
cellvars: DblDyneVec; // arrray of cell sums of squares then variances
cellsums: DblDyneVec; // array of cell sums then means
equal_grp: boolean; // check for equal groups for post-hoc tests
counts: IntDyneMat; // matrix for 2-way containing cell sizes
sums: DblDyneMat; // matrix for 2-way containing cell sums
vars: DblDyneMat; // matrix for 2-way containing sums of squares
RowSums: DblDyneVec; // 2 way row sums
ColSums: DblDyneVec; // 2 way col sums
RowCount: IntDyneVec; // 2 way row count
ColCount: IntDyneVec; // 2 way col count
SlcSums: DblDyneVec; // 3 way slice sums
SlcCount: IntDyneVec; // 3 way slice counts
NoGrpsA, NoGrpsB, NoGrpsC: integer;
OrdMeansA, OrdMeansB, OrdMeansC: DblDyneVec; // reordered means for f1, f2, f3
AllAlpha, PostHocAlpha: double; // alphas for tests
// wsum : array[1..20,1..20,1..20] of double; // sums for 3 way
// ncnt : array[1..20,1..20,1..20] of integer; // n in 3 way cells
// wx2 : array[1..20,1..20,1..20] of double; // sums of squares for 3 way cells
wsum, wx2 : DblDyneCube;
ncnt : IntDyneCube;
OKterms : array[1..14] of integer;
CompError : boolean;
wsum, wx2: DblDyneCube;
ncnt: IntDyneCube;
OKterms: array[1..14] of integer;
CompError: boolean;
procedure GetLevels;
procedure Calc1Way;
@ -234,8 +235,8 @@ begin
begin
DepVar.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.ComputeBtnClick(Sender: TObject);
@ -356,7 +357,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf1, maxf1, posthocAlpha, lReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, 0.05, lReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, allAlpha, posthocAlpha, lReport);
if BrownForsythe.Checked then
BrownForsytheOneWay(lReport);
if Welch.Checked then
@ -479,8 +480,8 @@ begin
begin
VarList.Items.Add(Factor1.Text);
Factor1.Text := '';
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.Fact2InClick(Sender: TObject);
@ -492,8 +493,8 @@ begin
begin
Factor2.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.Fact2OutClick(Sender: TObject);
@ -502,8 +503,8 @@ begin
begin
VarList.Items.Add(Factor2.Text);
Factor2.Text := '';
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.Fact3InClick(Sender: TObject);
@ -515,8 +516,8 @@ begin
begin
Factor3.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.Fact3OutClick(Sender: TObject);
@ -525,8 +526,8 @@ begin
begin
VarList.Items.Add(Factor3.Text);
Factor3.Text := '';
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.Fact1InClick(Sender: TObject);
@ -538,8 +539,8 @@ begin
begin
Factor1.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
end;
procedure TBlksAnovaFrm.GetLevels;
@ -647,23 +648,28 @@ var
i, grpsize: integer;
minvar, maxvar, sumvar, sumfreqlogvar, sumDFrecip: double;
c, bartlett, cochran, hartley, chiprob: double;
maxSize: Integer;
begin
AReport.Add(DIVIDER);
AReport.Add('ONE WAY ANALYSIS OF VARIANCE RESULTS');
AReport.Add(DIVIDER);
AReport.Add('Dependent variable is: %s', [DepVar.Text]);
AReport.Add('Independent variable is: %s', [Factor1.Text]);
AReport.Add('');
AReport.Add('Dependent variable is: %s, Independent variable is: %s', [DepVar.Text, Factor1.Text]);
AReport.Add('');
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('SOURCE D.F. SS MS F PROB.>F OMEGA SQR.');
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('BETWEEN %4.0f%10.2f%10.2f%10.2f%10.2f%10.2f', [DFF1, SSF1, MSF1, F, ProbF1, Omega]);
AReport.Add('WITHIN %4.0f%10.2f%10.2f', [DFErr, SSErr, MSErr]);
AReport.Add('TOTAL %4.0f%10.2f', [DFTot, SSDep]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('');
AReport.Add('MEANS AND VARIABILITY OF THE DEPENDENT VARIABLE');
AReport.Add('FOR LEVELS OF THE INDEPENDENT VARIABLE');
AReport.Add('');
AReport.Add('MEANS AND VARIABILITY OF THE DEPENDENT VARIABLE FOR LEVELS OF THE INDEPENDENT VARIABLE');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('GROUP MEAN VARIANCE STD.DEV. N');
Areport.Add('---------------------------------------------------------------------');
AReport.Add('----- --------- ---------- ---------- ---------');
// xxxx xxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxx
equal_grp := true;
minvar := 1e20;
@ -673,7 +679,7 @@ begin
sumfreqlogvar := 0.0;
grpsize := round(cellcnts[0]);
MinSize := grpsize; // initialized minimum group size
MaxSize := grpsize; // initialize maximum group size
maxSize := grpsize; // initialize maximum group size
for i := 0 to NF1cells-1 do
begin
grpsize := round(cellcnts[i]);
@ -682,8 +688,8 @@ begin
MinSize := grpsize;
equal_grp := false;
end;
if grpsize > MaxSize then
MaxSize := grpsize;
if grpsize > maxSize then
maxSize := grpsize;
if cellcnts[i] > 1 then
begin
@ -697,14 +703,14 @@ begin
end;
if cellcnts[i] > 0 then
AReport.Add('%4d %10.2f%10.2f%10.2f%4d', [
AReport.Add('%4d %9.2f %10.2f %10.2f %4d', [
i+1, cellsums[i] / cellcnts[i], cellvars[i], sqrt(cellvars[i]), cellcnts[i]
]);
end;
AReport.Add('---------------------------------------------------------------------');
AReport.Add('TOTAL%10.2f%10.2f%10.2f%4d', [MeanDep, MSDep, sqrt(MSDep), N]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add('---------------------------------------------------');
AReport.Add('TOTAL%9.2f %10.2f %10.2f %4d', [MeanDep, MSDep, sqrt(MSDep), N]);
AReport.Add('---------------------------------------------------');
AReport.Add('');
c := 1.0 + (1.0 / (3 * DFF1)) * (sumDFrecip - (1.0 / DFErr));
@ -713,12 +719,14 @@ begin
cochran := maxvar / sumvar;
hartley := maxvar / minvar;
AReport.Add(DIVIDER);
AReport.Add('TESTS FOR HOMOGENEITY OF VARIANCE');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('Hartley Fmax test statistic = %.2f with deg.s freedom: %d and %.0f.', [hartley, NF1cells, MaxSize - 1]);
AReport.Add('Cochran C statistic = %.2f with deg.s freedom: %d and %.0f.', [cochran, NF1cells, MaxSize - 1]);
AReport.Add('Bartlett Chi-square = %0.2f with %.0f D.F. Prob. > Chi-Square = %.3f', [bartlett, DFF1, chiprob]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add('');
AReport.Add('Hartley Fmax test statistic: %8.2f (%d and %d d.f.)', [hartley, NF1cells, maxSize-1]);
AReport.Add('Cochran C statistic: %8.2f (%d and %d d.f.)', [cochran, Nf1cells, maxSize-1]);
AReport.Add('Bartlett Chi-square: %8.2f (%.0f d.f)', [bartlett, DFF1]);
AReport.Add(' probability > Chi-Square: %8.3f', [chiprob]);
AReport.Add(DIVIDER);
end;
procedure TBlksAnovaFrm.OneWayPlot;
@ -808,7 +816,7 @@ begin
grpA := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[F1Col,i])));
grpB := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[F2Col,i])));
X := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[DepVarCol,i]));
X := X*X;
X2 := X*X;
grpA := grpA - minf1 + 1;
grpB := grpB - minf2 + 1;
counts[grpA-1,grpB-1] := counts[grpA-1,grpB-1] + 1;
@ -1057,12 +1065,13 @@ begin
cochran := maxvar / sumvars;
hartley := maxvar / minvar;
AReport.Add(DIVIDER);
AReport.Add('TESTS FOR HOMOGENEITY OF VARIANCE');
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('Hartley Fmax test statistic = %10.2f with deg.s freedom: %d and %d.', [hartley, NoGrpsA*NoGrpsB, groupsize-1]);
AReport.Add('Cochran C statistic = %10.2f with deg.s freedom: %d and %d.', [cochran, NoGrpsA*NoGrpsB, groupsize - 1]);
AReport.Add('Bartlett Chi-square statistic = %10.2f with %4d D.F. Prob. larger value = %6.3f', [bartlett, NoGrpsA*NoGrpsB - 1, chiprob]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER);
end;
procedure TBlksAnovaFrm.TwoWayPlot;
@ -1817,13 +1826,13 @@ begin
chiprob := chisquaredprob(bartlett,round(NoGrpsA * NoGrpsB * NoGrpsC - 1));
cochran := maxvar / sumvars;
hartley := maxvar / minvar;
AReport.Add(DIVIDER);
AReport.Add('TESTS FOR HOMOGENEITY OF VARIANCE');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('Hartley Fmax test statistic = %.2f with deg.s freedom: %d and %d.', [hartley, NoGrpsA*NoGrpsB, groupsize-1]);
AReport.Add(outline);
AReport.Add('Cochran C statistic = %.2f with deg.s freedom: %d and %d.', [cochran, NoGrpsA*NoGrpsB, groupsize - 1]);
AReport.Add('Bartlett Chi-square statistic = %.2f with %d D.F. Prob. larger = %.3f', [bartlett, NoGrpsA*NoGrpsB - 1, 1.0 - chiprob]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('Hartley Fmax test statistic: %8.2f with deg.s freedom: %d and %d.', [hartley, NoGrpsA*NoGrpsB, groupsize-1]);
AReport.Add('Cochran C statistic: %8.2f with deg.s freedom: %d and %d.', [cochran, NoGrpsA*NoGrpsB, groupsize - 1]);
AReport.Add('Bartlett Chi-square statistic: %8.2f with %d D.F. Prob. larger: %.3f', [bartlett, NoGrpsA*NoGrpsB - 1, 1.0 - chiprob]);
AReport.Add(DIVIDER);
end;
procedure TBlksAnovaFrm.ThreeWayPlot;
@ -2087,7 +2096,7 @@ begin
if Bonferoni.Checked then
Bonferroni(RowSums, RowCount, variances, minf1, maxf1, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, RowSums, RowCount, minf1, maxf1, AllAlpha, AReport);
Contrasts(MSErr, DFErr, RowSums, RowCount, minf1, maxf1, AllAlpha, posthocAlpha, AReport);
end;
// Do column comparisons
@ -2118,7 +2127,7 @@ begin
if Bonferoni.Checked then
Bonferroni(ColSums, ColCount, variances, minf2, maxf2, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, ColSums, ColCount, minf2, maxf2, AllAlpha, AReport);
Contrasts(MSErr, DFErr, ColSums, ColCount, minf2, maxf2, AllAlpha, postHocAlpha, AReport);
end;
// do simple effects for columns within each row
@ -2153,7 +2162,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf2, maxf2, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, allAlpha, PostHocAlpha, AReport);
end;
end;
@ -2189,7 +2198,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf1, maxf1, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, allAlpha, postHocAlpha, AReport);
end;
end;
variances := nil;
@ -2241,7 +2250,7 @@ begin
if Bonferoni.Checked then
Bonferroni(RowSums, RowCount, variances, minf1, maxf1, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, RowSums, RowCount, minf1, maxf1, AllAlpha, AReport);
Contrasts(MSErr, DFErr, RowSums, RowCount, minf1, maxf1, allAlpha, postHocAlpha, AReport);
end;
// Do column comparisons
@ -2273,7 +2282,7 @@ begin
if Bonferoni.Checked then
Bonferroni(ColSums, ColCount, variances, minf2, maxf2, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, ColSums, ColCount, minf2, maxf2, AllAlpha, AReport);
Contrasts(MSErr, DFErr, ColSums, ColCount, minf2, maxf2, allAlpha, posthocAlpha, AReport);
end;
// Do slice comparisons
@ -2305,7 +2314,7 @@ begin
if Bonferoni.Checked then
Bonferroni(SlcSums, SlcCount, variances, minf3, maxf3, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, SlcSums, SlcCount, minf3, maxf3, AllAlpha, AReport);
Contrasts(MSErr, DFErr, SlcSums, SlcCount, minf3, maxf3, allAlpha, posthocAlpha, AReport);
end;
// do simple effects for columns within each row
@ -2343,7 +2352,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf2, maxf2, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, allAlpha, posthocAlpha, AReport);
end;
end;
@ -2382,7 +2391,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf1, maxf1, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, allAlpha, posthocAlpha, AReport);
end;
end;
@ -2420,7 +2429,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf2, maxf2, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf2, maxf2, allAlpha, posthocAlpha, AReport);
end;
end;
@ -2458,7 +2467,7 @@ begin
if Bonferoni.Checked then
Bonferroni(cellsums, cellcnts, cellvars, minf1, maxf1, posthocAlpha, AReport);
if OrthoContrasts.Checked then
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, 0.05, AReport);
Contrasts(MSErr, DFErr, cellsums, cellcnts, minf1, maxf1, allAlpha, posthocAlpha, AReport);
end;
end;
variances := nil
@ -2539,18 +2548,21 @@ begin
ProbF1 := probf(F,DFF1,DFErr);
MeanDep := MeanDep / N;
AReport.Add('');
AReport.Add('');
AReport.Add(DIVIDER);
AReport.Add('BROWN-FORSYTHE ONE WAY ANALYSIS OF VARIANCE RESULTS');
AReport.Add('');
AReport.Add('Dependent variable is: %s, Independent variable is: %s', [DepVar.Text, Factor1.Text]);
AReport.Add('');
AReport.Add('Traditional One-Way ANOVA Results');
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER_SMALL);
AReport.Add('SOURCE D.F. SS MS F PROB.>F OMEGA SQR.');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('-----------------------------------------------------------------------');
AReport.Add('BETWEEN %4.0f%10.2f%10.2f%10.2f%10.2f%10.2f', [DFF1, SSF1, MSF1, F, ProbF1, Omega]);
AReport.Add('WITHIN %4.0f%10.2f%10.2f', [DFErr, SSErr, MSErr]);
AReport.Add('TOTAL %4.0f%10.2f', [DFTot, SSDep]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER);
sumc1 := 0.0;
MSErr := 0.0;
@ -2581,11 +2593,11 @@ begin
ProbF1 := probf(NewF,DFF1, fdegfree);
AReport.Add('');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('Brown-Forsythe F statistic = %.3f', [NewF]);
AReport.Add('Brown-Forsythe denominator degrees of freedom = %.0f', [fdegfree]);
AReport.Add('Brown-Forsythe F probability = %.3f', [probf1]);
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER);
AReport.Add('Brown-Forsythe F statistic: %8.3f', [NewF]);
AReport.Add('Brown-Forsythe denominator degrees of freedom: %8.0f', [fdegfree]);
AReport.Add('Brown-Forsythe F probability: %8.3f', [probf1]);
AReport.Add(DIVIDER);
{
if Outputfrm = nil then
@ -2639,7 +2651,7 @@ begin
if not GoodRecord(i,NoSelected,ColNoSelected) then continue;
intvalue := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[F1Col,i])));
X := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[DepVarCol,i]));
X := X*X;
X2 := X*X;
intvalue := intvalue - minf1;
cellcnts[intvalue] := cellcnts[intvalue] + 1;
cellsums[intvalue] := cellsums[intvalue] + X;
@ -2726,9 +2738,12 @@ begin
// F := MSF1 / MSErr;
// ProbF1 := probf(F,DFF1, DFErr);
AReport.Add('');
AReport.Add(DIVIDER);
AReport.Add('WELCH ONE WAY ANALYSIS OF VARIANCE RESULTS');
AReport.Add('');
AReport.Add('Dependent variable is: %s, Independent variable is: %s', [DepVar.Text, Factor1.Text]);
AReport.Add('Dependent variable is: %s', [DepVar.Text]);
AReport.Add('Independent variable is: %s', [Factor1.Text]);
AReport.Add('');
{ OutputFrm.RichEdit.Lines.Add('---------------------------------------------------------------------');
OutputFrm.RichEdit.Lines.Add('SOURCE D.F. SS MS F PROB.>F OMEGA SQR.');
@ -2742,20 +2757,11 @@ begin
OutputFrm.RichEdit.Lines.Add(outline);
OutputFrm.RichEdit.Lines.Add('---------------------------------------------------------------------');
OutputFrm.RichEdit.Lines.Add(''); }
AReport.Add('Welch F statistic = %8.4f', [F]);
AReport.Add('Welch denominator degrees of freedom = %3.0f', [v]);
AReport.Add('Welch F statistic: %8.4f', [F]);
AReport.Add('Welch denominator degrees of freedom: %8.0f', [v]);
probF1 := probf(F,DFF1,v);
AReport.Add('Welch F probability = %5.3f', [probf1]);
{
if OutputFrm = nil then
OutputFrm := TOutputFrm.Create(Application)
else
OutputFrm.Clear;
OutputFrm.AddLines(AReport);
OutputFrm.ShowModal;
}
AReport.Add('Welch F probability: %8.3f', [probf1]);
WelchtTests(AReport);
end;
@ -2774,9 +2780,9 @@ begin
NoCompares := Nf1cells;
AReport.Add('');
AReport.Add('---------------------------------------------------------------------');
AReport.Add('Welch t-tests among groups');
AReport.Add('---------------------------------------------------------------------');
AReport.Add(DIVIDER);
AReport.Add('WELCH T-TESTS AMONG GROUPS');
AReport.Add(DIVIDER_SMALL);
for i := 1 to NoCompares - 1 do
begin
@ -2799,41 +2805,30 @@ begin
denominator := term1 + term2;
numerator := sqr((var1 / cellcnts[i-1]) + (var2 / cellcnts[j-1]));
gnu := numerator / denominator;
AReport.Add('degrees of freedom: %8.3f', [gnu]);
AReport.Add('Ddegrees of freedom: %8.3f', [gnu]);
v := round(gnu);
AReport.Add('Rounded degrees of freedom = %d', [v]);
AReport.Add('Rounded degrees of freedom: %8d', [v]);
probability := probt(t,gnu);
AReport.Add('Probability > t = %8.3f', [probability]);
AReport.Add('Probability > t: %8.3f', [probability]);
AReport.Add('');
end;
AReport.Add('');
end;
{
if OutputFrm = nil then
OutputFrm := TOutputFrm.Create(Application)
else
OutputFrm.Clear;
OutputFrm.AddLines(AReport);
OutputFrm.ShowModal;
}
end;
procedure TBlksAnovaFrm.UpdateBtnStates;
begin
DepIn.Enabled := VarList.ItemIndex > -1;
DepIn.Enabled := (VarList.ItemIndex > -1) and (DepVar.Text = '');
DepOut.Enabled := DepVar.Text <> '';
Fact1In.Enabled := VarList.ItemIndex > -1;
Fact1In.Enabled := (VarList.ItemIndex > -1) and (Factor1.Text = '');
Fact1Out.Enabled := Factor1.Text <> '';
Fact2In.Enabled := VarList.ItemIndex > -1;
Fact2In.Enabled := (VarList.ItemIndex > -1) and (Factor2.Text = '');
Fact2Out.Enabled := Factor2.Text <> '';
Fact3In.Enabled := VarList.ItemIndex > -1;
Fact3In.Enabled := (VarList.ItemIndex > -1) and (Factor3.Text = '');
Fact3Out.Enabled := Factor3.Text <> '';
end;

View File

@ -22,7 +22,8 @@ procedure Tukey(
min_grp : integer; { minimum group code }
max_grp : integer; { maximum group code }
Alpha : Double; { alpha value }
AReport : TStrings);
AReport : TStrings
);
procedure ScheffeTest(
error_ms : double; { mean squared residual }
@ -32,7 +33,8 @@ procedure ScheffeTest(
max_grp : integer; { code of last group }
total_n : double; { total number of cases }
Alpha : double; { alpha value for testing }
AReport : TStrings);
AReport : TStrings
);
procedure Newman_Keuls(
error_ms : double; { residual mean squared }
@ -43,7 +45,8 @@ procedure Newman_Keuls(
min_grp : integer; { lowest group code }
max_grp : integer; { largest group code }
Alpha : double; { alpha value for testing }
AReport : TStrings);
AReport : TStrings
);
procedure Tukey_Kramer(
error_ms : double; { residual mean squared }
@ -54,7 +57,8 @@ procedure Tukey_Kramer(
min_grp : integer; { code of lowest group }
max_grp : integer; { code of highst group }
Alpha : double; { Alpha value for testing }
AReport : TStrings);
AReport : TStrings
);
procedure Contrasts(
error_ms : double; { residual ms }
@ -64,7 +68,9 @@ procedure Contrasts(
min_grp : integer; { lowest code }
max_grp : integer; { highest code }
overall_probf : double; { prob of overall test }
AReport : TStrings);
Alpha : Double;
AReport : TStrings
);
procedure Bonferroni(
group_total : DblDyneVec; { sum of scores in group }
@ -73,7 +79,8 @@ procedure Bonferroni(
min_grp : integer; { code of lowest group }
max_grp : integer; { code of highst group }
Alpha : Double; { Alpha value for testing }
AReport : TStrings);
AReport : TStrings
);
procedure TukeyBTest(
ErrorMS : double; { within groups error }
@ -84,19 +91,22 @@ procedure TukeyBTest(
max_grp : integer; { largest group code }
groupsize : double; { size of groups (all equal) }
Alpha : Double; { Alpha value for testing }
AReport : TStrings);
AReport : TStrings
);
procedure HomogeneityTest(
GroupCol : integer;
VarColumn : integer;
NoCases : integer);
NoCases : integer
);
implementation
uses
OutputUnit,
BlkAnovaUnit;
// OutputUnit,
//BlkAnovaUnit,
Utils;
procedure Tukey(error_ms : double; { mean squared for residual }
error_df : double; { deg. freedom for residual }
@ -108,7 +118,6 @@ procedure Tukey(error_ms : double; { mean squared for residual }
Alpha : double; { alpha value }
AReport : TStrings);
var
sig: boolean;
divisor: double;
df1: integer;
contrast, mean1, mean2: double;
@ -116,11 +125,14 @@ var
i,j: integer;
outline: string;
begin
AReport.Add('---------------------------------------------------------------');
AReport.Add(' Tukey HSD Test for Differences Between Means');
AReport.Add(' alpha selected = %.2f', [Alpha]);
AReport.Add('');
AReport.Add(DIVIDER);
AReport.Add('TUKEY HSD TEST FOR DIFFERENCES BETWEEN MEANS');
AReport.Add('Alpha selected: %.2f', [Alpha]);
AReport.Add('');
AReport.Add('Groups Difference Statistic Probability Significant?');
AReport.Add('---------------------------------------------------------------');
AReport.Add('------- ---------- ---------- ------------ ------------');
// xx - xx xxxxxxx q = xxxxxx xxxxxx YES
divisor := sqrt(error_ms / value );
for i := min_grp to max_grp - 1 do
@ -132,25 +144,20 @@ begin
contrast := mean1 - mean2;
outline := outline + format('%7.3f q = ',[contrast]);
contrast := abs(contrast / divisor) ;
outline := outline + format('%6.3f ',[contrast]);
outline := outline + format('%6.3f',[contrast]);
df1 := max_grp - min_grp + 1;
q_stat := STUDENT(contrast,error_df,df1);
outline := outline + format(' %6.4f',[q_stat]);
if alpha >= q_stat then
sig := TRUE
else
sig := FALSE;
if sig = TRUE then
outline := outline + ' YES '
outline := outline + ' YES'
else
outline := outline + ' NO';
AReport.Add(outline);
end;
AReport.Add('---------------------------------------------------------------');
AReport.Add(DIVIDER);
end;
procedure ScheffeTest(error_ms : double; { mean squared residual }
@ -168,14 +175,15 @@ var
i, j: integer;
begin
AReport.Add('');
AReport.Add('----------------------------------------------------------------');
AReport.Add(' Scheffe contrasts among pairs of means.');
AReport.Add(' alpha selected = %.2f', [alpha]);
AReport.Add(DIVIDER);
AReport.Add('SCHEFFE CONTRASTS AMONG PAIRS OF MEANS');
AReport.Add('Alpha selected: %.2f', [alpha]);
AReport.Add('');
AReport.Add('Group vs Group Difference Scheffe Critical Significant?');
AReport.Add(' Statistic Value');
AReport.Add('----------------------------------------------------------------');
AReport.Add('-------------- ----------- --------- -------- ------------');
alpha := 1.0 - alpha ;
alpha := 1.0 - alpha;
for i:= min_grp to max_grp - 1 do
for j := i + 1 to max_grp do
begin
@ -200,10 +208,9 @@ begin
AReport.Add(outline);
end;
AReport.Add('----------------------------------------------------------------');
AReport.Add(DIVIDER);
end;
{ ----------------------------------------------------------------------- }
procedure Newman_Keuls(error_ms : double; { residual mean squared }
error_df : double; { deg. freedom for error }
@ -224,11 +231,12 @@ var
divisor : double;
tempno : integer;
df1 : integer;
sig : boolean;
outline : string;
begin
SetLength(groupno,max_grp-min_grp+1);
for i := min_grp to max_grp do groupno[i-1] := i;
SetLength(groupno, max_grp-min_grp+1);
for i := min_grp to max_grp do
groupno[i-1] := i;
for i := min_grp to max_grp - 1 do
begin
for j := i + 1 to max_grp do
@ -249,17 +257,20 @@ begin
end;
AReport.Add('');
AReport.Add('----------------------------------------------------------------------');
AReport.Add(' Neuman-Keuls Test for Contrasts on Ordered Means');
AReport.Add(' alpha selected = %.2f', [alpha]);
AReport.Add(DIVIDER);
AReport.Add('NEUMAN_KEULS TEST FOR CONTRASTS ON ORDERED MEANS');
AReport.Add('Alpha selected: %.2f', [alpha]);
AReport.Add('');
AReport.Add('Group Mean');
AReport.Add('----- ---------');
// xxx xxxxxxx
for i := 1 to max_grp do
AReport.Add('%3d %10.3f', [groupno[i-1], group_total[i-1] / group_count[i-1]]);
AReport.Add('%3d %8.3f', [groupno[i-1], group_total[i-1] / group_count[i-1]]);
AReport.Add('');
AReport.Add('Groups Difference Statistic d.f. Probability Significant?');
AReport.Add('----------------------------------------------------------------------');
AReport.Add('------- ---------- ---------- ------ ----------- ------------');
// xx - xx xxxxxxx q = xxxxxx xx xxx xxxxxx YES
divisor := sqrt(error_ms / value);
for i := min_grp to max_grp - 1 do
begin
@ -275,15 +286,15 @@ begin
outline := outline + Format('%6.3f %2d %3.0f ', [contrast, df1, error_df]);
q_stat := STUDENT(contrast, error_df, df1);
outline := outline + Format(' %6.4f', [q_stat]);
if alpha > q_stat then sig := TRUE else sig := FALSE;
if sig = TRUE then
if alpha > q_stat then
outline := outline + ' YES'
else
outline := outline + ' NO';
AReport.Add(outline);
end;
end;
AReport.Add('----------------------------------------------------------------------');
AReport.Add(DIVIDER);
groupno := nil;
end;
@ -299,7 +310,6 @@ procedure Tukey_Kramer(error_ms : double; { residual mean squared }
Alpha : Double; { Alpha value for testing }
AReport : TStrings);
var
sig : boolean;
divisor : double;
df1 : integer;
contrast, mean1, mean2 : double;
@ -309,11 +319,13 @@ var
begin
AReport.Add('');
AReport.Add('---------------------------------------------------------------');
AReport.Add(' Tukey-Kramer Test for Differences Between Means');
AReport.Add(' alpha selected = %.2f', [Alpha]);
AReport.Add(DIVIDER);
AReport.Add('TUKEY-KRAMER TEST FOR DIFFERENCES BETWEEN MEANS');
AReport.Add('Alpha selected: %.2f', [Alpha]);
AReport.Add('');
AReport.Add('Groups Difference Statistic Probability Significant?');
AReport.Add('---------------------------------------------------------------');
AReport.Add('------ ---------- ------------- ----------- -------------');
// xx -xx xxxxxxx q = xxxxxx xxxxxx yes
for i := min_grp to max_grp - 1 do
for j := i + 1 to max_grp do
@ -329,17 +341,15 @@ begin
df1 := max_grp - min_grp + 1;
q_stat := STUDENT(contrast,error_df,df1);
outline := outline + format(' %6.4f',[q_stat]);
if alpha >= q_stat then sig := TRUE else sig := FALSE;
if sig = TRUE then
if alpha >= q_stat then
outline := outline + ' YES '
else
outline := outline + ' NO';
AReport.Add(outline);
end;
AReport.Add('---------------------------------------------------------------');
AReport.Add(DIVIDER);
end;
{ ------------------------------------------------------------------------ }
procedure Contrasts(error_ms : double; { residual ms }
error_df : double; { residual df }
@ -348,20 +358,21 @@ procedure Contrasts(error_ms : double; { residual ms }
min_grp : integer; { lowest code }
max_grp : integer; { highest code }
overall_probf : double; { prob of overall test }
Alpha : Double; { prob of posthoc test }
AReport : TStrings);
var
nocontrasts, i, j, k : integer;
df1, df2, probstat, statistic, alpha : double;
coefficients : array[1..20,1..20] of double;
nonorthog : boolean;
weight, sumcross : double;
response : string[5];
outline : string;
prompt : string;
nocontrasts, i, j, k: integer;
df1, df2, probstat, statistic: double;
coefficients: array[1..20,1..20] of double;
nonorthog: boolean;
weight, sumcross: double;
response: string[5];
outline: string;
prompt: string;
begin
outline := format('Enter the number of contrasts (less than %2d or 0:',[max_grp-min_grp+1]);
response := InputBox('ORTHOGONAL CONTRASTS',outline,'0');
outline := format('Enter the number of contrasts (less than %d or 0:', [max_grp-min_grp+1]);
response := InputBox('ORTHOGONAL CONTRASTS', outline, '0');
nocontrasts := StrToInt(response);
if nocontrasts > 0 then
@ -371,43 +382,41 @@ begin
outline := format('Contrast number %2d',[i]);
for j := 1 to (max_grp - min_grp+1) do
begin
prompt := format('Group %2d coefficient = ',[j]);
response := InputBox(outline,prompt,'1');
prompt := format('Group %2d coefficient: ',[j]);
response := InputBox(outline, prompt, '1');
coefficients[i,j] := StrToFloat(response);
end;
end;
{ Check for orthogonality }
nonorthog := FALSE;
nonorthog := false;
for i := 1 to nocontrasts - 1 do
begin
for j := i + 1 to nocontrasts do
begin
sumcross := 0;
for k := 1 to (max_grp - min_grp + 1) do
begin
sumcross := sumcross + coefficients[i,k]*coefficients[j,k];
end;
if sumcross <> 0 then nonorthog := TRUE;
if sumcross <> 0 then
begin
MessageDlg(Format('Contrasts %2d and %2d not orthogonal.',[i,j]), mtError, [mbOK], 0);;
nonorthog := true;
MessageDlg(Format('Contrasts %2d and %2d not orthogonal.', [i,j]), mtError, [mbOK], 0);;
end;
end;
end;
if not nonorthog then
begin
alpha := StrToFloat(BlksAnovaFrm.PostAlpha.Text);
if overall_probf > alpha then
if overall_probf > Alpha then
begin
AReport.Add('No contrasts significant.');
exit;
end;
AReport.Add('');
AReport.Add('---------------------------------------------------------------');
AReport.Add(' ORTHOGONAL CONTRASTS');
AReport.Add(DIVIDER);
AReport.Add('ORTHOGONAL CONTRASTS');
AReport.Add('');
AReport.Add('Contrast Statistic Probability Critical Value Significant?');
AReport.Add('---------------------------------------------------------------');
@ -425,7 +434,7 @@ begin
outline := Format('%3d %9.4f ', [i, statistic]);
df1 := 1;
df2 := error_df;
probstat := probf(statistic,round(df1),round(df2)) / 2;
probstat := probf(statistic, round(df1), round(df2)) / 2;
outline := outline + Format('%8.3f %5.2f ', [probstat, alpha]);
if probstat < alpha then
outline := outline + 'YES'
@ -443,7 +452,7 @@ begin
AReport.Add(outline);
end;
end; { if orthogonal }
AReport.Add('---------------------------------------------------------------');
AReport.Add(DIVIDER);
end; { if nocontrasts > 0 }
end; { of procedure CONTRASTS }
@ -463,20 +472,22 @@ var
testalpha : double;
NoGrps : integer;
tprob : double;
sig : string[6];
sig : string;
SS1, SS2 : double;
begin
AReport.Add('');
AReport.Add('---------------------------------------------------------------');
AReport.Add(' Bonferroni Test for Differences Between Means');
AReport.Add(' Overall alpha selected = %.2f', [alpha]);
AReport.Add('---------------------------------------------------------------');
AReport.Add(DIVIDER);
AReport.Add('BONFERRONI TEST FOR DIFFERENCES BETWEEN MEANS');
AReport.Add('Overall alpha selected: %.2f', [alpha]);
AReport.Add('');
NoGrps := max_grp - min_grp + 1;
testalpha := alpha / ( (NoGrps * (NoGrps-1)) / 2.0 );
AReport.Add('Comparisons made at alpha / no. comparisons = %5.3f', [testalpha]);
AReport.Add('Comparisons made at alpha / no. comparisons: %5.3f', [testalpha]);
AReport.Add('');
AReport.Add('Groups Difference Statistic Prob > Value Significant?');
AReport.Add('------- ------------ --------- ------------ ------------');
// xx - xx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx YES
for i := 1 to NoGrps - 1 do
begin
for j := i+1 to NoGrps do
@ -491,11 +502,13 @@ begin
df2 := round(group_count[i-1] + group_count[j-1] - 2.0);
tprob := probt(contrast,df2);
if testalpha >= tprob then sig := 'YES' else sig := 'NO';
AReport.Add('%3d - %3d %10.3f %10.3f %10.3f %s', [
AReport.Add('%2d - %2d %10.3f %10.3f %10.3f %s', [
min_grp+i-1, min_grp+j-1, mean1-mean2, contrast, tprob, sig
]);
end;
end;
AReport.Add(DIVIDER);
end;
//-------------------------------------------------------------------
@ -520,7 +533,7 @@ var
NoGrps: integer;
contrast: double;
mean1, mean2: double;
sig: string[6];
sig: string;
groups: double;
divisor: double;
@ -528,12 +541,13 @@ begin
SetLength(groupno,max_grp-min_grp+1);
AReport.Add('');
AReport.Add('---------------------------------------------------------------');
AReport.Add(' Tukey B Test for Contrasts on Ordered Means');
AReport.Add(' alpha selected = %.2f',[alpha]);
AReport.Add('---------------------------------------------------------------');
AReport.Add(DIVIDER);
AReport.Add('TUKEY B TEST FOR CONTRASTS ON ORDERED MEANS');
AReport.Add('Alpha selected: %.2f',[alpha]);
AReport.Add('');
AReport.Add('Groups Difference Statistic d.f. Prob.>value Significant?');
AReport.Add('------- ----------- --------- -------- ----------- ------------');
// xx - xx xxxxxxxxxx xxxxxxxxxx xxx,xxx xxxxxxxx YES
divisor := sqrt(ErrorMS / groupsize);
NoGrps := max_grp - min_grp + 1;
@ -570,36 +584,34 @@ begin
tstat := STUDENT(contrast,ErrorDF,groups);
qstat := (qstat + tstat) / 2.0;
if alpha >= qstat then sig := 'YES' else sig := 'NO';
AReport.Add('%3d - %3d %10.3f %10.3f %4.0f,%4.0f %5.3f %s', [
AReport.Add('%2d - %2d %10.3f %10.3f %3.0f,%3.0f %8.3f %s', [
groupno[i-1], groupno[j-1], mean1-mean2, contrast, df1, ErrorDF, qstat, sig
]);
end;
end;
AReport.Add(DIVIDER);
groupno := nil;
end;
procedure HomogeneityTest(GroupCol : integer;
VarColumn : integer;
NoCases : integer);
Var
i, j, k, N, intvalue, Nf1cells: integer;
min, max : integer;
zscores : DblDyneMat;
medians : DblDyneVec;
cellcnts : IntDyneVec;
cellvars : DblDyneVec;
cellsums : DblDyneVec;
X, X2, temp : double;
procedure HomogeneityTest(GroupCol: integer; VarColumn: integer; NoCases: integer);
var
i, j, k, intvalue, Nf1cells: integer;
min, max: integer;
zscores: DblDyneMat;
medians: DblDyneVec;
cellcnts: IntDyneVec;
X: Double;
begin
if GroupCol >= OS3MainFrm.DataGrid.ColCount then
begin
MessageDlg('Invalid index of group column', mtError, [mbOK], 0);
ErrorMsg('Invalid index of group column');
exit;
end;
if VarColumn >= OS3MainFrm.DataGrid.ColCount then
begin
Messagedlg('Invalid index of variable column', mtError, [mbOK], 0);
ErrorMsg('Invalid index of variable column');
exit;
end;
@ -607,9 +619,8 @@ begin
// between between the observed score and the median of a group.
// get min and max group codes
min := 100000;
max := 0;
N := 0;
min := MaxInt;
max := -MaxInt;
for i := 1 to NoCases do
begin
@ -619,18 +630,16 @@ begin
end;
Nf1cells := max - min + 1;
setlength(zscores,Nf1cells,NoCases);
setlength(medians,Nf1cells);
setlength(cellcnts,Nf1cells);
setlength(cellvars,Nf1cells);
setlength(cellsums,Nf1cells);
SetLength(zscores, Nf1cells, NoCases);
SetLength(medians, Nf1cells);
SetLength(cellcnts, Nf1cells);
// Get cell counts
for i := 1 to NoCases do
for i := 0 to NoCases-1 do
begin
intvalue := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[GroupCol,i])));
intvalue := intvalue - min + 1;
cellcnts[intvalue-1] := cellcnts[intvalue-1] + 1;
intvalue := intvalue - min;
cellcnts[intvalue] := cellcnts[intvalue] + 1;
end;
// get working totals
@ -644,56 +653,38 @@ begin
intvalue := intvalue - min;
if intvalue <> j then continue;
X := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[VarColumn,i]));
zscores[intvalue,k] := X;
zscores[intvalue, k] := X;
k := k + 1;
end;
end;
//sort on z scores and obtain the median for each group
for i := 0 to Nf1cells-1 do // sort scores in each group
begin
for j := 0 to cellcnts[i]-2 do
begin
for k := j+1 to cellcnts[i]-1 do
begin
X := zscores[i,j];
X2 := zscores[i,k];
if X2 < X then // swap
begin
temp := X;
X := X2;
X2 := temp;
end;
end;
end;
end;
if zscores[i, j] < zscores[i, k] then // swap
Exchange(zscores[i, j], zscores[i, k]);
for i := 0 to Nf1cells-1 do
begin
medians[i] := zscores[i,cellcnts[i] div 2];
end;
medians[i] := zscores[i, cellcnts[i] div 2];
// Get deviations from the medians
for i := 0 to Nf1cells-1 do
begin
for j := 0 to cellcnts[i]-1 do
zscores[i,j] := zscores[i,j] - medians[i];
end;
// place group membership and z deviation scores in columns and
// do a regular one-way ANOVA
k := 0;
for i := 0 to Nf1cells-1 do
begin
for j := 0 to cellcnts[i]-1 do
begin
k := k +1;
OS3MainFrm.DataGrid.Cells[GroupCol,k] := IntToStr(i+1);
OS3MainFrm.DataGrid.Cells[VarColumn,k] := FloatToStr(abs(zscores[i,j]));
end;
end;
MessageDlg('Data have been placed in the grid. Do a one-way ANOVA', mtInformation, [mbOK], 0);
MessageDlg('Data have been placed in the grid. Do a one-way ANOVA.', mtInformation, [mbOK], 0);
end;
end.