LazStats: Inherit SRHTestUnit from TBasicStatsReportAndChartForm. Move on-form help to LazStats.hlp.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7836 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-11-01 23:04:21 +00:00
parent 2782723bca
commit 5c9302493f
5 changed files with 406 additions and 506 deletions

View File

@ -68,3 +68,4 @@ correlation, means, standard deviations and confidence interval for each correla
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. 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.
167=Notes: This is a non-parametric analysis of ordinal data.\nIt is similar to a two-way Analysis of Variance but utilizes a chi-square statistic (H) for determining the significance of the row, column and interaction effects. The dependent value, if not initially rank data, may be obtained first by creating a new variable with the "transformation" procedure available under the "Variables" menu. The output of this procedure contains the results both of a "traditional" 2-way ANOVA as well as the SRH results.\nIt should be noted that the power of the SRH analysis is less than that of the traditional ANOVA. It is suggested that there be at least 5 or more cases in each cell and that the design is a balanced design of fixed levels.\nThe H statistic is obtained as the division of the sum of squares for an effect by the mean square of the total and the test is performed by a chi-squared probability with the degrees of freedom equal to the SS of the effect being tested.

View File

@ -1281,7 +1281,7 @@
<Unit147> <Unit147>
<Filename Value="forms\analysis\nonparametric\srhtestunit.pas"/> <Filename Value="forms\analysis\nonparametric\srhtestunit.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="SRHTest"/> <ComponentName Value="SRHTestForm"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="SRHTestUnit"/> <UnitName Value="SRHTestUnit"/>

View File

