You've already forked lazarus-ccr
Lazstats: Cleanup
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7396 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -116,7 +116,7 @@ var
|
|||||||
SSrows, SScols, SSwrows, SSerr, SStot: double;
|
SSrows, SScols, SSwrows, SSerr, SStot: double;
|
||||||
MSrows, MScols, MSwrows, MSerr, MStot: double;
|
MSrows, MScols, MSwrows, MSerr, MStot: double;
|
||||||
dfrows, dfcols, dfwrows, dferr, dftot: double;
|
dfrows, dfcols, dfwrows, dferr, dftot: double;
|
||||||
f1, f2, probf1, GrandMean, Term1, Term2, Term3, Term4: double;
|
f1, probf1, GrandMean, Term1, Term2, Term3, Term4: double;
|
||||||
r1, r2, r3, r4, X, avgvar, avgcov: double;
|
r1, r2, r3, r4, X, avgvar, avgcov: double;
|
||||||
determ1, determ2, M2, C2, chi2, prob: double;
|
determ1, determ2, M2, C2, chi2, prob: double;
|
||||||
errorfound: boolean;
|
errorfound: boolean;
|
||||||
@ -351,7 +351,6 @@ begin
|
|||||||
M2 := 0.0;
|
M2 := 0.0;
|
||||||
C2 := 0.0;
|
C2 := 0.0;
|
||||||
chi2 := 0.0;
|
chi2 := 0.0;
|
||||||
f2 := 0;
|
|
||||||
prob := 0.0;
|
prob := 0.0;
|
||||||
Determ(vcmat,NoSelected,NoSelected,determ1,errorfound);
|
Determ(vcmat,NoSelected,NoSelected,determ1,errorfound);
|
||||||
if determ1 < 0.0 then determ1 := 0.0;
|
if determ1 < 0.0 then determ1 := 0.0;
|
||||||
|
@ -669,8 +669,10 @@ begin
|
|||||||
for i := 1 to NoPts do
|
for i := 1 to NoPts do
|
||||||
begin
|
begin
|
||||||
X := pts[i-1];
|
X := pts[i-1];
|
||||||
if (MeanChk.Checked = true) then covzero := covzero + (X * X)
|
if (MeanChk.Checked = true) then
|
||||||
else covzero := covzero + ((X - mean) * (X - mean));
|
covzero := covzero + sqr(X)
|
||||||
|
else
|
||||||
|
covzero := covzero + sqr(X - mean);
|
||||||
end;
|
end;
|
||||||
covzero := covzero / count;
|
covzero := covzero / count;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ const
|
|||||||
SEPARATOR = '===========================================================================';
|
SEPARATOR = '===========================================================================';
|
||||||
var
|
var
|
||||||
i, j, k, count, a_size, b_size, no_factors, novars, IER: integer;
|
i, j, k, count, a_size, b_size, no_factors, novars, IER: integer;
|
||||||
outline, cellstring, gridstring: string;
|
cellstring, gridstring: string;
|
||||||
s, m, n, df1, df2, q, w, pcnt_extracted, trace : double;
|
s, m, n, df1, df2, q, w, pcnt_extracted, trace : double;
|
||||||
minroot, critical_prob, Lambda, Pillia : double;
|
minroot, critical_prob, Lambda, Pillia : double;
|
||||||
chisqr, HLTrace, chiprob, ftestprob, Roys, f, Hroot : double;
|
chisqr, HLTrace, chiprob, ftestprob, Roys, f, Hroot : double;
|
||||||
|
@ -188,16 +188,16 @@ end;
|
|||||||
|
|
||||||
procedure TPartialsFrm.ComputeBtnClick(Sender: TObject);
|
procedure TPartialsFrm.ComputeBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
rmatrix, workmat : DblDyneMat;
|
rmatrix, workmat: DblDyneMat;
|
||||||
Means, Variances, StdDevs, W, Betas : DblDyneVec;
|
Means, Variances, StdDevs, W, Betas: DblDyneVec;
|
||||||
R2Full, R2Cntrl, SemiPart, Partial, df1, df2, F, Prob : double;
|
R2Full, R2Cntrl, SemiPart, Partial, df1, df2, F, Prob: double;
|
||||||
NoPredVars, NoCntrlVars, DepVarNo, TotNoVars, pcnt, ccnt, count : integer;
|
NoPredVars, NoCntrlVars, DepVarNo, TotNoVars, pcnt, ccnt, count: integer;
|
||||||
PredVars, CntrlVars : IntDyneVec;
|
PredVars, CntrlVars: IntDyneVec;
|
||||||
MatVars : IntDyneVec;
|
MatVars: IntDyneVec;
|
||||||
outline, varstring : string;
|
outline, varstring: string;
|
||||||
i, j, K, L, NCases : integer;
|
i, j, K, L: integer;
|
||||||
errorcode : boolean;
|
errorcode: boolean;
|
||||||
vtimesw, W1, v : DblDyneMat;
|
vtimesw, W1, v: DblDyneMat;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
DepVarNo := 1;
|
DepVarNo := 1;
|
||||||
@ -213,7 +213,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
TotNoVars := NoPredVars + NoCntrlVars + 1;
|
TotNoVars := NoPredVars + NoCntrlVars + 1;
|
||||||
count := NoCases;
|
count := NoCases;
|
||||||
NCases := NoCases;
|
|
||||||
|
|
||||||
// Allocate space required
|
// Allocate space required
|
||||||
SetLength(vtimesw,NoVariables,NoVariables);
|
SetLength(vtimesw,NoVariables,NoVariables);
|
||||||
|
@ -576,7 +576,7 @@ var
|
|||||||
Title, astr : string;
|
Title, astr : string;
|
||||||
NewRowMarg,NewColMarg,NewSliceMarg : DblDyneVec;
|
NewRowMarg,NewColMarg,NewSliceMarg : DblDyneVec;
|
||||||
LogRowMarg, LogColMarg, LogSliceMarg : DblDyneVec;
|
LogRowMarg, LogColMarg, LogSliceMarg : DblDyneVec;
|
||||||
NewTotal : double;
|
NewTotal: double = 0.0;
|
||||||
ABLogs, ACLogs, BCLogs : DblDyneMat;
|
ABLogs, ACLogs, BCLogs : DblDyneMat;
|
||||||
LogTotal, mu, Ysqr : double;
|
LogTotal, mu, Ysqr : double;
|
||||||
DF : integer;
|
DF : integer;
|
||||||
|
@ -249,7 +249,7 @@ end;
|
|||||||
procedure TTwoWayLogLinFrm.ComputeBtnClick(Sender: TObject);
|
procedure TTwoWayLogLinFrm.ComputeBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
Data : DblDyneMat;
|
Data : DblDyneMat;
|
||||||
NewData : DblDyneMat;
|
NewData : DblDyneMat = nil;
|
||||||
Prop : DblDyneMat;
|
Prop : DblDyneMat;
|
||||||
LogData : DblDyneMat;
|
LogData : DblDyneMat;
|
||||||
Expected : DblDyneMat;
|
Expected : DblDyneMat;
|
||||||
@ -262,7 +262,7 @@ var
|
|||||||
ColLogs : DblDyneVec;
|
ColLogs : DblDyneVec;
|
||||||
CellLambdas : DblDyneCube;
|
CellLambdas : DblDyneCube;
|
||||||
Total : double;
|
Total : double;
|
||||||
NewTotal : double;
|
NewTotal: double = 0.0;
|
||||||
TotalLogs : double;
|
TotalLogs : double;
|
||||||
mu : double;
|
mu : double;
|
||||||
row, col : integer;
|
row, col : integer;
|
||||||
@ -304,18 +304,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
SetLength(Data,Nrows+1,Ncols+1);
|
SetLength(Data, Nrows + 1, Ncols + 1);
|
||||||
SetLength(CellLambdas,Nrows+1,Ncols+1,4);
|
SetLength(CellLambdas, Nrows + 1,Ncols + 1, 4);
|
||||||
SetLength(RowMarg,Nrows+1);
|
SetLength(RowMarg, Nrows + 1);
|
||||||
SetLength(RowLogs,Nrows+1);
|
SetLength(RowLogs, Nrows + 1);
|
||||||
SetLength(ColMarg,Ncols+1);
|
SetLength(ColMarg, Ncols + 1);
|
||||||
SetLength(ColLogs,Ncols+1);
|
SetLength(ColLogs, Ncols + 1);
|
||||||
SetLength(Prop,Nrows+1,Ncols+1);
|
SetLength(Prop, Nrows + 1, Ncols + 1);
|
||||||
SetLength(LogData,Nrows+1,Ncols+1);
|
SetLength(LogData, Nrows + 1, Ncols + 1);
|
||||||
SetLength(Expected,Nrows+1,Ncols+1);
|
SetLength(Expected, Nrows + 1, Ncols + 1);
|
||||||
SetLength(NewData,Nrows+1,Ncols+1);
|
SetLength(NewData, Nrows + 1, Ncols + 1);
|
||||||
SetLength(NewRowMarg,Nrows+1);
|
SetLength(NewRowMarg, Nrows + 1);
|
||||||
SetLength(NewColMarg,Ncols+1);
|
SetLength(NewColMarg, Ncols + 1);
|
||||||
|
|
||||||
for i := 1 to Nrows do
|
for i := 1 to Nrows do
|
||||||
for j := 1 to Ncols do
|
for j := 1 to Ncols do
|
||||||
|
@ -148,7 +148,7 @@ end;
|
|||||||
|
|
||||||
procedure TCompRelFrm.AllBtnClick(Sender: TObject);
|
procedure TCompRelFrm.AllBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i, count : integer;
|
i: integer;
|
||||||
cellstring : string;
|
cellstring : string;
|
||||||
begin
|
begin
|
||||||
cellstring := '1.0';
|
cellstring := '1.0';
|
||||||
@ -171,7 +171,7 @@ var
|
|||||||
Weights, Reliabilities, VectProd, means, variances, stddevs: DblDyneVec;
|
Weights, Reliabilities, VectProd, means, variances, stddevs: DblDyneVec;
|
||||||
CompRel, numerator, denominator, compscore: double;
|
CompRel, numerator, denominator, compscore: double;
|
||||||
colnoselected: IntDyneVec;
|
colnoselected: IntDyneVec;
|
||||||
outline, cellstring: string;
|
cellstring: string;
|
||||||
title: string;
|
title: string;
|
||||||
RowLabels: StrDyneVec;
|
RowLabels: StrDyneVec;
|
||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
@ -314,6 +314,7 @@ var
|
|||||||
cellstring: string;
|
cellstring: string;
|
||||||
begin
|
begin
|
||||||
cellstring := '1.0';
|
cellstring := '1.0';
|
||||||
|
i := 0;
|
||||||
while i < VarList.Items.Count do
|
while i < VarList.Items.Count do
|
||||||
begin
|
begin
|
||||||
if VarList.Selected[i] then
|
if VarList.Selected[i] then
|
||||||
@ -339,6 +340,7 @@ procedure TCompRelFrm.OutBtnClick(Sender: TObject);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
i := 0;
|
||||||
while i < ItemList.Items.Count do
|
while i < ItemList.Items.Count do
|
||||||
begin
|
begin
|
||||||
if ItemList.Selected[i] then
|
if ItemList.Selected[i] then
|
||||||
|
@ -94,7 +94,7 @@ object DIFFrm: TDIFFrm
|
|||||||
Height = 19
|
Height = 19
|
||||||
Top = 167
|
Top = 167
|
||||||
Width = 137
|
Width = 137
|
||||||
Caption = 'Item Char. Curves'
|
Caption = 'Plot Item Curves'
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
object CountsChk: TCheckBox
|
object CountsChk: TCheckBox
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// Test file: DIFData.laz
|
// Data file not 100% clear, bus seems to be: DIFData.laz
|
||||||
// - Reference Group Code: 1
|
// - Reference Group Code: 1
|
||||||
// - Focal Group Code: 2
|
// - Focal Group Code: 2
|
||||||
// - No. of Score Levels: 11
|
// - No. of Score Levels: 11
|
||||||
// - Lower/Upper Bounds: 0-3, 4-7, 8-11, 12-15, 16-19, 20-23, 24-27, 28-31, 32-35, 36-39, 40-43
|
// - Lower/Upper Bounds: 0-3, 4-7, 8-11, 12-15, 16-19, 20-23, 24-27, 28-31, 32-35, 36-39, 40-43
|
||||||
|
// The result obtained this way match the pdf file.
|
||||||
|
|
||||||
unit DifUnit;
|
unit DifUnit;
|
||||||
|
|
||||||
|
@ -369,6 +369,7 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
OnEditingDone = LevelsEditEditingDone
|
OnEditingDone = LevelsEditEditingDone
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
|
Text = 'LevelsEdit'
|
||||||
end
|
end
|
||||||
object GroupBox1: TGroupBox
|
object GroupBox1: TGroupBox
|
||||||
AnchorSideLeft.Control = GroupBox2
|
AnchorSideLeft.Control = GroupBox2
|
||||||
@ -378,7 +379,7 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 51
|
Height = 51
|
||||||
Top = 307
|
Top = 328
|
||||||
Width = 188
|
Width = 188
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -471,19 +472,19 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
AnchorSideRight.Control = Panel3
|
AnchorSideRight.Control = Panel3
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 132
|
Height = 153
|
||||||
Top = 163
|
Top = 163
|
||||||
Width = 188
|
Width = 188
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 12
|
BorderSpacing.Top = 12
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
Caption = 'Enter Bounds for Levels'
|
Caption = 'Enter Bounds for Levels'
|
||||||
ClientHeight = 112
|
ClientHeight = 133
|
||||||
ClientWidth = 184
|
ClientWidth = 184
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object Panel2: TPanel
|
object Panel2: TPanel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 104
|
Height = 125
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 168
|
Width = 168
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -491,7 +492,7 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
BorderSpacing.Bottom = 8
|
BorderSpacing.Bottom = 8
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 104
|
ClientHeight = 125
|
||||||
ClientWidth = 168
|
ClientWidth = 168
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object Label6: TLabel
|
object Label6: TLabel
|
||||||
@ -534,7 +535,7 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
AnchorSideRight.Control = LowBoundEdit
|
AnchorSideRight.Control = LowBoundEdit
|
||||||
Left = 50
|
Left = 50
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 54
|
Top = 50
|
||||||
Width = 70
|
Width = 70
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
@ -547,7 +548,7 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
AnchorSideRight.Control = UpBoundEdit
|
AnchorSideRight.Control = UpBoundEdit
|
||||||
Left = 50
|
Left = 50
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 85
|
Top = 77
|
||||||
Width = 70
|
Width = 70
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
@ -572,16 +573,17 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
OnChange = LevelScrollChange
|
OnChange = LevelScrollChange
|
||||||
end
|
end
|
||||||
object LowBoundEdit: TEdit
|
object LowBoundEdit: TEdit
|
||||||
|
AnchorSideTop.Control = LevelNoEdit
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = Panel2
|
AnchorSideRight.Control = Panel2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 128
|
Left = 128
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 50
|
Top = 46
|
||||||
Width = 40
|
Width = 40
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 4
|
||||||
OnEditingDone = LowBoundEditEditingDone
|
OnEditingDone = LowBoundEditEditingDone
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Text = 'LowBoundEdit'
|
Text = 'LowBoundEdit'
|
||||||
@ -593,14 +595,14 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 128
|
Left = 128
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 81
|
Top = 73
|
||||||
Width = 40
|
Width = 40
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 4
|
||||||
OnEditingDone = UpBoundEditEditingDone
|
OnEditingDone = UpBoundEditEditingDone
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Text = 'Edit1'
|
Text = 'UpBoundEdit'
|
||||||
end
|
end
|
||||||
object LevelNoEdit: TStaticText
|
object LevelNoEdit: TStaticText
|
||||||
AnchorSideTop.Control = Label8
|
AnchorSideTop.Control = Label8
|
||||||
@ -617,6 +619,22 @@ object PolyDIFFrm: TPolyDIFFrm
|
|||||||
BorderStyle = sbsSingle
|
BorderStyle = sbsSingle
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
|
object NextBtn: TButton
|
||||||
|
AnchorSideTop.Control = UpBoundEdit
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = UpBoundEdit
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 90
|
||||||
|
Height = 25
|
||||||
|
Top = 100
|
||||||
|
Width = 78
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Top = 4
|
||||||
|
Caption = 'Next level'
|
||||||
|
OnClick = NextBtnClick
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
// - Level 1: lower bound 0, upper bound 1
|
// - Level 1: lower bound 0, upper bound 1
|
||||||
// - Level 2: lower bound 2, upper bound 3
|
// - Level 2: lower bound 2, upper bound 3
|
||||||
// - Level 3: lower bound 4, upper bound 5
|
// - Level 3: lower bound 4, upper bound 5
|
||||||
|
// - Lower/upper bounds: 0-1, 2-3, 4-5
|
||||||
// The results obtained this way match the pdf file.
|
// The results obtained this way match the pdf file.
|
||||||
|
|
||||||
unit PolyDifUnit;
|
unit PolyDifUnit;
|
||||||
@ -26,6 +27,7 @@ type
|
|||||||
|
|
||||||
TPolyDIFFrm = class(TForm)
|
TPolyDIFFrm = class(TForm)
|
||||||
Bevel1: TBevel;
|
Bevel1: TBevel;
|
||||||
|
NextBtn: TButton;
|
||||||
GroupBox2: TGroupBox;
|
GroupBox2: TGroupBox;
|
||||||
HelpBtn: TButton;
|
HelpBtn: TButton;
|
||||||
LevelNoEdit: TStaticText;
|
LevelNoEdit: TStaticText;
|
||||||
@ -79,6 +81,7 @@ type
|
|||||||
procedure LevelScrollChange(Sender: TObject);
|
procedure LevelScrollChange(Sender: TObject);
|
||||||
procedure LevelsEditEditingDone(Sender: TObject);
|
procedure LevelsEditEditingDone(Sender: TObject);
|
||||||
procedure LowBoundEditEditingDone(Sender: TObject);
|
procedure LowBoundEditEditingDone(Sender: TObject);
|
||||||
|
procedure NextBtnClick(Sender: TObject);
|
||||||
procedure ResetBtnClick(Sender: TObject);
|
procedure ResetBtnClick(Sender: TObject);
|
||||||
procedure UpBoundEditEditingDone(Sender: TObject);
|
procedure UpBoundEditEditingDone(Sender: TObject);
|
||||||
procedure VarListSelectionChange(Sender: TObject; User: boolean);
|
procedure VarListSelectionChange(Sender: TObject; User: boolean);
|
||||||
@ -147,16 +150,18 @@ end;
|
|||||||
procedure TPolyDIFFrm.UpBoundEditEditingDone(Sender: TObject);
|
procedure TPolyDIFFrm.UpBoundEditEditingDone(Sender: TObject);
|
||||||
var
|
var
|
||||||
level: Integer;
|
level: Integer;
|
||||||
|
n: Integer;
|
||||||
begin
|
begin
|
||||||
level := StrToInt(LevelNoEdit.Caption) - 1;
|
level := StrToInt(LevelNoEdit.Caption) - 1;
|
||||||
Ubounds[level] := StrToInt(UpBoundEdit.Text);
|
if TryStrToInt(UpBoundEdit.Text, n) then
|
||||||
if level + 1 = StrToInt(LevelsEdit.Text) then
|
|
||||||
begin
|
begin
|
||||||
ComputeBtn.Enabled := true;
|
Ubounds[level] := n;
|
||||||
exit;
|
if level + 1 = StrToInt(LevelsEdit.Text) then
|
||||||
end;
|
exit;
|
||||||
// LowBoundEdit.Text := IntToStr(UBounds[level]); //IntToStr(Ubounds[level] + 1);
|
if LBounds[level + 1] = -1 then
|
||||||
// LowBoundEdit.SetFocus;
|
lBounds[level + 1] := UBounds[level] + 1;
|
||||||
|
end else
|
||||||
|
MessageDlg(Format('No valid number in upper bound at level #%d.', [level+1]), mtError, [mbOk], 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPolyDIFFrm.FormActivate(Sender: TObject);
|
procedure TPolyDIFFrm.FormActivate(Sender: TObject);
|
||||||
@ -272,7 +277,7 @@ begin
|
|||||||
if LBounds[level] = -1 then
|
if LBounds[level] = -1 then
|
||||||
LowBoundEdit.Text := ''
|
LowBoundEdit.Text := ''
|
||||||
else
|
else
|
||||||
LowBoundEdit.Text :=IntToStr(LBounds[level]);
|
LowBoundEdit.Text := IntToStr(LBounds[level]);
|
||||||
|
|
||||||
if UBounds[level] = -1 then
|
if UBounds[level] = -1 then
|
||||||
UpBoundEdit.Text := ''
|
UpBoundEdit.Text := ''
|
||||||
@ -289,17 +294,24 @@ begin
|
|||||||
LevelScroll.Max := Max(L - 1, 0);
|
LevelScroll.Max := Max(L - 1, 0);
|
||||||
LevelScroll.Min := 0;
|
LevelScroll.Min := 0;
|
||||||
LevelNoEdit.Caption := IntToStr(LevelScroll.Position + 1);
|
LevelNoEdit.Caption := IntToStr(LevelScroll.Position + 1);
|
||||||
//LevelScroll.Enabled := true;
|
|
||||||
//LowBoundEdit.SetFocus;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPolyDIFFrm.LowBoundEditEditingDone(Sender: TObject);
|
procedure TPolyDIFFrm.LowBoundEditEditingDone(Sender: TObject);
|
||||||
var
|
var
|
||||||
level: integer;
|
level: integer;
|
||||||
|
n: Integer;
|
||||||
begin
|
begin
|
||||||
level := LevelScroll.Position;
|
level := LevelScroll.Position;
|
||||||
Lbounds[level] := StrToInt(LowBoundEdit.Text);
|
if TryStrToInt(LowBoundEdit.Text, n) then
|
||||||
|
Lbounds[level] := n
|
||||||
|
else
|
||||||
|
Messagedlg(Format('No valid number in lower bound at level #%d.', [level+1]), mtError, [mbOK], 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPolyDIFFrm.NextBtnClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
LevelScroll.Position := LevelScroll.Position + 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPolyDIFFrm.AllBtnClick(Sender: TObject);
|
procedure TPolyDIFFrm.AllBtnClick(Sender: TObject);
|
||||||
@ -318,22 +330,23 @@ end;
|
|||||||
|
|
||||||
procedure TPolyDIFFrm.ComputeBtnClick(Sender: TObject);
|
procedure TPolyDIFFrm.ComputeBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i, j, k : integer;
|
i, j, k: integer;
|
||||||
itm, nolevels, level : integer;
|
itm, nolevels, level: integer;
|
||||||
grpvar : integer;
|
grpvar: integer;
|
||||||
subjgrp : integer;
|
subjgrp: integer;
|
||||||
subjtot : integer;
|
subjtot: integer;
|
||||||
value : integer;
|
value: integer;
|
||||||
cellstring : string;
|
cellstring: string;
|
||||||
title : string;
|
title: string;
|
||||||
nsize : array [1..2] of integer;
|
nsize: array [1..2] of integer;
|
||||||
FData : IntDyneCube; //no. of category values within item for focal group
|
FData: IntDyneCube; //no. of category values within item for focal group
|
||||||
RData : IntDyneCube; //no. of category values within item for reference group
|
RData: IntDyneCube; //no. of category values within item for reference group
|
||||||
TotData : IntDyneCube; // sum of the above two
|
TotData: IntDyneCube; // sum of the above two
|
||||||
t, Mf, Mb, Sf, Sb, Nb, Nf, df, d, Sd : DblDyneVec;
|
t, Mf, Mb, Sf, Sb, Nb, Nf, df, d, Sd: DblDyneVec;
|
||||||
Zc, Vart, BigJ, SumE, SumV, Term1, MY, prob : double;
|
Zc, Vart, BigJ, SumE, SumV, Term1, MY, prob: double;
|
||||||
X, BigDnum, BigDden, BigD, BigDS, Zd, M2, E, VarE, Ti, dftot : double;
|
X, BigDnum, BigDden, BigD, BigDS, Zd, M2, E, VarE, Ti, dftot: double;
|
||||||
loscore, hiscore : integer;
|
loscore, hiscore: integer;
|
||||||
|
morePlots: Boolean;
|
||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
begin
|
begin
|
||||||
NoItems := ItemsList.Items.Count;
|
NoItems := ItemsList.Items.Count;
|
||||||
@ -376,7 +389,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
lReport := TStringList.Create;
|
lReport := TStringList.Create;
|
||||||
try
|
try
|
||||||
lReport.Add('POLYTOMOUS ITEM DIF ANALYSIS');
|
lReport.Add('POLYTOMOUS ITEM DIF ANALYSIS');
|
||||||
@ -491,6 +503,7 @@ begin
|
|||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
// obtain statistics and print frequency in categories for each item
|
// obtain statistics and print frequency in categories for each item
|
||||||
|
morePlots := true;
|
||||||
for i := 1 to NoItems do
|
for i := 1 to NoItems do
|
||||||
begin
|
begin
|
||||||
lReport.Add('ITEM ' + IntToStr(i));
|
lReport.Add('ITEM ' + IntToStr(i));
|
||||||
@ -631,11 +644,11 @@ begin
|
|||||||
lReport.Add(DIVIDER);
|
lReport.Add(DIVIDER);
|
||||||
lReport.Add('');
|
lReport.Add('');
|
||||||
|
|
||||||
if GraphChk.Checked then
|
if GraphChk.Checked and morePlots then
|
||||||
begin
|
begin
|
||||||
GraphFrm.nosets := 2;
|
GraphFrm.nosets := 2;
|
||||||
GraphFrm.nbars := nolevels;
|
GraphFrm.nbars := nolevels;
|
||||||
GraphFrm.Heading := 'Level Means';
|
GraphFrm.Heading := 'Level Means, Item ' + IntToStr(i);
|
||||||
GraphFrm.XTitle := 'Level';
|
GraphFrm.XTitle := 'Level';
|
||||||
GraphFrm.YTitle := 'Mean';
|
GraphFrm.YTitle := 'Mean';
|
||||||
SetLength(GraphFrm.Ypoints, 2, nolevels+1);
|
SetLength(GraphFrm.Ypoints, 2, nolevels+1);
|
||||||
@ -656,7 +669,7 @@ begin
|
|||||||
GraphFrm.BackColor := GRAPH_BACK_COLOR;
|
GraphFrm.BackColor := GRAPH_BACK_COLOR;
|
||||||
GraphFrm.WallColor := GRAPH_WALL_COLOR;
|
GraphFrm.WallColor := GRAPH_WALL_COLOR;
|
||||||
GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
|
GraphFrm.FloorColor := GRAPH_FLOOR_COLOR;
|
||||||
GraphFrm.ShowModal;
|
morePlots := (GraphFrm.ShowModal = mrOK);
|
||||||
end;
|
end;
|
||||||
end; // next item
|
end; // next item
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ VAR
|
|||||||
means, variances, stddevs: DblDyneVec;
|
means, variances, stddevs: DblDyneVec;
|
||||||
determinant, chisquare, probability: double;
|
determinant, chisquare, probability: double;
|
||||||
i, j, df, p, ncases, colno: integer;
|
i, j, df, p, ncases, colno: integer;
|
||||||
aline, strvalue, title, probvalue, chivalue: string;
|
title: string;
|
||||||
ColNoSelected: IntDyneVec;
|
ColNoSelected: IntDyneVec;
|
||||||
dblvalue: double;
|
dblvalue: double;
|
||||||
DataGrid: DblDyneMat;
|
DataGrid: DblDyneMat;
|
||||||
|
@ -419,12 +419,14 @@ begin
|
|||||||
FrmOutPut.ShowModal();
|
FrmOutPut.ShowModal();
|
||||||
}
|
}
|
||||||
// get no. of categories
|
// get no. of categories
|
||||||
|
nocats := 0;
|
||||||
for i := 0 to NoCases do
|
for i := 0 to NoCases do
|
||||||
if ((Deaths[i] > 0) or (Censored[i] > 0)) then nocats := nocats + 1;
|
if (Deaths[i] > 0) or (Censored[i] > 0) then
|
||||||
SetLength(Time,nocats+2);
|
nocats := nocats + 1;
|
||||||
SetLength(AtRisk,nocats+2);
|
SetLength(Time, nocats + 2);
|
||||||
SetLength(Dead,nocats+2);
|
SetLength(AtRisk, nocats + 2);
|
||||||
SetLength(CondProb,nocats+2);
|
SetLength(Dead, nocats + 2);
|
||||||
|
SetLength(CondProb, nocats + 2);
|
||||||
for i := 0 to nocats do
|
for i := 0 to nocats do
|
||||||
begin
|
begin
|
||||||
Time[i] := 0;
|
Time[i] := 0;
|
||||||
|
@ -134,7 +134,7 @@ const
|
|||||||
var
|
var
|
||||||
i, j, GrpVar, MeasVar, mingrp, maxgrp, G, range, grpsize : integer;
|
i, j, GrpVar, MeasVar, mingrp, maxgrp, G, range, grpsize : integer;
|
||||||
oldgrpsize : integer;
|
oldgrpsize : integer;
|
||||||
X, UCL, LCL, Sigma, UpperSpec, LowerSpec, TargetSpec : double;
|
X, UCL, LCL, UpperSpec, LowerSpec, TargetSpec : double;
|
||||||
xmin, xmax, GrandMean, GrandSD, semean, D3Value, D4Value : double;
|
xmin, xmax, GrandMean, GrandSD, semean, D3Value, D4Value : double;
|
||||||
GrandSigma, C4, gamma, B : double;
|
GrandSigma, C4, gamma, B : double;
|
||||||
means, stddev: DblDyneVec;
|
means, stddev: DblDyneVec;
|
||||||
@ -165,7 +165,6 @@ begin
|
|||||||
|
|
||||||
GrpVar := 1;
|
GrpVar := 1;
|
||||||
MeasVar := 2;
|
MeasVar := 2;
|
||||||
Sigma := 3.0;
|
|
||||||
UpperSpec := 0.0;
|
UpperSpec := 0.0;
|
||||||
LowerSpec := 0.0;
|
LowerSpec := 0.0;
|
||||||
TargetSpec := 0.0;
|
TargetSpec := 0.0;
|
||||||
|
@ -406,7 +406,7 @@ begin
|
|||||||
x2 := x1 + bwidth;
|
x2 := x1 + bwidth;
|
||||||
x3 := x2 + triwidth;
|
x3 := x2 + triwidth;
|
||||||
x4 := x1 + triwidth;
|
x4 := x1 + triwidth;
|
||||||
y1 := YStart - yoffset - round(ydist);
|
y1 := YStart - yoffset {%H-}- round(ydist);
|
||||||
y2 := y1 - triheight;
|
y2 := y1 - triheight;
|
||||||
Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]);
|
Image1.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]);
|
||||||
end;
|
end;
|
||||||
@ -643,7 +643,7 @@ begin
|
|||||||
y2 := y1 - triheight;
|
y2 := y1 - triheight;
|
||||||
yprop := (YPoints[i-1,j] - YMin) / (YMax - YMin);
|
yprop := (YPoints[i-1,j] - YMin) / (YMax - YMin);
|
||||||
ydist := round(yprop * YAxisLength);
|
ydist := round(yprop * YAxisLength);
|
||||||
y3 := ystart - yoffset - round(ydist);
|
y3 := ystart - yoffset {%H-}- round(ydist);
|
||||||
y4 := y3 - triheight;
|
y4 := y3 - triheight;
|
||||||
points[0] := Point(x1,y1);
|
points[0] := Point(x1,y1);
|
||||||
points[1] := Point(x2,y2);
|
points[1] := Point(x2,y2);
|
||||||
@ -1124,7 +1124,7 @@ begin
|
|||||||
x2 := x1 + bwidth;
|
x2 := x1 + bwidth;
|
||||||
x3 := x2 + triwidth;
|
x3 := x2 + triwidth;
|
||||||
x4 := x1 + triwidth;
|
x4 := x1 + triwidth;
|
||||||
y1 := YStart - yoffset - round(ydist);
|
y1 := YStart - yoffset {%H-}- round(ydist);
|
||||||
y2 := y1 - triheight;
|
y2 := y1 - triheight;
|
||||||
Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]);
|
Printer.Canvas.Polygon([Point(x1,y1),Point(x2,y1),Point(x3,y2),Point(x4,y2)]);
|
||||||
end;
|
end;
|
||||||
|
@ -95,7 +95,6 @@ var
|
|||||||
determ, n3, r1, s8, s9, d2, x, y, mean : double;
|
determ, n3, r1, s8, s9, d2, x, y, mean : double;
|
||||||
linestring : string;
|
linestring : string;
|
||||||
cellstring : string;
|
cellstring : string;
|
||||||
singular : boolean;
|
|
||||||
title : string;
|
title : string;
|
||||||
RowLabels: StrDyneVec;
|
RowLabels: StrDyneVec;
|
||||||
ColLabels: StrDyneVec;
|
ColLabels: StrDyneVec;
|
||||||
@ -127,7 +126,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// get determinant of Rho matrix, i.e. check for singularity
|
// get determinant of Rho matrix, i.e. check for singularity
|
||||||
singular := FALSE;
|
|
||||||
for i := 0 to NoVars-1 do
|
for i := 0 to NoVars-1 do
|
||||||
begin
|
begin
|
||||||
for j := 0 to NoVars - 1 do
|
for j := 0 to NoVars - 1 do
|
||||||
|
@ -1954,7 +1954,7 @@ procedure scatplot(const x, y: DblDyneVec; NoCases: integer;
|
|||||||
var
|
var
|
||||||
i, j, l, row, xslot : integer;
|
i, j, l, row, xslot : integer;
|
||||||
maxy: double;
|
maxy: double;
|
||||||
incrementx, incrementy, rangex, rangey, swap : double;
|
incrementx, incrementy, rangex, rangey: double;
|
||||||
plotstring : array[0..51,0..61] of char;
|
plotstring : array[0..51,0..61] of char;
|
||||||
height : integer;
|
height : integer;
|
||||||
overlap : boolean;
|
overlap : boolean;
|
||||||
|
Reference in New Issue
Block a user