LazStats: some refactoring of BlkANOVAUnit

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7487 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-06-23 17:16:32 +00:00
parent 6dff879d57
commit f8a14ebfe1

View File

@@ -712,28 +712,24 @@ procedure TBlksAnovaFrm.OneWayPlot;
var var
i : integer; i : integer;
maxmean : double; maxmean : double;
XValue : DblDyneVec;
setstring : string[11];
plottype : integer; plottype : integer;
begin begin
plottype := 2; plotType := 2;
SetLength(XValue,Nf1cells);
if PlotMeans.Checked then plottype := 2; if PlotMeans.Checked then plottype := 2;
if Plot2DLines.Checked then plottype := 5; if Plot2DLines.Checked then plottype := 5;
if Plot3DLines.Checked then plottype := 6; if Plot3DLines.Checked then plottype := 6;
maxmean := 0.0;
setstring := 'FACTOR A'; GraphFrm.SetLabels[1] := 'FACTOR A';
GraphFrm.SetLabels[1] := setstring;
SetLength(GraphFrm.YPoints,1,NF1cells); SetLength(GraphFrm.YPoints,1,NF1cells);
SetLength(GraphFrm.Xpoints,1,NF1cells); SetLength(GraphFrm.Xpoints,1,NF1cells);
maxmean := 0.0;
for i := 1 to NF1cells do for i := 1 to NF1cells do
begin begin
cellsums[i-1] := cellsums[i-1] / cellcnts[i-1]; cellsums[i-1] := cellsums[i-1] / cellcnts[i-1];
GraphFrm.Ypoints[0,i-1] := cellsums[i-1]; GraphFrm.Ypoints[0,i-1] := cellsums[i-1];
if cellsums[i-1] > maxmean then maxmean := cellsums[i-1]; if cellsums[i-1] > maxmean then maxmean := cellsums[i-1];
XValue[i-1] := minF1 + i - 1; GraphFrm.Xpoints[0,i-1] := minF1 + i - 1;
GraphFrm.Xpoints[0,i-1] := XValue[i-1];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF1cells; GraphFrm.nbars := NF1cells;
@@ -745,12 +741,12 @@ begin
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; // 3d Vertical Bar Chart GraphFrm.GraphType := plottype; // 3d Vertical Bar Chart
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; GraphFrm.ShowModal;
XValue := nil;
GraphFrm.Xpoints := nil; GraphFrm.Xpoints := nil;
GraphFrm.Ypoints := nil; GraphFrm.Ypoints := nil;
end; end;
@@ -1049,90 +1045,85 @@ procedure TBlksAnovaFrm.TwoWayPlot;
var var
i, j : integer; i, j : integer;
maxmean, XBar : double; maxmean, XBar : double;
XValue : DblDyneVec;
title : string;
plottype : integer; plottype : integer;
setstring : string[11];
begin begin
if CompError then if CompError then
exit; exit;
SetLength(XValue,Nf1cells+Nf2cells);
plottype := 2; plottype := 2;
if PlotMeans.Checked then plottype := 2; if PlotMeans.Checked then plottype := 2;
if Plot2DLines.Checked then plottype := 5; if Plot2DLines.Checked then plottype := 5;
if Plot3DLines.Checked then plottype := 6; if Plot3DLines.Checked then plottype := 6;
// do Factor A first // do Factor A first
setstring := 'FACTOR A'; GraphFrm.SetLabels[1] := 'FACTOR A';
GraphFrm.SetLabels[1] := setstring;
maxmean := 0.0;
SetLength(GraphFrm.Xpoints, 1, NF1cells); SetLength(GraphFrm.Xpoints, 1, NF1cells);
SetLength(GraphFrm.Ypoints, 1, NF1cells); SetLength(GraphFrm.Ypoints, 1, NF1cells);
maxmean := 0.0;
for i := 1 to NF1cells do for i := 1 to NF1cells do
begin begin
RowSums[i-1] := RowSums[i-1] / RowCount[i-1]; RowSums[i-1] := RowSums[i-1] / RowCount[i-1];
GraphFrm.Ypoints[0,i-1] := RowSums[i-1]; GraphFrm.Ypoints[0,i-1] := RowSums[i-1];
if RowSums[i-1] > maxmean then maxmean := RowSums[i-1]; if RowSums[i-1] > maxmean then maxmean := RowSums[i-1];
XValue[i-1] := minF1 + i - 1; GraphFrm.Xpoints[0,i-1] := minF1 + i - 1;
GraphFrm.Xpoints[0,i-1] := XValue[i-1];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF1cells; GraphFrm.nbars := NF1cells;
GraphFrm.Heading := Factor1.Text; GraphFrm.Heading := Factor1.Text;
title := Factor1.Text + ' Codes'; GraphFrm.XTitle := Factor1.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mroK then
exit;
// do Factor B next // do Factor B next
setstring := 'FACTOR B'; GraphFrm.SetLabels[1] := 'FACTOR B';
GraphFrm.SetLabels[1] := setstring;
maxmean := 0.0;
SetLength(GraphFrm.Xpoints, 1, NF2cells); SetLength(GraphFrm.Xpoints, 1, NF2cells);
SetLength(GraphFrm.Ypoints, 1, NF2cells); SetLength(GraphFrm.Ypoints, 1, NF2cells);
maxmean := 0.0;
for i := 1 to NF2cells do for i := 1 to NF2cells do
begin begin
ColSums[i-1] := ColSums[i-1] / ColCount[i-1]; ColSums[i-1] := ColSums[i-1] / ColCount[i-1];
GraphFrm.Ypoints[0,i-1] := ColSums[i-1]; GraphFrm.Ypoints[0,i-1] := ColSums[i-1];
if ColSums[i-1] > maxmean then maxmean := ColSums[i-1]; if ColSums[i-1] > maxmean then maxmean := ColSums[i-1];
XValue[i-1] := minF1 + i - 1; GraphFrm.Xpoints[0,i-1] := minF1 + i - 1;
GraphFrm.Xpoints[0,i-1] := XValue[i-1];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF2cells; GraphFrm.nbars := NF2cells;
GraphFrm.Heading := Factor2.Text; GraphFrm.Heading := Factor2.Text;
title := Factor2.Text + ' Codes'; GraphFrm.XTitle := Factor2.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
// do Factor A x B Interaction next // do Factor A x B Interaction next
maxmean := 0.0;
SetLength(GraphFrm.Ypoints, NF1cells, NF2cells); SetLength(GraphFrm.Ypoints, NF1cells, NF2cells);
SetLength(GraphFrm.Xpoints, 1, NF2cells); SetLength(GraphFrm.Xpoints, 1, NF2cells);
maxmean := 0.0;
for i := 1 to NF1cells do for i := 1 to NF1cells do
begin begin
setstring := Factor1.Text + ' ' + IntToStr(i); GraphFrm.SetLabels[i] := Factor1.Text + ' ' + IntToStr(i);
GraphFrm.SetLabels[i] := setstring;
for j := 1 to NF2cells do for j := 1 to NF2cells do
begin begin
XBar := sums[i-1,j-1] / counts[i-1,j-1]; XBar := sums[i-1,j-1] / counts[i-1,j-1];
@@ -1140,29 +1131,26 @@ begin
GraphFrm.Ypoints[i-1,j-1] := XBar; GraphFrm.Ypoints[i-1,j-1] := XBar;
end; end;
end; end;
for j := 1 to NF2cells do for j := 1 to NF2cells do
begin GraphFrm.Xpoints[0,j-1] := minF2 + j - 1;
XValue[j-1] := minF2 + j - 1;
GraphFrm.Xpoints[0,j-1] := XValue[j-1];
end;
GraphFrm.nosets := NF1cells; GraphFrm.nosets := NF1cells;
GraphFrm.nbars := NF2cells; GraphFrm.nbars := NF2cells;
GraphFrm.Heading := 'Factor A x Factor B'; GraphFrm.Heading := 'Factor A x Factor B';
title := Factor2.Text + ' Codes'; GraphFrm.XTitle := Factor2.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; GraphFrm.ShowModal;
XValue := nil;
GraphFrm.Xpoints := nil; GraphFrm.Xpoints := nil;
GraphFrm.Ypoints := nil; GraphFrm.Ypoints := nil;
end; end;
@@ -1808,53 +1796,47 @@ procedure TBlksAnovaFrm.ThreeWayPlot;
var var
i, j, k : integer; i, j, k : integer;
maxmean, XBar : double; maxmean, XBar : double;
XValue : DblDyneVec;
title : string;
plottype : integer; plottype : integer;
setstring : string[11];
begin begin
if CompError then exit; if CompError then exit;
SetLength(XValue,totcells);
plottype := 2; plottype := 2;
if PlotMeans.Checked then plottype := 2; if PlotMeans.Checked then plottype := 2;
if Plot2DLines.Checked then plottype := 5; if Plot2DLines.Checked then plottype := 5;
if Plot3DLines.Checked then plottype := 6; if Plot3DLines.Checked then plottype := 6;
// do Factor A first // do Factor A first
setstring := 'FACTOR A'; GraphFrm.SetLabels[1] := 'FACTOR A';
GraphFrm.SetLabels[1] := setstring;
maxmean := 0.0;
SetLength(GraphFrm.Xpoints,1,NF1cells); SetLength(GraphFrm.Xpoints,1,NF1cells);
SetLength(GraphFrm.Ypoints,1,NF1cells); SetLength(GraphFrm.Ypoints,1,NF1cells);
maxmean := 0.0;
for i := 0 to NF1cells-1 do for i := 0 to NF1cells-1 do
begin begin
RowSums[i] := RowSums[i] / RowCount[i]; RowSums[i] := RowSums[i] / RowCount[i];
GraphFrm.Ypoints[0,i] := RowSums[i]; GraphFrm.Ypoints[0,i] := RowSums[i];
if RowSums[i] > maxmean then maxmean := RowSums[i]; if RowSums[i] > maxmean then maxmean := RowSums[i];
XValue[i] := minF1 + i; GraphFrm.Xpoints[0,i] := minF1 + i;
GraphFrm.Xpoints[0,i] := XValue[i];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF1cells; GraphFrm.nbars := NF1cells;
GraphFrm.Heading := Factor1.Text; GraphFrm.Heading := Factor1.Text;
title := Factor1.Text + ' Codes'; GraphFrm.XTitle := Factor1.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
// do Factor B next // do Factor B next
setstring := 'FACTOR B'; GraphFrm.SetLabels[1] := 'FACTOR B';
GraphFrm.SetLabels[1] := setstring;
maxmean := 0.0; maxmean := 0.0;
SetLength(GraphFrm.Xpoints, 1, NF2cells); SetLength(GraphFrm.Xpoints, 1, NF2cells);
SetLength(GraphFrm.Ypoints, 1, NF2cells); SetLength(GraphFrm.Ypoints, 1, NF2cells);
@@ -1863,29 +1845,27 @@ begin
ColSums[i] := ColSums[i] / ColCount[i]; ColSums[i] := ColSums[i] / ColCount[i];
GraphFrm.Ypoints[0,i] := ColSums[i]; GraphFrm.Ypoints[0,i] := ColSums[i];
if ColSums[i] > maxmean then maxmean := ColSums[i]; if ColSums[i] > maxmean then maxmean := ColSums[i];
XValue[i] := minF2 + i; GraphFrm.Xpoints[0,i] := minF2 + i;
GraphFrm.Xpoints[0,i] := XValue[i];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF2cells; GraphFrm.nbars := NF2cells;
GraphFrm.Heading := Factor2.Text; GraphFrm.Heading := Factor2.Text;
title := Factor2.Text + ' Codes'; GraphFrm.XTitle := Factor2.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
// do Factor C next // do Factor C next
setstring := 'FACTOR C'; GraphFrm.SetLabels[1] := 'FACTOR C';
GraphFrm.SetLabels[1] := setstring;
maxmean := 0.0; maxmean := 0.0;
SetLength(GraphFrm.Xpoints, 1, NF3cells); SetLength(GraphFrm.Xpoints, 1, NF3cells);
SetLength(GraphFrm.Ypoints, 1, NF3cells); SetLength(GraphFrm.Ypoints, 1, NF3cells);
@@ -1894,25 +1874,24 @@ begin
SlcSums[i] := SlcSums[i] / SlcCount[i]; SlcSums[i] := SlcSums[i] / SlcCount[i];
GraphFrm.Ypoints[0,i] := SlcSums[i]; GraphFrm.Ypoints[0,i] := SlcSums[i];
if SlcSums[i] > maxmean then maxmean := SlcSums[i]; if SlcSums[i] > maxmean then maxmean := SlcSums[i];
XValue[i] := minF3 + i; GraphFrm.Xpoints[0,i] := minF3 + i;
GraphFrm.Xpoints[0,i] := XValue[i];
end; end;
GraphFrm.nosets := 1; GraphFrm.nosets := 1;
GraphFrm.nbars := NF3cells; GraphFrm.nbars := NF3cells;
GraphFrm.Heading := Factor3.Text; GraphFrm.Heading := Factor3.Text;
title := Factor2.Text + ' Codes'; GraphFrm.XTitle := Factor2.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
// do Factor A x B Interaction within each slice next // do Factor A x B Interaction within each slice next
SetLength(GraphFrm.Ypoints, NF1cells, NF2cells); SetLength(GraphFrm.Ypoints, NF1cells, NF2cells);
@@ -1922,8 +1901,7 @@ begin
maxmean := 0.0; maxmean := 0.0;
for i := 0 to NF1cells-1 do for i := 0 to NF1cells-1 do
begin begin
setstring := Factor1.Text + ' ' + IntToStr(i+1); GraphFrm.SetLabels[i+1] := Factor1.Text + ' ' + IntToStr(i+1);
GraphFrm.SetLabels[i+1] := setstring;
for j := 0 to NF2cells-1 do for j := 0 to NF2cells-1 do
begin begin
XBar := wsum[i,j,k] / ncnt[i,j,k]; XBar := wsum[i,j,k] / ncnt[i,j,k];
@@ -1932,27 +1910,24 @@ begin
end; end;
end; end;
for j := 0 to NF2cells-1 do for j := 0 to NF2cells-1 do
begin GraphFrm.Xpoints[0,j] := minF2 + j ;
XValue[j] := minF2 + j ;
GraphFrm.Xpoints[0,j] := XValue[j];
end;
GraphFrm.nosets := NF1cells; GraphFrm.nosets := NF1cells;
GraphFrm.nbars := NF2cells; GraphFrm.nbars := NF2cells;
GraphFrm.Heading := 'Factor A x Factor B Within Slice' + IntToStr(k); GraphFrm.Heading := 'Factor A x Factor B Within Slice' + IntToStr(k);
title := Factor2.Text + ' Codes'; GraphFrm.XTitle := Factor2.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
end; end;
// do Factor A x C Interaction within each Column next // do Factor A x C Interaction within each Column next
@@ -1963,8 +1938,7 @@ begin
maxmean := 0.0; maxmean := 0.0;
for i := 0 to NF1cells-1 do for i := 0 to NF1cells-1 do
begin begin
setstring := Factor1.Text + ' ' + IntToStr(i+1); GraphFrm.SetLabels[i+1] := Factor1.Text + ' ' + IntToStr(i+1);
GraphFrm.SetLabels[i+1] := setstring;
for k := 0 to NF3cells-1 do for k := 0 to NF3cells-1 do
begin begin
XBar := wsum[i,j,k] / ncnt[i,j,k]; XBar := wsum[i,j,k] / ncnt[i,j,k];
@@ -1973,27 +1947,24 @@ begin
end; end;
end; end;
for k := 0 to NF3cells-1 do for k := 0 to NF3cells-1 do
begin GraphFrm.Xpoints[0,k] := minF3 + k;
XValue[k] := minF3 + k;
GraphFrm.Xpoints[0,k] := XValue[k];
end;
GraphFrm.nosets := NF1cells; GraphFrm.nosets := NF1cells;
GraphFrm.nbars := NF3cells; GraphFrm.nbars := NF3cells;
GraphFrm.Heading := 'Factor A x Factor C Within Column ' + IntToStr(j+1); GraphFrm.Heading := 'Factor A x Factor C Within Column ' + IntToStr(j+1);
title := Factor3.Text + ' Codes'; GraphFrm.XTitle := Factor3.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
end; end;
// do Factor B x C Interaction within each row next // do Factor B x C Interaction within each row next
@@ -2004,8 +1975,7 @@ begin
maxmean := 0.0; maxmean := 0.0;
for j := 0 to NF2cells-1 do for j := 0 to NF2cells-1 do
begin begin
setstring := Factor2.Text + ' ' + IntToStr(j+1); GraphFrm.SetLabels[j+1] := Factor2.Text + ' ' + IntToStr(j+1);
GraphFrm.SetLabels[j+1] := setstring;
for k := 0 to NF3cells-1 do for k := 0 to NF3cells-1 do
begin begin
XBar := wsum[i,j,k] / ncnt[i,j,k]; XBar := wsum[i,j,k] / ncnt[i,j,k];
@@ -2014,31 +1984,28 @@ begin
end; end;
end; end;
for j := 0 to NF2cells-1 do for j := 0 to NF2cells-1 do
begin GraphFrm.Xpoints[0,j] := minF2 + j;
XValue[j] := minF2 + j;
GraphFrm.Xpoints[0,j] := XValue[j];
end;
GraphFrm.nosets := NF2cells; GraphFrm.nosets := NF2cells;
GraphFrm.nbars := NF3cells; GraphFrm.nbars := NF3cells;
GraphFrm.Heading := 'Factor B x Factor C Within Row ' + IntToStr(i+1); GraphFrm.Heading := 'Factor B x Factor C Within Row ' + IntToStr(i+1);
title := Factor3.Text + ' Codes'; GraphFrm.XTitle := Factor3.Text + ' Codes';
GraphFrm.XTitle := title;
GraphFrm.YTitle := 'Mean'; GraphFrm.YTitle := 'Mean';
GraphFrm.barwideprop := 0.5; GraphFrm.barwideprop := 0.5;
GraphFrm.AutoScaled := false; GraphFrm.AutoScaled := false;
GraphFrm.miny := 0.0; GraphFrm.miny := 0.0;
GraphFrm.maxy := maxmean; GraphFrm.maxy := maxmean;
GraphFrm.GraphType := plottype; GraphFrm.GraphType := plottype;
GraphFrm.BackColor := clYellow; GraphFrm.BackColor := GRAPH_BACK_COLOR;
GraphFrm.WallColor := clBlack; GraphFrm.WallColor := GRAPH_WALL_COLOR;
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; if GraphFrm.ShowModal <> mrOK then
exit;
end; // next row end; // next row
GraphFrm.Xpoints := nil; GraphFrm.Xpoints := nil;
GraphFrm.Ypoints := nil; GraphFrm.Ypoints := nil;
XValue := nil;
end; end;
//------------------------------------------------------------------- //-------------------------------------------------------------------
procedure TBlksAnovaFrm.TwoWayContrasts(AReport: TStrings); procedure TBlksAnovaFrm.TwoWayContrasts(AReport: TStrings);