LazStats: Inherit AncovaUnit from BasicStatsReportAndChartFormUnit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7892 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-11-17 22:58:51 +00:00
parent a5e228e9ea
commit 972eb626d4
6 changed files with 837 additions and 944 deletions

View File

@ -731,7 +731,7 @@ begin
AReport.Add('Variance Y: %20.3f', [VarY]);
AReport.Add('Std. Deviation Y: %20.3f', [SDY]);
AReport.Add('');
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
// augment the matrix
for i := 0 to NCases-1 do
@ -745,7 +745,7 @@ begin
AReport.Add('');
title := 'XT MATRIX';
MatPrint(XT, NoIndep+1, NCases, title, RowLabels, ColLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
end;
@ -758,11 +758,11 @@ begin
begin
title := 'XTX MATRIX';
MatPrint(XTX, Noindep+1, NoIndep+1, title, RowLabels, RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
end;
//Get means, variances and standard deviations
// Get means, variances and standard deviations
errorcode := false;
for i := 0 to NoIndep do
begin
@ -778,13 +778,13 @@ begin
if PrintAll then
begin
DynVectorPrint(Means, NoIndep+1, 'MEANS', RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
DynVectorPrint(Variances, NoIndep+1,'VARIANCES',RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
DynVectorPrint(StdDevs, NoIndep+1, 'STD. DEVs', RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
end;
@ -795,7 +795,7 @@ begin
if PrintAll then
begin
DynVectorPrint(XTY, NoIndep+1, 'XTY VECTOR', RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
end;
// get inverse of the augmented cross products matrix among independent variables
@ -805,7 +805,7 @@ begin
AReport.Add('');
title := 'XTX MATRIX INVERSE';
MatPrint(XTX, NoIndep+1, NoIndep+1, title, RowLabels, RowLabels, NCases, AReport);
AReport.Add(DIVIDER);
AReport.Add(DIVIDER_AUTO);
end;
// multiply augmented inverse matrix times the XTY vector
@ -843,19 +843,19 @@ begin
AReport.Add('Dependent variable: ' + deplabel);
AReport.Add('');
DynVectorPrint(BWeights, NoIndep+1, 'B WEIGHTS', RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
AReport.Add('Dependent variable: ' + deplabel);
AReport.Add('');
DynVectorPrint(BetaWeights, NoIndep, 'BETA WEIGHTS', RowLabels, NCases, AReport);
AReport.Add(DIVIDER_SMALL);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
DynVectorPrint(BStdErrs, NoIndep+1, 'B STD.ERRORS', RowLabels, NCases, AReport);
AReport.Add('');
DynVectorPrint(Bttests, NoIndep+1, 'B t-test VALUES', RowLabels, NCases, AReport);
AReport.Add('');
DynVectorPrint(tprobs, NoIndep+1, 'B t VALUE PROBABILITIES', RowLabels, NCases, AReport);
AReport.Add(DIVIDER);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
AReport.Add('SSY: %10.2f', [SSY]);
AReport.Add('SSreg: %10.2f', [SSreg]);
@ -870,14 +870,15 @@ begin
//AReport.Add('SSY = %10.2f, SSreg = %10.2f, SSres = %10.2f', [SSY, SSreg, SSres]);
//AReport.Add('R2 = %6.4f, F = %8.2f, D.F. = %d %d, Prob>F = %6.4f', [R2, F, N-1, NCases-N, Prob]);
//AReport.Add('Standard Error of Estimate = %8.2f', [stderrest]);
AReport.Add(DIVIDER_SMALL_AUTO);
AReport.Add('');
end;
// Needed for calculation of VIF and TOL
Correlations(NoIndep, IndepCols, XTX, Means, Variances, StdDevs, ErrorCode, NCases);
SVDinverse(XTX, NoIndep);
AReport.Add(DIVIDER_SMALL);
AReport.Add('');
RowLabels[N-1] := 'Intercept';
AReport.Add(' Variable Beta B Std.Err. t prob VIF TOL');
AReport.Add('---------- ---------- ---------- ---------- ---------- ---------- --------- ----------');