You've already forked lazarus-ccr
LazStats: Inherit form of SpearmanUnit from TBasicStatsReportForm.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7808 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,248 +1,185 @@
|
|||||||
object SpearmanFrm: TSpearmanFrm
|
inherited SpearmanFrm: TSpearmanFrm
|
||||||
Left = 531
|
Left = 531
|
||||||
Height = 317
|
Height = 347
|
||||||
Top = 246
|
Top = 246
|
||||||
Width = 347
|
Width = 679
|
||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/SpearmanRankCorrelation.htm'
|
HelpKeyword = 'html/SpearmanRankCorrelation.htm'
|
||||||
AutoSize = True
|
|
||||||
Caption = 'Spearman Rank Correlation'
|
Caption = 'Spearman Rank Correlation'
|
||||||
ClientHeight = 317
|
ClientHeight = 347
|
||||||
ClientWidth = 347
|
ClientWidth = 679
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
OnCreate = FormCreate
|
Height = 331
|
||||||
OnShow = FormShow
|
ClientHeight = 331
|
||||||
Position = poMainFormCenter
|
inherited CloseBtn: TButton
|
||||||
LCLVersion = '2.1.0.0'
|
Top = 306
|
||||||
object Label1: TLabel
|
end
|
||||||
AnchorSideLeft.Control = Owner
|
inherited ComputeBtn: TButton
|
||||||
AnchorSideTop.Control = Owner
|
Top = 306
|
||||||
Left = 8
|
end
|
||||||
Height = 15
|
inherited ResetBtn: TButton
|
||||||
Top = 8
|
Top = 306
|
||||||
Width = 97
|
end
|
||||||
BorderSpacing.Left = 8
|
inherited HelpBtn: TButton
|
||||||
BorderSpacing.Top = 8
|
Top = 306
|
||||||
Caption = 'Variables Available'
|
end
|
||||||
ParentColor = False
|
inherited ButtonBevel: TBevel
|
||||||
|
Top = 290
|
||||||
|
end
|
||||||
|
object Label1: TLabel[5]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = ParamsPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 15
|
||||||
|
Top = 0
|
||||||
|
Width = 97
|
||||||
|
Caption = 'Variables Available'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel[6]
|
||||||
|
AnchorSideLeft.Control = XEdit
|
||||||
|
AnchorSideBottom.Control = XEdit
|
||||||
|
Left = 166
|
||||||
|
Height = 15
|
||||||
|
Top = 21
|
||||||
|
Width = 51
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
BorderSpacing.Bottom = 2
|
||||||
|
Caption = 'X Variable'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label3: TLabel[7]
|
||||||
|
AnchorSideLeft.Control = YEdit
|
||||||
|
AnchorSideBottom.Control = YEdit
|
||||||
|
Left = 166
|
||||||
|
Height = 15
|
||||||
|
Top = 109
|
||||||
|
Width = 51
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
BorderSpacing.Bottom = 2
|
||||||
|
Caption = 'Y Variable'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object VarList: TListBox[8]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = Label1
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = XIn
|
||||||
|
AnchorSideBottom.Control = ButtonBevel
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 0
|
||||||
|
Height = 273
|
||||||
|
Top = 17
|
||||||
|
Width = 126
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
BorderSpacing.Top = 2
|
||||||
|
BorderSpacing.Right = 6
|
||||||
|
BorderSpacing.Bottom = 8
|
||||||
|
ItemHeight = 0
|
||||||
|
OnDblClick = VarListDblClick
|
||||||
|
OnSelectionChange = VarListSelectionChange
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
object XIn: TBitBtn[9]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
AnchorSideTop.Control = VarList
|
||||||
|
Left = 132
|
||||||
|
Height = 26
|
||||||
|
Top = 17
|
||||||
|
Width = 26
|
||||||
|
Images = MainDataModule.ImageList
|
||||||
|
ImageIndex = 1
|
||||||
|
OnClick = XInClick
|
||||||
|
Spacing = 0
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object XOut: TBitBtn[10]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
AnchorSideTop.Control = XIn
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 132
|
||||||
|
Height = 26
|
||||||
|
Top = 47
|
||||||
|
Width = 26
|
||||||
|
BorderSpacing.Top = 4
|
||||||
|
Images = MainDataModule.ImageList
|
||||||
|
ImageIndex = 0
|
||||||
|
OnClick = XOutClick
|
||||||
|
Spacing = 0
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object YIn: TBitBtn[11]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
AnchorSideTop.Control = XOut
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 132
|
||||||
|
Height = 26
|
||||||
|
Top = 105
|
||||||
|
Width = 26
|
||||||
|
BorderSpacing.Top = 32
|
||||||
|
Images = MainDataModule.ImageList
|
||||||
|
ImageIndex = 1
|
||||||
|
OnClick = YInClick
|
||||||
|
Spacing = 0
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object YOut: TBitBtn[12]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
|
AnchorSideTop.Control = YIn
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 132
|
||||||
|
Height = 26
|
||||||
|
Top = 135
|
||||||
|
Width = 26
|
||||||
|
BorderSpacing.Top = 4
|
||||||
|
Images = MainDataModule.ImageList
|
||||||
|
ImageIndex = 0
|
||||||
|
OnClick = YOutClick
|
||||||
|
Spacing = 0
|
||||||
|
TabOrder = 8
|
||||||
|
end
|
||||||
|
object XEdit: TEdit[13]
|
||||||
|
AnchorSideLeft.Control = XIn
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ParamsPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
AnchorSideBottom.Control = XOut
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 166
|
||||||
|
Height = 23
|
||||||
|
Top = 38
|
||||||
|
Width = 125
|
||||||
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
|
BorderSpacing.Left = 8
|
||||||
|
BorderSpacing.Bottom = 12
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 9
|
||||||
|
Text = 'XEdit'
|
||||||
|
end
|
||||||
|
object YEdit: TEdit[14]
|
||||||
|
AnchorSideLeft.Control = YOut
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideRight.Control = ParamsPanel
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
AnchorSideBottom.Control = YOut
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 166
|
||||||
|
Height = 23
|
||||||
|
Top = 126
|
||||||
|
Width = 125
|
||||||
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
|
BorderSpacing.Left = 8
|
||||||
|
BorderSpacing.Bottom = 12
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 10
|
||||||
|
Text = 'YEdit'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
inherited ParamsSplitter: TSplitter
|
||||||
AnchorSideLeft.Control = XEdit
|
Height = 347
|
||||||
AnchorSideBottom.Control = XEdit
|
|
||||||
Left = 233
|
|
||||||
Height = 15
|
|
||||||
Top = 33
|
|
||||||
Width = 51
|
|
||||||
Anchors = [akLeft, akBottom]
|
|
||||||
BorderSpacing.Bottom = 2
|
|
||||||
Caption = 'X Variable'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object Label3: TLabel
|
|
||||||
AnchorSideLeft.Control = YEdit
|
|
||||||
AnchorSideBottom.Control = YEdit
|
|
||||||
Left = 233
|
|
||||||
Height = 15
|
|
||||||
Top = 125
|
|
||||||
Width = 51
|
|
||||||
Anchors = [akLeft, akBottom]
|
|
||||||
BorderSpacing.Bottom = 2
|
|
||||||
Caption = 'Y Variable'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object VarList: TListBox
|
|
||||||
AnchorSideLeft.Control = Owner
|
|
||||||
AnchorSideTop.Control = Label1
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = XIn
|
|
||||||
AnchorSideBottom.Control = Bevel1
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 8
|
|
||||||
Height = 243
|
|
||||||
Top = 25
|
|
||||||
Width = 181
|
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Top = 2
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
Constraints.MinHeight = 200
|
|
||||||
ItemHeight = 0
|
|
||||||
OnSelectionChange = VarListSelectionChange
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object XIn: TBitBtn
|
|
||||||
AnchorSideLeft.Control = Bevel2
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = VarList
|
|
||||||
Left = 197
|
|
||||||
Height = 28
|
|
||||||
Top = 25
|
|
||||||
Width = 28
|
|
||||||
Images = MainDataModule.ImageList
|
|
||||||
ImageIndex = 1
|
|
||||||
OnClick = XInClick
|
|
||||||
Spacing = 0
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object XOut: TBitBtn
|
|
||||||
AnchorSideLeft.Control = Bevel2
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = XIn
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 197
|
|
||||||
Height = 28
|
|
||||||
Top = 57
|
|
||||||
Width = 28
|
|
||||||
BorderSpacing.Top = 4
|
|
||||||
Images = MainDataModule.ImageList
|
|
||||||
ImageIndex = 0
|
|
||||||
OnClick = XOutClick
|
|
||||||
Spacing = 0
|
|
||||||
TabOrder = 2
|
|
||||||
end
|
|
||||||
object YIn: TBitBtn
|
|
||||||
AnchorSideLeft.Control = Bevel2
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = XOut
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 197
|
|
||||||
Height = 28
|
|
||||||
Top = 117
|
|
||||||
Width = 28
|
|
||||||
BorderSpacing.Top = 32
|
|
||||||
Images = MainDataModule.ImageList
|
|
||||||
ImageIndex = 1
|
|
||||||
OnClick = YInClick
|
|
||||||
Spacing = 0
|
|
||||||
TabOrder = 3
|
|
||||||
end
|
|
||||||
object YOut: TBitBtn
|
|
||||||
AnchorSideLeft.Control = Bevel2
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = YIn
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 197
|
|
||||||
Height = 28
|
|
||||||
Top = 149
|
|
||||||
Width = 28
|
|
||||||
BorderSpacing.Top = 4
|
|
||||||
Images = MainDataModule.ImageList
|
|
||||||
ImageIndex = 0
|
|
||||||
OnClick = YOutClick
|
|
||||||
Spacing = 0
|
|
||||||
TabOrder = 4
|
|
||||||
end
|
|
||||||
object XEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = XIn
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = Owner
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = XOut
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 233
|
|
||||||
Height = 23
|
|
||||||
Top = 50
|
|
||||||
Width = 106
|
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 12
|
|
||||||
ReadOnly = True
|
|
||||||
TabOrder = 5
|
|
||||||
Text = 'XEdit'
|
|
||||||
end
|
|
||||||
object YEdit: TEdit
|
|
||||||
AnchorSideLeft.Control = YOut
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = Owner
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = YOut
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 233
|
|
||||||
Height = 23
|
|
||||||
Top = 142
|
|
||||||
Width = 106
|
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 12
|
|
||||||
ReadOnly = True
|
|
||||||
TabOrder = 6
|
|
||||||
Text = 'YEdit'
|
|
||||||
end
|
|
||||||
object ResetBtn: TButton
|
|
||||||
AnchorSideRight.Control = ComputeBtn
|
|
||||||
AnchorSideBottom.Control = Owner
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 138
|
|
||||||
Height = 25
|
|
||||||
Top = 284
|
|
||||||
Width = 54
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
Caption = 'Reset'
|
|
||||||
OnClick = ResetBtnClick
|
|
||||||
TabOrder = 7
|
|
||||||
end
|
|
||||||
object ComputeBtn: TButton
|
|
||||||
AnchorSideRight.Control = CloseBtn
|
|
||||||
AnchorSideBottom.Control = Owner
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 200
|
|
||||||
Height = 25
|
|
||||||
Top = 284
|
|
||||||
Width = 76
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
Caption = 'Compute'
|
|
||||||
OnClick = ComputeBtnClick
|
|
||||||
TabOrder = 8
|
|
||||||
end
|
|
||||||
object CloseBtn: TButton
|
|
||||||
AnchorSideRight.Control = Owner
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = Owner
|
|
||||||
AnchorSideBottom.Side = asrBottom
|
|
||||||
Left = 284
|
|
||||||
Height = 25
|
|
||||||
Top = 284
|
|
||||||
Width = 55
|
|
||||||
Anchors = [akRight, akBottom]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
Caption = 'Close'
|
|
||||||
ModalResult = 11
|
|
||||||
TabOrder = 9
|
|
||||||
end
|
|
||||||
object Bevel1: TBevel
|
|
||||||
AnchorSideLeft.Control = Owner
|
|
||||||
AnchorSideRight.Control = Owner
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = ComputeBtn
|
|
||||||
Left = 0
|
|
||||||
Height = 8
|
|
||||||
Top = 268
|
|
||||||
Width = 347
|
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
|
||||||
Shape = bsBottomLine
|
|
||||||
end
|
|
||||||
object Bevel2: TBevel
|
|
||||||
AnchorSideLeft.Control = Owner
|
|
||||||
AnchorSideLeft.Side = asrCenter
|
|
||||||
Left = 150
|
|
||||||
Height = 11
|
|
||||||
Top = 3
|
|
||||||
Width = 47
|
|
||||||
Shape = bsSpacer
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,135 +5,82 @@ unit SpearmanUnit;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, Buttons, ExtCtrls,
|
StdCtrls, Buttons, ExtCtrls,
|
||||||
MainUnit, OutputUnit, FunctionsLib, Globals, DataProcs;
|
MainUnit, FunctionsLib, Globals, DataProcs, BasicStatsReportFormUnit;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TSpearmanFrm }
|
{ TSpearmanFrm }
|
||||||
|
|
||||||
TSpearmanFrm = class(TForm)
|
TSpearmanFrm = class(TBasicStatsReportForm)
|
||||||
Bevel1: TBevel;
|
Bevel1: TBevel;
|
||||||
Bevel2: TBevel;
|
|
||||||
XIn: TBitBtn;
|
XIn: TBitBtn;
|
||||||
XOut: TBitBtn;
|
XOut: TBitBtn;
|
||||||
YIn: TBitBtn;
|
YIn: TBitBtn;
|
||||||
YOut: TBitBtn;
|
YOut: TBitBtn;
|
||||||
ResetBtn: TButton;
|
|
||||||
ComputeBtn: TButton;
|
|
||||||
CloseBtn: TButton;
|
|
||||||
XEdit: TEdit;
|
XEdit: TEdit;
|
||||||
YEdit: TEdit;
|
YEdit: TEdit;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Label3: TLabel;
|
Label3: TLabel;
|
||||||
VarList: TListBox;
|
VarList: TListBox;
|
||||||
procedure ComputeBtnClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
procedure FormActivate(Sender: TObject);
|
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure FormShow(Sender: TObject);
|
|
||||||
procedure ResetBtnClick(Sender: TObject);
|
|
||||||
procedure VarListSelectionChange(Sender: TObject; User: boolean);
|
|
||||||
procedure XInClick(Sender: TObject);
|
procedure XInClick(Sender: TObject);
|
||||||
procedure XOutClick(Sender: TObject);
|
procedure XOutClick(Sender: TObject);
|
||||||
procedure YInClick(Sender: TObject);
|
procedure YInClick(Sender: TObject);
|
||||||
procedure YOutClick(Sender: TObject);
|
procedure YOutClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
|
||||||
FAutoSized: Boolean;
|
protected
|
||||||
procedure UpdateBtnStates;
|
procedure AdjustConstraints; override;
|
||||||
|
procedure Compute; override;
|
||||||
|
procedure UpdateBtnStates; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
{ public declarations }
|
procedure Reset; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
SpearmanFrm: TSpearmanFrm;
|
SpearmanFrm: TSpearmanFrm;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Math, MathUnit;
|
Math, MathUnit;
|
||||||
|
|
||||||
{ TSpearmanFrm }
|
{ TSpearmanFrm }
|
||||||
|
|
||||||
procedure TSpearmanFrm.ResetBtnClick(Sender: TObject);
|
procedure TSpearmanFrm.AdjustConstraints;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
ParamsPanel.Constraints.MinWidth := 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left;
|
||||||
|
ParamsPanel.Constraints.MinHeight := YOut.Top + YOut.Height +
|
||||||
|
VarList.BorderSpacing.Bottom + ButtonBevel.Height +
|
||||||
|
CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSpearmanFrm.Compute;
|
||||||
var
|
var
|
||||||
i: integer;
|
index: IntDyneMat = nil;
|
||||||
begin
|
Ranks: DblDyneMat = nil;
|
||||||
XEdit.Text := '';
|
X: DblDyneMat;
|
||||||
YEdit.Text := '';
|
d: DblDyneVec = nil;
|
||||||
VarList.Items.Clear;
|
ColNoSelected: IntDyneVec = nil;
|
||||||
for i := 1 to NoVariables do
|
ColLabels: StrDyneVec = nil;
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
i, j, itemp, NoTies, NoSelected: integer;
|
||||||
UpdateBtnStates;
|
col1, col2, NCases: integer;
|
||||||
end;
|
Probability, sumsqrx, sumsqry, Temp, TieSum, Avg, t, SumT, r: double;
|
||||||
|
z, sumdsqr, df: double;
|
||||||
procedure TSpearmanFrm.XInClick(Sender: TObject);
|
cellstring: string;
|
||||||
var
|
VarX, VarY, SDX, SDY, MeanX, MeanY, Rxy: double;
|
||||||
index: integer;
|
lReport: TStrings;
|
||||||
begin
|
|
||||||
index := VarList.ItemIndex;
|
|
||||||
if (index > -1) and (XEdit.Text = '') then
|
|
||||||
begin
|
|
||||||
XEdit.Text := VarList.Items[index];
|
|
||||||
VarList.Items.Delete(index);
|
|
||||||
end;
|
|
||||||
UpdateBtnStates;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.XOutClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
if XEdit.Text <> '' then
|
|
||||||
begin
|
|
||||||
VarList.Items.Add(XEdit.Text);
|
|
||||||
XEdit.Text := '';
|
|
||||||
end;
|
|
||||||
UpdateBtnStates;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.YInClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
index: integer;
|
|
||||||
begin
|
|
||||||
index := VarList.ItemIndex;
|
|
||||||
if (index > -1) and (YEdit.Text = '') then
|
|
||||||
begin
|
|
||||||
YEdit.Text := VarList.Items[index];
|
|
||||||
VarList.Items.Delete(index);
|
|
||||||
end;
|
|
||||||
UpdateBtnStates;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.YOutClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
if YEdit.Text <> '' then
|
|
||||||
begin
|
|
||||||
VarList.Items.Add(YEdit.Text);
|
|
||||||
YEdit.Text := '';
|
|
||||||
end;
|
|
||||||
UpdateBtnStates;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.FormShow(Sender: TObject);
|
|
||||||
begin
|
|
||||||
ResetBtnClick(self);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.ComputeBtnClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
i, j, itemp, NoTies, NoSelected : integer;
|
|
||||||
col1, col2, NCases : integer;
|
|
||||||
index : IntDyneMat;
|
|
||||||
Probability, sumsqrx, sumsqry, Temp, TieSum, Avg, t, SumT, r : double;
|
|
||||||
z, sumdsqr, df : double;
|
|
||||||
Ranks, X : DblDyneMat;
|
|
||||||
d : DblDyneVec;
|
|
||||||
cellstring: string;
|
|
||||||
ColNoSelected : IntDyneVec;
|
|
||||||
ColLabels : StrDyneVec;
|
|
||||||
VarX, VarY, SDX, SDY, MeanX, MeanY, Rxy : double;
|
|
||||||
lReport: TStrings;
|
|
||||||
begin
|
begin
|
||||||
if (XEdit.Text = '') then begin
|
if (XEdit.Text = '') then begin
|
||||||
MessageDlg('X variable is not selected.', mtError, [mbOK], 0);
|
MessageDlg('X variable is not selected.', mtError, [mbOK], 0);
|
||||||
@ -413,58 +360,115 @@ begin
|
|||||||
lReport.Add('Mean X Variance X Std.Dev. X Mean Y Variance Y Std.Dev. Y');
|
lReport.Add('Mean X Variance X Std.Dev. X Mean Y Variance Y Std.Dev. Y');
|
||||||
lReport.Add('%8.2f %8.2f %8.2f %8.2f %8.2f %8.2f', [MeanX, VarX, SDX, MeanY, VarY, SDY]);
|
lReport.Add('%8.2f %8.2f %8.2f %8.2f %8.2f %8.2f', [MeanX, VarX, SDX, MeanY, VarY, SDY]);
|
||||||
|
|
||||||
DisplayReport(lReport);
|
FReportFrame.DisplayReport(lReport);
|
||||||
|
|
||||||
finally
|
finally
|
||||||
lReport.Free;
|
lReport.Free;
|
||||||
|
|
||||||
ColLabels := nil;
|
|
||||||
d := nil;
|
|
||||||
X := nil;
|
|
||||||
Ranks := nil;
|
|
||||||
index := nil;
|
|
||||||
ColNoSelected := nil;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpearmanFrm.FormActivate(Sender: TObject);
|
|
||||||
|
procedure TSpearmanFrm.Reset;
|
||||||
var
|
var
|
||||||
w: Integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if FAutoSized then
|
inherited;
|
||||||
exit;
|
|
||||||
|
|
||||||
w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
XEdit.Text := '';
|
||||||
ResetBtn.Constraints.MinWidth := w;
|
YEdit.Text := '';
|
||||||
ComputeBtn.Constraints.MinWidth := w;
|
VarList.Items.Clear;
|
||||||
CloseBtn.Constraints.MinWidth := w;
|
for i := 1 to NoVariables do
|
||||||
|
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||||
|
|
||||||
Constraints.MinWidth := 4*w;
|
UpdateBtnStates;
|
||||||
Constraints.MinHeight := Height;
|
|
||||||
|
|
||||||
FAutoSized := true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpearmanFrm.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Assert(OS3MainFrm <> nil);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.UpdateBtnStates;
|
procedure TSpearmanFrm.UpdateBtnStates;
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
XIn.Enabled := (VarList.Count > 0) and (XEdit.Text = '');
|
XIn.Enabled := (VarList.Count > 0) and (XEdit.Text = '');
|
||||||
YIn.Enabled := (Varlist.Count > 0) and (YEdit.Text = '');
|
YIn.Enabled := (Varlist.Count > 0) and (YEdit.Text = '');
|
||||||
XOut.Enabled := XEdit.Text <> '';
|
XOut.Enabled := XEdit.Text <> '';
|
||||||
YOut.Enabled := YEdit.Text <> '';
|
YOut.Enabled := YEdit.Text <> '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TSpearmanFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
procedure TSpearmanFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||||
begin
|
begin
|
||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
|
||||||
{$I spearmanunit.lrs}
|
procedure TSpearmanFrm.VarListDblClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
index: Integer;
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
index := VarList.ItemIndex;
|
||||||
|
if index > -1 then
|
||||||
|
begin
|
||||||
|
s := VarList.Items[index];
|
||||||
|
if XEdit.Text = '' then
|
||||||
|
XEdit.Text := s
|
||||||
|
else if YEdit.Text = '' then
|
||||||
|
YEdit.Text := s;
|
||||||
|
VarList.Items.Delete(index);
|
||||||
|
UpdateBtnStates;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSpearmanFrm.XInClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
index: integer;
|
||||||
|
begin
|
||||||
|
index := VarList.ItemIndex;
|
||||||
|
if (index > -1) and (XEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
XEdit.Text := VarList.Items[index];
|
||||||
|
VarList.Items.Delete(index);
|
||||||
|
end;
|
||||||
|
UpdateBtnStates;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSpearmanFrm.XOutClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if XEdit.Text <> '' then
|
||||||
|
begin
|
||||||
|
VarList.Items.Add(XEdit.Text);
|
||||||
|
XEdit.Text := '';
|
||||||
|
end;
|
||||||
|
UpdateBtnStates;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSpearmanFrm.YInClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
index: integer;
|
||||||
|
begin
|
||||||
|
index := VarList.ItemIndex;
|
||||||
|
if (index > -1) and (YEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
YEdit.Text := VarList.Items[index];
|
||||||
|
VarList.Items.Delete(index);
|
||||||
|
end;
|
||||||
|
UpdateBtnStates;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSpearmanFrm.YOutClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if YEdit.Text <> '' then
|
||||||
|
begin
|
||||||
|
VarList.Items.Add(YEdit.Text);
|
||||||
|
YEdit.Text := '';
|
||||||
|
end;
|
||||||
|
UpdateBtnStates;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user