@ -1,132 +1,148 @@
object SRHTest: TSRHTest inherited SRHTestForm: TSRHTestForm
Left = 654 Left = 1013
Height = 631 Height = 442
Top = 147 Top = 293
Width = 471 Width = 814
AutoSize = True
Caption = 'Scheirer-Ray-Hare Test' Caption = 'Scheirer-Ray-Hare Test'
ClientHeight = 631 ClientHeight = 442
ClientWidth = 471 ClientWidth = 814
OnActivate = FormActivate inherited ParamsPanel: TPanel
OnCreate = FormCreate Height = 426
OnShow = ResetBtnClick Width = 378
LCLVersion = '2.1.0.0' ClientHeight = 426
object Label1: TLabel ClientWidth = 378
AnchorSideLeft.Control = Owner inherited CloseBtn: TButton
AnchorSideTop.Control = Memo1 Left = 323
AnchorSideTop.Side = asrBottom Top = 401
Left = 8 end
inherited ComputeBtn: TButton
Left = 239
Top = 401
end
inherited ResetBtn: TButton
Left = 177
Top = 401
end
inherited HelpBtn: TButton
Tag = 167
Left = 118
Top = 401
end
inherited ButtonBevel: TBevel
Top = 385
Width = 378
end
object Label1: TLabel[5]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = ParamsPanel
Left = 0
Height = 15 Height = 15
Top = 204 Top = 0
Width = 49 Width = 49
BorderSpacing.Left = 8
BorderSpacing.Top = 16
Caption = 'Variables:' Caption = 'Variables:'
ParentColor = False ParentColor = False
end end
object VarList: TListBox object VarList: TListBox[6]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = Label1 AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Fact1In AnchorSideRight.Control = Fact1In
AnchorSideBottom.Control = ButtonBevel AnchorSideBottom.Control = ButtonBevel
Left = 8 Left = 0
Height = 361 Height = 368
Top = 221 Top = 17
Width = 205 Width = 168
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 8 BorderSpacing.Right = 8
ItemHeight = 0 ItemHeight = 0
TabOrder = 0 TabOrder = 4
end end
object DepIn: TBitBtn object DepIn: TBitBtn[7]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList AnchorSideTop.Control = VarList
Left = 221 Left = 176
Height = 28 Height = 26
Top = 221 Top = 17
Width = 28 Width = 26
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 1 ImageIndex = 1
OnClick = DepInClick OnClick = DepInClick
Spacing = 0 Spacing = 0
TabOrder = 1 TabOrder = 5
end end
object StaticText1: TStaticText object StaticText1: TStaticText[8]
AnchorSideLeft.Control = DepIn AnchorSideLeft.Control = DepIn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideBottom.Control = DepVar AnchorSideBottom.Control = DepVar
Left = 257 Left = 210
Height = 16 Height = 16
Top = 228 Top = 20
Width = 103 Width = 103
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Bottom = 2 BorderSpacing.Bottom = 2
Caption = 'Dependent Variable' Caption = 'Dependent Variable'
TabOrder = 3 TabOrder = 6
end end
object DepVar: TEdit object DepVar: TEdit[9]
AnchorSideLeft.Control = DepIn AnchorSideLeft.Control = DepIn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = DepOut AnchorSideBottom.Control = DepOut
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 257 Left = 210
Height = 23 Height = 23
Top = 246 Top = 38
Width = 206 Width = 168
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12 BorderSpacing.Bottom = 12
TabOrder = 4 TabOrder = 7
Text = 'DepVar' Text = 'DepVar'
end end
object Fact1In: TBitBtn object Fact1In: TBitBtn[10]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepOut AnchorSideTop.Control = DepOut
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 28 Height = 26
Top = 301 Top = 93
Width = 28 Width = 26
BorderSpacing.Top = 20 BorderSpacing.Top = 20
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 1 ImageIndex = 1
OnClick = Fact1InClick OnClick = Fact1InClick
Spacing = 0 Spacing = 0
TabOrder = 5 TabOrder = 8
end end
object StaticText2: TStaticText object StaticText2: TStaticText[11]
AnchorSideLeft.Control = Factor1 AnchorSideLeft.Control = Factor1
AnchorSideBottom.Control = Factor1 AnchorSideBottom.Control = Factor1
Left = 257 Left = 210
Height = 16 Height = 16
Top = 308 Top = 96
Width = 87 Width = 87
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Bottom = 2 BorderSpacing.Bottom = 2
Caption = 'Factor 1 Variable' Caption = 'Factor 1 Variable'
TabOrder = 7 TabOrder = 9
end end
object GroupBox2: TGroupBox object GroupBox2: TGroupBox[12]
AnchorSideLeft.Control = Fact1In AnchorSideLeft.Control = Fact1In
AnchorSideTop.Control = Fact2Out AnchorSideTop.Control = OverallAlpha
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 93 Height = 93
Top = 457 Top = 288
Width = 187 Width = 187
AutoSize = True AutoSize = True
BorderSpacing.Top = 16 BorderSpacing.Top = 20
Caption = 'Options' Caption = 'Options'
ChildSizing.LeftRightSpacing = 12 ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6 ChildSizing.TopBottomSpacing = 6
@ -135,7 +151,7 @@ object SRHTest: TSRHTest
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 73 ClientHeight = 73
ClientWidth = 183 ClientWidth = 183
TabOrder = 13 TabOrder = 10
object PlotMeans: TCheckBox object PlotMeans: TCheckBox
Left = 12 Left = 12
Height = 19 Height = 19
@ -161,261 +177,152 @@ object SRHTest: TSRHTest
TabOrder = 2 TabOrder = 2
end end
end end
object Label3: TLabel object Label3: TLabel[13]
AnchorSideLeft.Control = GroupBox2 AnchorSideLeft.Control = Fact2Out
AnchorSideTop.Control = OverallAlpha AnchorSideTop.Control = OverallAlpha
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 229 Left = 176
Height = 15 Height = 15
Top = 562 Top = 249
Width = 147 Width = 147
BorderSpacing.Left = 8
Caption = 'Alpha Level for Overall Tests' Caption = 'Alpha Level for Overall Tests'
ParentColor = False ParentColor = False
end end
object HelpBtn: TButton object Factor1: TEdit[14]
Tag = 107
AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 107
Height = 25
Top = 598
Width = 51
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 15
end
object Factor1: TEdit
AnchorSideLeft.Control = Fact1In AnchorSideLeft.Control = Fact1In
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Fact1Out AnchorSideTop.Control = Fact1Out
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Fact1Out AnchorSideBottom.Control = Fact1Out
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 257 Left = 210
Height = 23 Height = 23
Top = 326 Top = 114
Width = 206 Width = 168
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12 BorderSpacing.Bottom = 12
TabOrder = 8 TabOrder = 11
Text = 'Edit1' Text = 'Edit1'
end end
object DepOut: TBitBtn object DepOut: TBitBtn[15]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = DepIn AnchorSideTop.Control = DepIn
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 28 Height = 26
Top = 253 Top = 47
Width = 28 Width = 26
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 0 ImageIndex = 0
OnClick = DepOutClick OnClick = DepOutClick
Spacing = 0 Spacing = 0
TabOrder = 2 TabOrder = 12
end end
object Fact1Out: TBitBtn object Fact1Out: TBitBtn[16]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Fact1In AnchorSideTop.Control = Fact1In
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 28 Height = 26
Top = 333 Top = 123
Width = 28 Width = 26
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 0 ImageIndex = 0
OnClick = Fact1OutClick OnClick = Fact1OutClick
Spacing = 0 Spacing = 0
TabOrder = 6 TabOrder = 13
end end
object Fact2In: TBitBtn object Fact2In: TBitBtn[17]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Fact1Out AnchorSideTop.Control = Fact1Out
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 28 Height = 26
Top = 381 Top = 169
Width = 28 Width = 26
BorderSpacing.Top = 20 BorderSpacing.Top = 20
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 1 ImageIndex = 1
OnClick = Fact2InClick OnClick = Fact2InClick
Spacing = 0 Spacing = 0
TabOrder = 9 TabOrder = 14
end end
object Fact2Out: TBitBtn object Fact2Out: TBitBtn[18]
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Fact2In AnchorSideTop.Control = Fact2In
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 221 Left = 176
Height = 28 Height = 26
Top = 413 Top = 199
Width = 28 Width = 26
BorderSpacing.Top = 4 BorderSpacing.Top = 4
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 0 ImageIndex = 0
OnClick = Fact2OutClick OnClick = Fact2OutClick
Spacing = 0 Spacing = 0
TabOrder = 10 TabOrder = 15
end end
object StaticText3: TStaticText object StaticText3: TStaticText[19]
AnchorSideLeft.Control = Factor2 AnchorSideLeft.Control = Factor2
AnchorSideBottom.Control = Factor2 AnchorSideBottom.Control = Factor2
Left = 257 Left = 210
Height = 16 Height = 16
Top = 388 Top = 172
Width = 87 Width = 87
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Bottom = 2 BorderSpacing.Bottom = 2
Caption = 'Factor 2 Variable' Caption = 'Factor 2 Variable'
TabOrder = 11 TabOrder = 16
end end
object Factor2: TEdit object Factor2: TEdit[20]
AnchorSideLeft.Control = Fact2In AnchorSideLeft.Control = Fact2In
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Fact2Out AnchorSideBottom.Control = Fact2Out
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 257 Left = 210
Height = 23 Height = 23
Top = 406 Top = 190
Width = 206 Width = 168
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 12 BorderSpacing.Bottom = 12
TabOrder = 12 TabOrder = 17
Text = 'Edit1' Text = 'Edit1'
end end
object OverallAlpha: TEdit object OverallAlpha: TEdit[21]
AnchorSideLeft.Control = Label3 AnchorSideLeft.Control = Label3
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox2 AnchorSideTop.Control = Fact2Out
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 384 Left = 331
Height = 23 Height = 23
Top = 558 Top = 245
Width = 45 Width = 45
Alignment = taRightJustify Alignment = taRightJustify
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 20
TabOrder = 14 TabOrder = 18
Text = 'OverallAlpha' Text = 'OverallAlpha'
end end
object ResetBtn: TButton
AnchorSideRight.Control = CancelBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 170
Height = 25
Top = 598
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 16
end end
object CancelBtn: TButton inherited ParamsSplitter: TSplitter
AnchorSideRight.Control = ComputeBtn Left = 390
AnchorSideBottom.Control = Owner Height = 442
AnchorSideBottom.Side = asrBottom
Left = 236
Height = 25
Top = 598
Width = 62
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Cancel'
ModalResult = 2
TabOrder = 17
end end
object ComputeBtn: TButton inherited PageControl: TPageControl
AnchorSideRight.Control = ReturnBtn Left = 399
AnchorSideBottom.Control = Owner Height = 426
AnchorSideBottom.Side = asrBottom Width = 407
Left = 310
Height = 25
Top = 598
Width = 76
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 18
end
object ReturnBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 398
Height = 25
Top = 598
Width = 61
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Return'
ModalResult = 1
TabOrder = 19
end
object ButtonBevel: TBevel
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ReturnBtn
Left = 0
Height = 8
Top = 582
Width = 471
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
end
object Memo1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 180
Top = 8
Width = 455
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Notes: This is a non-parametric analysis of ordinal data. It is similar to a two-way Analysis of Variance but utilizes a chi-square statistic (H) for determining the significance of the row, column and interaction effects. The dependent value, if not initially rank data, may be obtained first by creating a new variable with the "transformation" procedure available under the "Variables" menu. The output of this procedure contains the results both of a "traditional" 2-way ANOVA as well as the SRH results. It should be noted that the power of the SRH analysis is less than that of the traditional ANOVA. It is suggested that there be at least 5 or more cases in each cell and that the design is a balanced design of fixed levels. The H statistic is obtained as the division of the sum of squares for an effect by the mean square of the total and the test is performed by a chi-squared probability with the degrees of freedom equal to the SS of the effect being tested.'
ParentColor = False
WordWrap = True
end end
end end

