LazStats: Inherit SensUnit from TBasicStatsReportAndChartForm. Change layout to be similar that of to the other forms.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7833 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-11-01 00:18:38 +00:00
parent 8b234a114e
commit 67a0005f1a
4 changed files with 382 additions and 412 deletions

View File

@ -67,3 +67,4 @@ correlation, means, standard deviations and confidence interval for each correla
163=The Resistant Line procedure creates three equal groups by sorting on the X variable and obtaining the median value of each group.\n\nThe median values for these three groups on both the X and Y variables are then plotted. The line from the low group median to the middle group median is plotted as well as the line from the middle group to the top group median. A comparison of the slope of these two lines gives an indication of the degree to which the data fit a straight line. Enter the X and Y variables to be analyzed and click the compute button. 163=The Resistant Line procedure creates three equal groups by sorting on the X variable and obtaining the median value of each group.\n\nThe median values for these three groups on both the X and Y variables are then plotted. The line from the low group median to the middle group median is plotted as well as the line from the middle group to the top group median. A comparison of the slope of these two lines gives an indication of the degree to which the data fit a straight line. Enter the X and Y variables to be analyzed and click the compute button.
164=This procedure smooths data by averaging every three data points starting with the first three to the last three. The data smoothing can be repeated multiple times. The first and last data points are unchanged. 164=This procedure smooths data by averaging every three data points starting with the first three to the last three. The data smoothing can be repeated multiple times. The first and last data points are unchanged.
165=This is a test for the randomness of a series of values in a variable. Select the variable to analyze and click the Compute button. 165=This is a test for the randomness of a series of values in a variable. Select the variable to analyze and click the Compute button.
166=Sens method for the detection and estimation of trents is used to analyze one or more variable observations collected at equally spaced intervals of time.\nFirst, select one or more series variables to analyze.\nNext, if you have entered more than one variable, indicate how the measures are to be combined (mean or median) and if the values are to be standardized (z scores with mean of 0 and standard deviation of 1.)\nFinally, select the options desired and click the compute button to complete the analysis.

View File

