LazStats: more refactoring of BlkAnovaUnit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7490 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-06-23 18:28:18 +00:00
parent 66a428dbb0
commit 82c367cb71

View File

@ -328,11 +328,11 @@ begin
SetLength(cellsums, totcells); // array of cell sums then means SetLength(cellsums, totcells); // array of cell sums then means
// initialize array values // initialize array values
for i := 1 to totcells do for i := 0 to totcells-1 do
begin begin
cellsums[i-1] := 0.0; cellsums[i] := 0.0;
cellvars[i-1] := 0.0; cellvars[i] := 0.0;
cellcnts[i-1] := 0; cellcnts[i] := 0;
end; end;
// do analysis // do analysis
@ -361,6 +361,10 @@ begin
BrownForsytheOneWay(lReport); BrownForsytheOneWay(lReport);
if Welch.Checked then if Welch.Checked then
WelchOneWay(lReport); WelchOneWay(lReport);
if not DisplayReport(lReport) then
exit;
if PlotMeans.Checked or Plot2DLines.Checked or Plot3DLines.Checked then if PlotMeans.Checked or Plot2DLines.Checked or Plot3DLines.Checked then
OneWayPlot; OneWayPlot;
end; end;
@ -382,6 +386,10 @@ begin
begin begin
TwoWayTable(lReport); TwoWayTable(lReport);
TwoWayContrasts(lReport); TwoWayContrasts(lReport);
if not DisplayReport(lReport) then
exit;
if PlotMeans.Checked or Plot2DLines.Checked or Plot3DLines.Checked then if PlotMeans.Checked or Plot2DLines.Checked or Plot3DLines.Checked then
TwoWayPlot; TwoWayPlot;
end; end;
@ -418,6 +426,10 @@ begin
begin begin
ThreeWayTable(lReport); ThreeWayTable(lReport);
ThreeWayContrasts(lReport); ThreeWayContrasts(lReport);
if not DisplayReport(lReport) then
exit;
if (PlotMeans.Checked) or (Plot2DLines.Checked) or (Plot3DLines.Checked) then if (PlotMeans.Checked) or (Plot2DLines.Checked) or (Plot3DLines.Checked) then
ThreeWayPlot; ThreeWayPlot;
end; end;
@ -437,8 +449,6 @@ begin
end; end;
end; end;
DisplayReport(lReport);
finally finally
lReport.Free; lReport.Free;
cellcnts := nil; cellcnts := nil;
@ -727,12 +737,12 @@ begin
SetLength(GraphFrm.Xpoints,1,NF1cells); SetLength(GraphFrm.Xpoints,1,NF1cells);
maxmean := 0.0; maxmean := 0.0;
for i := 1 to NF1cells do for i := 0 to NF1cells-1 do
begin begin
cellsums[i-1] := cellsums[i-1] / cellcnts[i-1]; cellsums[i] := cellsums[i] / cellcnts[i];
GraphFrm.Ypoints[0,i-1] := cellsums[i-1]; GraphFrm.Ypoints[0, i] := cellsums[i];
if cellsums[i-1] > maxmean then maxmean := cellsums[i-1]; if cellsums[i] > maxmean then maxmean := cellsums[i];
GraphFrm.Xpoints[0,i-1] := minF1 + i - 1; GraphFrm.Xpoints[0,i] := minF1 + i;
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF1cells; GraphFrm.nbars := NF1cells;