View File

@ -7,17 +7,14 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls, StdCtrls, Buttons, ExtCtrls,
MainUnit, Globals, FunctionsLib, OutputUnit, DataProcs, GraphLib, MainUnit, Globals, FunctionsLib, OutputUnit, DataProcs, GraphLib, BasicStatsReportAndChartFormUnit;
ContextHelpUnit;
type type
{ TSRHTest } { TSRHTestForm }
TSRHTest = class(TForm) TSRHTestForm = class(TBasicStatsReportAndChartForm)
Bevel1: TBevel; Bevel1: TBevel;
CancelBtn: TButton;
ComputeBtn: TButton;
DepIn: TBitBtn; DepIn: TBitBtn;
DepOut: TBitBtn; DepOut: TBitBtn;
DepVar: TEdit; DepVar: TEdit;
@ -28,34 +25,24 @@ type
Factor1: TEdit; Factor1: TEdit;
Factor2: TEdit; Factor2: TEdit;
GroupBox2: TGroupBox; GroupBox2: TGroupBox;
HelpBtn: TButton;
Label1: TLabel; Label1: TLabel;
Label3: TLabel; Label3: TLabel;
Memo1: TLabel;
OverallAlpha: TEdit; OverallAlpha: TEdit;
Plot2DLines: TCheckBox; Plot2DLines: TCheckBox;
Plot3DLines: TCheckBox; Plot3DLines: TCheckBox;
PlotMeans: TCheckBox; PlotMeans: TCheckBox;
ResetBtn: TButton;
ReturnBtn: TButton;
StaticText1: TStaticText; StaticText1: TStaticText;
StaticText2: TStaticText; StaticText2: TStaticText;
StaticText3: TStaticText; StaticText3: TStaticText;
VarList: TListBox; VarList: TListBox;
procedure ComputeBtnClick(Sender: TObject);
procedure DepInClick(Sender: TObject); procedure DepInClick(Sender: TObject);
procedure DepOutClick(Sender: TObject); procedure DepOutClick(Sender: TObject);
procedure Fact1InClick(Sender: TObject); procedure Fact1InClick(Sender: TObject);
procedure Fact1OutClick(Sender: TObject); procedure Fact1OutClick(Sender: TObject);
procedure Fact2InClick(Sender: TObject); procedure Fact2InClick(Sender: TObject);
procedure Fact2OutClick(Sender: TObject); procedure Fact2OutClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure HelpBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject);
private private
{ private declarations }
FAutoSized: boolean;
NoSelected, intvalue, N : integer; NoSelected, intvalue, N : integer;
ColNoSelected : IntDyneVec; ColNoSelected : IntDyneVec;
outline, cellstring : string; outline, cellstring : string;
@ -83,17 +70,23 @@ type
allAlpha : double; // alphas for tests allAlpha : double; // alphas for tests
CompError : boolean; CompError : boolean;
procedure getlevels(Sender : TObject); procedure GetLevels(Sender : TObject);
procedure Calc2Way(Sender: TObject); procedure Calc2Way(Sender: TObject);
procedure TwoWayTable(Sender: TObject); procedure TwoWayTable(Sender: TObject);
procedure TwoWayPlot(Sender: TObject); procedure TwoWayPlot(Sender: TObject);
protected
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
SRHTest: TSRHTest; SRHTestForm: TSRHTestForm;
implementation implementation
@ -102,36 +95,38 @@ implementation
uses uses
Math, MathUnit; Math, MathUnit;
{ TSRHTest } { TSRHTestForm }
procedure TSRHTest.ResetBtnClick(Sender: TObject); constructor TSRHTestForm.Create(AOwner: TComponent);
Var i : integer;
begin begin
VarList.Clear; inherited;
DepIn.Enabled := true;
Fact1In.Enabled := true; if OutputFrm = nil then
Fact2In.Enabled := true; Application.CreateForm(TOutputFrm, OutputFrm);
DepOut.Enabled := false;
Fact1Out.Enabled := false; if GraphFrm = nil then
Fact2Out.Enabled := false; Application.CreateForm(TGraphFrm, GraphFrm);
DepVar.Text := '';
Factor1.Text := '';
Factor2.Text := ''; PageControl.ActivePageIndex := 0;
PlotMeans.Checked := false;
OverAllalpha.Text := '0.05';
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
end; end;
procedure TSRHTest.HelpBtnClick(Sender: TObject);
procedure TSRHTestForm.AdjustConstraints;
begin begin
if ContextHelpForm = nil then inherited;
Application.CreateForm(TContextHelpForm, ContextHelpForm);
ContextHelpForm.HelpMessage((Sender as TButton).tag); ParamsPanel.Constraints.MinWidth := Max(
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
2*(Label3.Width + OverallAlpha.BorderSpacing.Left + OverallAlpha.Width) - Fact1In.Width);
ParamsPanel.Constraints.MinHeight := GroupBox2.Top + GroupBox2.Height +
ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
end; end;
procedure TSRHTest.DepInClick(Sender: TObject);
VAR index : integer; procedure TSRHTestForm.DepInClick(Sender: TObject);
var
index : integer;
begin begin
index := VarList.ItemIndex; index := VarList.ItemIndex;
DepVar.Text := VarList.Items.Strings[index]; DepVar.Text := VarList.Items.Strings[index];
@ -140,8 +135,8 @@ begin
VarList.Items.Delete(index); VarList.Items.Delete(index);
end; end;
procedure TSRHTest.ComputeBtnClick(Sender: TObject); procedure TSRHTestForm.Compute;
Var var
i : integer; i : integer;
Label cleanit; Label cleanit;
label nexttwo; label nexttwo;
@ -244,7 +239,7 @@ cleanit:
ColNoSelected := nil; ColNoSelected := nil;
end; end;
procedure TSRHTest.DepOutClick(Sender: TObject); procedure TSRHTestForm.DepOutClick(Sender: TObject);
begin begin
VarList.Items.Add(DepVar.Text); VarList.Items.Add(DepVar.Text);
DepVar.Text := ''; DepVar.Text := '';
@ -252,7 +247,7 @@ begin
DepIn.Enabled := true; DepIn.Enabled := true;
end; end;
procedure TSRHTest.Fact1InClick(Sender: TObject); procedure TSRHTestForm.Fact1InClick(Sender: TObject);
VAR index : integer; VAR index : integer;
begin begin
index := VarList.ItemIndex; index := VarList.ItemIndex;
@ -263,7 +258,7 @@ begin
VarList.Items.Delete(index); VarList.Items.Delete(index);
end; end;
procedure TSRHTest.Fact1OutClick(Sender: TObject); procedure TSRHTestForm.Fact1OutClick(Sender: TObject);
begin begin
VarList.Items.Add(Factor1.Text); VarList.Items.Add(Factor1.Text);
Factor1.Text := ''; Factor1.Text := '';
@ -271,7 +266,7 @@ begin
Fact1In.Enabled := true; Fact1In.Enabled := true;
end; end;
procedure TSRHTest.Fact2InClick(Sender: TObject); procedure TSRHTestForm.Fact2InClick(Sender: TObject);
VAR index : integer; VAR index : integer;
begin begin
index := VarList.ItemIndex; index := VarList.ItemIndex;
@ -282,7 +277,7 @@ begin
VarList.Items.Delete(index); VarList.Items.Delete(index);
end; end;
procedure TSRHTest.Fact2OutClick(Sender: TObject); procedure TSRHTestForm.Fact2OutClick(Sender: TObject);
begin begin
VarList.Items.Add(Factor2.Text); VarList.Items.Add(Factor2.Text);
Factor2.Text := ''; Factor2.Text := '';
@ -290,42 +285,13 @@ begin
Fact2In.Enabled := true; Fact2In.Enabled := true;
end; end;
procedure TSRHTest.FormActivate(Sender: TObject);
var
w: Integer;
begin
if FAutoSized then
exit;
w := MaxValue([HelpBtn.Width, ResetBtn.Width, CancelBtn.Width, ComputeBtn.Width, ReturnBtn.Width]); procedure TSRHTestForm.GetLevels(Sender: TObject);
HelpBtn.Constraints.MinWidth := w;
ResetBtn.Constraints.MinWidth := w;
CancelBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w;
ReturnBtn.Constraints.MinWidth := w;
VarList.Constraints.MinHeight := OverallAlpha.Top + OverallAlpha.Height - VarList.Top;
Constraints.MinWidth := Width;
Constraints.MinHeight := Height;
FAutoSized := True;
end;
procedure TSRHTest.FormCreate(Sender: TObject);
begin
Assert(OS3MainFrm <> nil);
if OutputFrm = nil then
Application.CreateForm(TOutputFrm, OutputFrm);
if GraphFrm = nil then
Application.CreateForm(TGraphFrm, GraphFrm);
end;
procedure TSRHTest.getlevels(Sender: TObject);
var var
i : integer; i : integer;
begin begin
minf1 := 10000; minf1 := MaxInt;
maxf1 := -10000; maxf1 := -MaxInt;
for i := 1 to NoCases do for i := 1 to NoCases do
begin begin
if Not GoodRecord(i,NoSelected,ColNoSelected) then continue; if Not GoodRecord(i,NoSelected,ColNoSelected) then continue;
@ -334,10 +300,11 @@ begin
if intvalue < minf1 then minf1 := intvalue; if intvalue < minf1 then minf1 := intvalue;
end; end;
Nf1cells := maxf1 - minf1 + 1; Nf1cells := maxf1 - minf1 + 1;
if nofactors > 1 then if nofactors > 1 then
begin begin
minf2 := 10000; minf2 := MaxInt;
maxf2 := -10000; maxf2 := -MaxInt;
for i := 1 to NoCases do for i := 1 to NoCases do
begin begin
if Not GoodRecord(i,NoSelected,ColNoSelected) then continue; if Not GoodRecord(i,NoSelected,ColNoSelected) then continue;
@ -347,10 +314,11 @@ begin
end; end;
Nf2cells := maxf2 - minf2 + 1; Nf2cells := maxf2 - minf2 + 1;
end; end;
totcells := Nf1cells + Nf2cells; totcells := Nf1cells + Nf2cells;
end; end;
procedure TSRHTest.Calc2Way(Sender: TObject); procedure TSRHTestForm.Calc2Way(Sender: TObject);
var var
i, j : integer; i, j : integer;
grpA, grpB : integer; grpA, grpB : integer;
@ -468,7 +436,7 @@ begin
if (Omega < 0.0) then Omega := 0.0; if (Omega < 0.0) then Omega := 0.0;
end; end;
procedure TSRHTest.TwoWayTable(Sender: TObject); procedure TSRHTestForm.TwoWayTable(Sender: TObject);
var var
groupsize : integer; groupsize : integer;
MinVar, MaxVar, sumvars, sumDFrecip : double; MinVar, MaxVar, sumvars, sumDFrecip : double;
@ -610,7 +578,7 @@ begin
OutputFrm.RichEdit.Lines.Add('---------------------------------------------------------------------'); OutputFrm.RichEdit.Lines.Add('---------------------------------------------------------------------');
end; end;
procedure TSRHTest.TwoWayPlot(Sender: TObject); procedure TSRHTestForm.TwoWayPlot(Sender: TObject);
var var
i, j : integer; i, j : integer;
maxmean, XBar : double; maxmean, XBar : double;
@ -656,6 +624,7 @@ begin
GraphFrm.FloorColor := clLtGray; GraphFrm.FloorColor := clLtGray;
GraphFrm.ShowBackWall := true; GraphFrm.ShowBackWall := true;
GraphFrm.ShowModal; GraphFrm.ShowModal;
// do Factor B next // do Factor B next
setstring := 'FACTOR B'; setstring := 'FACTOR B';
GraphFrm.SetLabels[1] := setstring; GraphFrm.SetLabels[1] := setstring;
@ -707,7 +676,6 @@ begin
XValue[j-1] := minF2 + j - 1; XValue[j-1] := minF2 + j - 1;
GraphFrm.Xpoints[0,j-1] := XValue[j-1]; GraphFrm.Xpoints[0,j-1] := XValue[j-1];
end; 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';
@ -729,6 +697,30 @@ begin
GraphFrm.Ypoints := nil; GraphFrm.Ypoints := nil;
end; end;
procedure TSRHTestForm.Reset;
var
i : integer;
begin
inherited;
DepVar.Clear;
Factor1.Clear;
Factor2.Clear;
PlotMeans.Checked := false;
OverAllalpha.Text := FormatFloat('0.00', DEFAULT_ALPHA_LEVEL);
VarList.Clear;
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i, 0]);
UpdateBtnStates;
end;
procedure TSRHTestForm.UpdateBtnStates;
begin
inherited;
end;
end. end.

View File

@ -1914,9 +1914,9 @@ end;
// Menu "Analysis" > "Nonparametric" > "Schreier-Ray-Hare Two-Way ANOVA" // Menu "Analysis" > "Nonparametric" > "Schreier-Ray-Hare Two-Way ANOVA"
procedure TOS3MainFrm.mnuAnalysisNonPar_SRHClick(Sender: TObject); procedure TOS3MainFrm.mnuAnalysisNonPar_SRHClick(Sender: TObject);
begin begin
if SRHTest = nil then if SRHTestForm = nil then
Application.CreateForm(TSRHTest, SRHTest); Application.CreateForm(TSRHTestForm, SRHTestForm);
SRHTest.ShowModal; SRHTestForm.ShowModal;
end; end;