@ -1,62 +1,168 @@
object SensForm: TSensForm inherited SensForm: TSensForm
Left = 288 Left = 414
Height = 579 Height = 416
Top = 161 Top = 163
Width = 478 Width = 936
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/SensSlopeAnalysis.htm' HelpKeyword = 'html/SensSlopeAnalysis.htm'
AutoSize = True
Caption = 'Sens Trend Analysis' Caption = 'Sens Trend Analysis'
ClientHeight = 579 ClientHeight = 416
ClientWidth = 478 ClientWidth = 936
OnActivate = FormActivate inherited ParamsPanel: TPanel
OnCreate = FormCreate Height = 400
OnShow = ResetBtnClick Width = 344
Position = poMainFormCenter ClientHeight = 400
LCLVersion = '2.1.0.0' ClientWidth = 344
object GroupBox1: TGroupBox inherited CloseBtn: TButton
AnchorSideTop.Control = Memo1 Left = 289
Top = 375
end
inherited ComputeBtn: TButton
Left = 205
Top = 375
end
inherited ResetBtn: TButton
Left = 143
Top = 375
end
inherited HelpBtn: TButton
Tag = 166
Left = 84
Top = 375
end
inherited ButtonBevel: TBevel
Top = 359
Width = 344
end
object Label2: TLabel[5]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = ParamsPanel
Left = 0
Height = 15
Top = 0
Width = 100
Caption = 'Available Variables:'
ParentColor = False
end
object VarList: TListBox[6]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = InBtn AnchorSideRight.Control = AllBtn
Left = 43 AnchorSideBottom.Control = GroupBox1
Height = 72 Left = 0
Top = 129 Height = 162
Width = 182 Top = 17
Anchors = [akTop, akRight] Width = 146
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 2
BorderSpacing.Right = 6
BorderSpacing.Bottom = 12
ItemHeight = 0
MultiSelect = True
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange
TabOrder = 4
end
object InBtn: TBitBtn[7]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 159
Height = 26
Top = 17
Width = 26
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = InBtnClick
Spacing = 0
TabOrder = 5
end
object OutBtn: TBitBtn[8]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = InBtn
AnchorSideTop.Side = asrBottom
Left = 159
Height = 26
Top = 47
Width = 26
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = OutBtnClick
Spacing = 0
TabOrder = 6
end
object AllBtn: TBitBtn[9]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = OutBtn
AnchorSideTop.Side = asrBottom
Left = 152
Height = 25
Top = 89
Width = 40
AutoSize = True AutoSize = True
BorderSpacing.Top = 16 BorderSpacing.Top = 16
Caption = 'If more than one variable:' Caption = 'All'
OnClick = AllBtnClick
Spacing = 0
TabOrder = 7
end
object GroupBox3: TGroupBox[10]
AnchorSideTop.Control = GroupBox1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = InBtn
AnchorSideBottom.Control = ButtonBevel
Left = 35
Height = 101
Top = 254
Width = 124
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 12
BorderSpacing.Bottom = 4
Caption = 'Report'
ChildSizing.LeftRightSpacing = 12 ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6 ChildSizing.TopBottomSpacing = 8
ChildSizing.VerticalSpacing = 2 ChildSizing.VerticalSpacing = 4
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ClientHeight = 52 ClientHeight = 81
ClientWidth = 178 ClientWidth = 120
TabOrder = 0 TabOrder = 8
object StandardizeChk: TCheckBox object PrtDataChk: TCheckBox
Left = 12 Left = 12
Height = 19 Height = 19
Top = 6 Top = 8
Width = 154 Width = 96
Caption = 'Standardize the measures' Caption = 'Data'
TabOrder = 0 TabOrder = 0
end end
object AvgSlopeChk: TCheckBox object PrtSlopesChk: TCheckBox
Left = 12 Left = 12
Height = 19 Height = 19
Top = 27 Top = 31
Width = 154 Width = 96
Caption = 'Calculate Average Slope' Caption = 'Slopes Matrix'
TabOrder = 1 TabOrder = 1
end end
object PrtRanksChk: TCheckBox
Left = 12
Height = 19
Top = 54
Width = 96
Caption = 'Ranked Slopes'
TabOrder = 2
end end
object GroupBox2: TGroupBox end
object GroupBox2: TGroupBox[11]
AnchorSideLeft.Control = InBtn AnchorSideLeft.Control = InBtn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox1 AnchorSideTop.Control = GroupBox3
Left = 253 Left = 185
Height = 72 Height = 72
Top = 129 Top = 254
Width = 124 Width = 124
AutoSize = True AutoSize = True
Caption = 'Plot' Caption = 'Plot'
@ -66,7 +172,7 @@ object SensForm: TSensForm
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ClientHeight = 52 ClientHeight = 52
ClientWidth = 120 ClientWidth = 120
TabOrder = 1 TabOrder = 9
object PlotChk: TCheckBox object PlotChk: TCheckBox
Left = 12 Left = 12
Height = 19 Height = 19
@ -84,268 +190,111 @@ object SensForm: TSensForm
TabOrder = 1 TabOrder = 1
end end
end end
object GroupBox3: TGroupBox object GroupBox1: TGroupBox[12]
AnchorSideLeft.Control = GroupBox1 AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = GroupBox1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = InBtn AnchorSideRight.Control = InBtn
Left = 43 AnchorSideBottom.Control = GroupBox2
Height = 93 Left = 0
Top = 217 Height = 51
Width = 182 Top = 191
Anchors = [akTop, akLeft, akRight] Width = 341
Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Top = 16 BorderSpacing.Bottom = 12
Caption = 'Print' Caption = 'If more than one variable:'
ChildSizing.LeftRightSpacing = 12 ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6 ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 12
ChildSizing.VerticalSpacing = 2 ChildSizing.VerticalSpacing = 2
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ClientHeight = 73 ChildSizing.ControlsPerLine = 2
ClientWidth = 178 ClientHeight = 31
TabOrder = 2 ClientWidth = 337
object PrtDataChk: TCheckBox TabOrder = 10
object StandardizeChk: TRadioButton
Left = 12 Left = 12
Height = 19 Height = 19
Top = 6 Top = 6
Width = 96 Width = 154
Caption = 'Data' Caption = 'Standardize the measures'
TabOrder = 0 TabOrder = 0
end end
object PrtSlopesChk: TCheckBox object AvgSlopeChk: TRadioButton
Left = 12 Left = 178
Height = 19 Height = 19
Top = 27 Top = 6
Width = 96 Width = 147
Caption = 'Slopes Matrix' Caption = 'Calculate Average Slope'
TabOrder = 1 TabOrder = 1
end end
object PrtRanksChk: TCheckBox
Left = 12
Height = 19
Top = 48
Width = 96
Caption = 'Ranked Slopes'
TabOrder = 2
end end
end object Label1: TLabel[13]
object Label1: TLabel AnchorSideLeft.Control = GroupBox2
AnchorSideLeft.Control = InBtn
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AlphaEdit AnchorSideTop.Control = AlphaEdit
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 253 Left = 185
Height = 15 Height = 15
Top = 221 Top = 338
Width = 64 Width = 64
Caption = 'Alpha Level:' Caption = 'Alpha Level:'
ParentColor = False ParentColor = False
end end
object AlphaEdit: TEdit object AlphaEdit: TEdit[14]
AnchorSideLeft.Control = Label1 AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox3 AnchorSideTop.Control = GroupBox2
Left = 325 AnchorSideTop.Side = asrBottom
Left = 257
Height = 23 Height = 23
Top = 217 Top = 334
Width = 47 Width = 47
Alignment = taRightJustify Alignment = taRightJustify
BorderSpacing.Left = 8 BorderSpacing.Left = 8
TabOrder = 3 BorderSpacing.Top = 8
TabOrder = 11
Text = '0.05' Text = '0.05'
end end
object Label2: TLabel object Label3: TLabel[15]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = GroupBox3
AnchorSideTop.Side = asrBottom
Left = 8
Height = 15
Top = 318
Width = 100
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Available Variables:'
ParentColor = False
end
object VarList: TListBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = AllBtn
AnchorSideBottom.Control = Bevel1
Left = 8
Height = 200
Top = 335
Width = 200
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 2
BorderSpacing.Right = 8
Constraints.MinHeight = 200
ItemHeight = 0
MultiSelect = True
OnSelectionChange = VarListSelectionChange
TabOrder = 4
end
object InBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 225
Height = 28
Top = 335
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = InBtnClick
Spacing = 0
TabOrder = 5
end
object OutBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = InBtn
AnchorSideTop.Side = asrBottom
Left = 225
Height = 28
Top = 367
Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = OutBtnClick
Spacing = 0
TabOrder = 6
end
object AllBtn: TBitBtn
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = OutBtn
AnchorSideTop.Side = asrBottom
Left = 216
Height = 25
Top = 411
Width = 46
AutoSize = True
BorderSpacing.Top = 16
Caption = 'ALL'
OnClick = AllBtnClick
Spacing = 0
TabOrder = 7
end
object Label3: TLabel
AnchorSideLeft.Control = SelectedList AnchorSideLeft.Control = SelectedList
AnchorSideTop.Control = Label2 AnchorSideTop.Control = Label2
Left = 270 Left = 198
Height = 15 Height = 15
Top = 318 Top = 0
Width = 107 Width = 107
Caption = 'Variables to Analyze:' Caption = 'Variables to Analyze:'
ParentColor = False ParentColor = False
end end
object SelectedList: TListBox object SelectedList: TListBox[16]
AnchorSideLeft.Control = AllBtn AnchorSideLeft.Control = AllBtn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label3 AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Bevel1 AnchorSideBottom.Control = VarList
Left = 270 AnchorSideBottom.Side = asrBottom
Height = 195 Left = 198
Top = 335 Height = 162
Width = 200 Top = 17
Width = 146
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 6
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 8
ItemHeight = 0 ItemHeight = 0
MultiSelect = True MultiSelect = True
OnDblClick = SelectedListDblClick
OnSelectionChange = VarListSelectionChange OnSelectionChange = VarListSelectionChange
TabOrder = 8 TabOrder = 12
end end
object ResetBtn: TButton
AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 269
Height = 25
Top = 546
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 9
end end
object ComputeBtn: TButton inherited ParamsSplitter: TSplitter
AnchorSideRight.Control = CloseBtn Left = 356
AnchorSideBottom.Control = Owner Height = 416
AnchorSideBottom.Side = asrBottom
Left = 331
Height = 25
Top = 546
Width = 76
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 10
end end
object CloseBtn: TButton inherited PageControl: TPageControl
AnchorSideRight.Control = Owner Left = 365
AnchorSideRight.Side = asrBottom Height = 400
AnchorSideBottom.Control = Owner Width = 563
AnchorSideBottom.Side = asrBottom
Left = 415
Height = 25
Top = 546
Width = 55
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Close'
ModalResult = 11
TabOrder = 11
end
object Memo1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 105
Top = 8
Width = 462
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Sens method for the detection and estimation of trents is used to analyze one or more variable observations collected at equally spaced intervals of time. First, select one or more series variables to analyze. Next, if you have entered more than one variable, indicate how the measures are to be combined (mean or median) and if the values are to be standardized '#13#10'(z scores with mean of 0 and standard deviation of 1.) Finally, select the options desired and click the compute button to complete the analysis.'
ParentColor = False
WordWrap = True
end
object Bevel1: TBevel
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn
Left = 0
Height = 8
Top = 530
Width = 478
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
end end
end end

View File

@ -9,29 +9,26 @@ unit SensUnit;
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, ComCtrls,
MainUnit, Globals, FunctionsLib, OutputUnit, MainUnit, Globals, FunctionsLib,
ContextHelpUnit, MatrixLib, GraphLib; ContextHelpUnit, MatrixLib, GraphLib, BasicStatsReportAndChartFormUnit;
type type
{ TSensForm } { TSensForm }
TSensForm = class(TForm) TSensForm = class(TBasicStatsReportAndChartForm)
AllBtn: TBitBtn; AllBtn: TBitBtn;
AlphaEdit: TEdit; AlphaEdit: TEdit;
Bevel1: TBevel; AvgSlopeChk: TRadioButton;
Memo1: TLabel;
ResetBtn: TButton;
ComputeBtn: TButton;
CloseBtn: TButton;
InBtn: TBitBtn; InBtn: TBitBtn;
Label1: TLabel; Label1: TLabel;
Label2: TLabel; Label2: TLabel;
Label3: TLabel; Label3: TLabel;
SelectedList: TListBox; SelectedList: TListBox;
OutBtn: TBitBtn; OutBtn: TBitBtn;
StandardizeChk: TRadioButton;
VarList: TListBox; VarList: TListBox;
PrtRanksChk: TCheckBox; PrtRanksChk: TCheckBox;
PrtSlopesChk: TCheckBox; PrtSlopesChk: TCheckBox;
@ -40,23 +37,23 @@ type
SlopesChk: TCheckBox; SlopesChk: TCheckBox;
PlotChk: TCheckBox; PlotChk: TCheckBox;
GroupBox2: TGroupBox; GroupBox2: TGroupBox;
StandardizeChk: TCheckBox;
AvgSlopeChk: TCheckBox;
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
procedure AllBtnClick(Sender: TObject); procedure AllBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure InBtnClick(Sender: TObject); procedure InBtnClick(Sender: TObject);
procedure OutBtnClick(Sender: TObject); procedure OutBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject); procedure SelectedListDblClick(Sender: TObject);
procedure VarListDblClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
private private
{ private declarations }
FAutoSized: Boolean; protected
procedure UpdateBtnStates; procedure AdjustConstraints; override;
procedure Compute; override;
procedure UpdateBtnStates; override;
public public
{ public declarations } constructor Create(AOwner: TComponent); override;
procedure Reset; override;
end; end;
var var
@ -65,16 +62,52 @@ var
implementation implementation
{$R *.lfm}
uses uses
Math, Math,
Utils, MatrixUnit; Utils, MatrixUnit;
{ TSensForm } { TSensForm }
procedure TSensForm.ResetBtnClick(Sender: TObject); constructor TSensForm.Create(AOwner: TComponent);
begin
inherited;
if GraphFrm = nil then
Application.CreateForm(TGraphFrm, GraphFrm);
end;
procedure TSensForm.AdjustConstraints;
begin
inherited;
ParamsPanel.Constraints.MinWidth := Max(
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
GroupBox1.Width
);
ParamsPanel.Constraints.MinHeight := AllBtn.Top + AllBtn.Height +
VarList.BorderSpacing.Bottom + GroupBox1.Height + GroupBox1.BorderSpacing.Bottom +
GroupBox3.Height + GroupBox3.BorderSpacing.Bottom +
ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
end;
procedure TSensForm.AllBtnClick(Sender: TObject);
var var
i: integer; i: integer;
begin begin
for i := 0 to VarList.Items.Count-1 do
SelectedList.Items.Add(VarList.Items[i]);
VarList.Clear;
UpdateBtnStates;
end;
procedure TSensForm.Reset;
var
i: integer;
begin
inherited;
AlphaEdit.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL); AlphaEdit.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
StandardizeChk.Checked := false; StandardizeChk.Checked := false;
PlotChk.Checked := false; PlotChk.Checked := false;
@ -87,6 +120,7 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TSensForm.InBtnClick(Sender: TObject); procedure TSensForm.InBtnClick(Sender: TObject);
var var
i: integer; i: integer;
@ -105,17 +139,8 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TSensForm.AllBtnClick(Sender: TObject);
var
i: integer;
begin
for i := 0 to VarList.Items.Count-1 do
SelectedList.Items.Add(VarList.Items[i]);
VarList.Clear;
UpdateBtnStates;
end;
procedure TSensForm.ComputeBtnClick(Sender: TObject); procedure TSensForm.Compute;
var var
//NoVars, //NoVars,
noselected, count, half, q, tp, low, hi, col: integer; noselected, count, half, q, tp, low, hi, col: integer;
@ -538,45 +563,13 @@ begin
lReport.Add('Corresponding lower and upper slopes: (%8.3f, %8.3f)', [RankedQ[low],RankedQ[hi]]); lReport.Add('Corresponding lower and upper slopes: (%8.3f, %8.3f)', [RankedQ[low],RankedQ[hi]]);
end; // end if average slope end; // end if average slope
DisplayReport(lReport); FReportFrame.DisplayReport(lReport);
finally finally
lReport.Free; lReport.Free;
AvgSlopes := nil;
Sorted := nil;
RankedQ := nil;
Slopes := nil;
Values := nil;
selected := nil;
ColLabels := nil;
RowLabels := nil;
end; end;
end; end;
procedure TSensForm.FormActivate(Sender: TObject);
var
w: Integer;
begin
if FAutoSized then
exit;
w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
ResetBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w;
CloseBtn.Constraints.MinWidth := w;
Constraints.MinWidth := Width;
Constraints.MinHeight := Height;
FAutoSized := true;
end;
procedure TSensForm.FormCreate(Sender: TObject);
begin
Assert(OS3MainFrm <> nil);
if GraphFrm = nil then
Application.CreateForm(TGraphFrm, GraphFrm);
end;
procedure TSensForm.OutBtnClick(Sender: TObject); procedure TSensForm.OutBtnClick(Sender: TObject);
var var
@ -596,20 +589,47 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TSensForm.SelectedListDblClick(Sender: TObject);
var
index: Integer;
begin
index := SelectedList.ItemIndex;
if index > -1 then
begin
VarList.Items.Add(SelectedList.Items[index]);
SelectedList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TSensForm.UpdateBtnStates; procedure TSensForm.UpdateBtnStates;
begin begin
inherited;
InBtn.Enabled := AnySelected(VarList); InBtn.Enabled := AnySelected(VarList);
OutBtn.Enabled := AnySelected(SelectedList); OutBtn.Enabled := AnySelected(SelectedList);
AllBtn.Enabled := Varlist.Items.Count > 0; AllBtn.Enabled := Varlist.Items.Count > 0;
end; end;
procedure TSensForm.VarListDblClick(Sender: TObject);
var
index: Integer;
begin
index := VarList.ItemIndex;
if index > -1 then
begin
SelectedList.Items.Add(VarList.Items[index]);
VarList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TSensForm.VarListSelectionChange(Sender: TObject; User: boolean); procedure TSensForm.VarListSelectionChange(Sender: TObject; User: boolean);
begin begin
UpdateBtnStates; UpdateBtnStates;
end; end;
initialization
{$I sensunit.lrs}
end. end.

View File

@ -1844,7 +1844,7 @@ procedure TOS3MainFrm.mnuAnalysisNonPar_SignTestClick(Sender: TObject);
begin begin
if SignTestFrm = nil then if SignTestFrm = nil then
Application.CreateForm(TSignTestFrm, SignTestFrm); Application.CreateForm(TSignTestFrm, SignTestFrm);
SignTestFrm.ShowModal; SignTestFrm.Show;
end; end;
// Menu "Analysis" > "Nonparametric" > "Friedman Two-Way mnuAnalysisComp_Anova" // Menu "Analysis" > "Nonparametric" > "Friedman Two-Way mnuAnalysisComp_Anova"
@ -1852,7 +1852,7 @@ procedure TOS3MainFrm.mnuAnalysisNonPar_FriedmanClick(Sender: TObject);
begin begin
if FriedmanFrm = nil then if FriedmanFrm = nil then
Application.CreateForm(TFriedmanFrm, FriedmanFrm); Application.CreateForm(TFriedmanFrm, FriedmanFrm);
FriedmanFrm.ShowModal; FriedmanFrm.Show;
end; end;
// Menu "Analysis" > "Nonparametric" > "Probability of a Binomial Event" // Menu "Analysis" > "Nonparametric" > "Probability of a Binomial Event"
@ -1900,7 +1900,7 @@ procedure TOS3MainFrm.mnuAnalysisNonPar_SensClick(Sender: TObject);
begin begin
if SensForm = nil then if SensForm = nil then
Application.CreateForm(TSensForm, SensForm); Application.CreateForm(TSensForm, SensForm);
SensForm.ShowModal; SensForm.Show;
end; end;
// Menu "Analysis" > "Nonparametric" > "Simple Chi Square for Categories" // Menu "Analysis" > "Nonparametric" > "Simple Chi Square for Categories"