You've already forked lazarus-ccr
Lazstats: Inherit TwoWayLogLinUnit from BasicStatsReportFormUnit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7919 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,433 +1,372 @@
|
||||
object TwoWayLogLinFrm: TTwoWayLogLinFrm
|
||||
inherited TwoWayLogLinForm: TTwoWayLogLinForm
|
||||
Left = 494
|
||||
Height = 352
|
||||
Top = 237
|
||||
Width = 425
|
||||
Width = 586
|
||||
HelpType = htKeyword
|
||||
HelpKeyword = 'html/AxBLogLinear.htm'
|
||||
AutoSize = True
|
||||
Caption = 'Log Linear Analysis of a 2x2 Table'
|
||||
ClientHeight = 352
|
||||
ClientWidth = 425
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '2.1.0.0'
|
||||
object FileFromGrp: TRadioGroup
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 8
|
||||
Height = 51
|
||||
Top = 8
|
||||
Width = 354
|
||||
AutoFill = False
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
Caption = 'Enter Data From:'
|
||||
ChildSizing.LeftRightSpacing = 12
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.HorizontalSpacing = 16
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 31
|
||||
ClientWidth = 350
|
||||
Columns = 2
|
||||
Items.Strings = (
|
||||
'File Data in the Main Grid'
|
||||
'Data Entered on this Form'
|
||||
)
|
||||
OnClick = FileFromGrpClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object ResetBtn: TButton
|
||||
AnchorSideRight.Control = ComputeBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 216
|
||||
Height = 25
|
||||
Top = 319
|
||||
Width = 54
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Reset'
|
||||
OnClick = ResetBtnClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object ComputeBtn: TButton
|
||||
AnchorSideRight.Control = CloseBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 278
|
||||
Height = 25
|
||||
Top = 319
|
||||
Width = 76
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Compute'
|
||||
OnClick = ComputeBtnClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object CloseBtn: TButton
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 362
|
||||
Height = 25
|
||||
Top = 319
|
||||
Width = 55
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Close'
|
||||
ModalResult = 11
|
||||
TabOrder = 5
|
||||
end
|
||||
object HelpBtn: TButton
|
||||
Tag = 154
|
||||
AnchorSideRight.Control = ResetBtn
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 157
|
||||
Height = 25
|
||||
Top = 319
|
||||
Width = 51
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
Caption = 'Help'
|
||||
OnClick = HelpBtnClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object Notebook1: TNotebook
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = FileFromGrp
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Bevel1
|
||||
Left = 8
|
||||
Height = 236
|
||||
Top = 67
|
||||
Width = 409
|
||||
PageIndex = 0
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
TabOrder = 1
|
||||
object Page1: TPage
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = RowVarEdit
|
||||
AnchorSideBottom.Control = RowVarEdit
|
||||
Left = 226
|
||||
Height = 15
|
||||
Top = 16
|
||||
Width = 67
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Row Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = ColVarEdit
|
||||
AnchorSideBottom.Control = ColVarEdit
|
||||
Left = 226
|
||||
Height = 15
|
||||
Top = 90
|
||||
Width = 87
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Column Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
AnchorSideLeft.Control = FreqVarEdit
|
||||
AnchorSideBottom.Control = FreqVarEdit
|
||||
Left = 226
|
||||
Height = 15
|
||||
Top = 176
|
||||
Width = 99
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Frequency Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object VarList: TListBox
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideTop.Control = Page1
|
||||
AnchorSideRight.Control = RowInBtn
|
||||
AnchorSideBottom.Control = Page1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 236
|
||||
Top = 0
|
||||
Width = 182
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 8
|
||||
ItemHeight = 0
|
||||
OnSelectionChange = VarListSelectionChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object RowInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = VarList
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 28
|
||||
BorderSpacing.Top = 8
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = RowInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object RowOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideTop.Control = RowInBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 40
|
||||
Width = 28
|
||||
BorderSpacing.Top = 4
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = RowOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object ColInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Label2
|
||||
AnchorSideBottom.Control = ColVarEdit
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 90
|
||||
Width = 28
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = ColInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 4
|
||||
end
|
||||
object ColOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = ColInBtn
|
||||
AnchorSideTop.Control = ColInBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 122
|
||||
Width = 28
|
||||
BorderSpacing.Top = 4
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = ColOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 5
|
||||
end
|
||||
object FreqInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideBottom.Control = FreqOutBtn
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 168
|
||||
Width = 28
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 4
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = FreqInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 7
|
||||
end
|
||||
object FreqOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = FreqInBtn
|
||||
AnchorSideBottom.Control = VarList
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 190
|
||||
Height = 28
|
||||
Top = 200
|
||||
Width = 28
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 8
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = FreqOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 8
|
||||
end
|
||||
object RowVarEdit: TEdit
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = RowOutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 226
|
||||
Height = 23
|
||||
Top = 33
|
||||
Width = 183
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
Text = 'RowVarEdit'
|
||||
end
|
||||
object ColVarEdit: TEdit
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = VarList
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 226
|
||||
Height = 23
|
||||
Top = 107
|
||||
Width = 183
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
ReadOnly = True
|
||||
TabOrder = 6
|
||||
Text = 'ColVarEdit'
|
||||
end
|
||||
object FreqVarEdit: TEdit
|
||||
AnchorSideLeft.Control = FreqInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = FreqOutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 226
|
||||
Height = 23
|
||||
Top = 193
|
||||
Width = 183
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 9
|
||||
Text = 'FreqVarEdit'
|
||||
end
|
||||
ClientWidth = 586
|
||||
inherited ParamsPanel: TPanel
|
||||
Height = 336
|
||||
Width = 344
|
||||
ClientHeight = 336
|
||||
ClientWidth = 344
|
||||
inherited CloseBtn: TButton
|
||||
Left = 289
|
||||
Top = 311
|
||||
end
|
||||
object Page2: TPage
|
||||
object NoRowsLabel: TLabel
|
||||
AnchorSideLeft.Control = Page2
|
||||
AnchorSideTop.Control = NoRowsEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 67
|
||||
Caption = 'No. of Rows:'
|
||||
ParentColor = False
|
||||
inherited ComputeBtn: TButton
|
||||
Left = 205
|
||||
Top = 311
|
||||
end
|
||||
inherited ResetBtn: TButton
|
||||
Left = 143
|
||||
Top = 311
|
||||
end
|
||||
inherited HelpBtn: TButton
|
||||
Tag = 154
|
||||
Left = 84
|
||||
Top = 311
|
||||
end
|
||||
inherited ButtonBevel: TBevel
|
||||
Top = 295
|
||||
Width = 344
|
||||
end
|
||||
object FileFromGrp: TRadioGroup[5]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = ParamsPanel
|
||||
Left = -5
|
||||
Height = 51
|
||||
Top = 0
|
||||
Width = 354
|
||||
AutoFill = False
|
||||
AutoSize = True
|
||||
Caption = 'Enter Data From:'
|
||||
ChildSizing.LeftRightSpacing = 12
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.HorizontalSpacing = 16
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 31
|
||||
ClientWidth = 350
|
||||
Columns = 2
|
||||
Items.Strings = (
|
||||
'File Data in the Main Grid'
|
||||
'Data Entered on this Form'
|
||||
)
|
||||
OnClick = FileFromGrpClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object Notebook: TNotebook[6]
|
||||
AnchorSideLeft.Control = ParamsPanel
|
||||
AnchorSideTop.Control = FileFromGrp
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ParamsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonBevel
|
||||
Left = 0
|
||||
Height = 228
|
||||
Top = 67
|
||||
Width = 344
|
||||
PageIndex = 1
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 16
|
||||
TabOrder = 5
|
||||
object Page1: TPage
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = RowVarEdit
|
||||
AnchorSideBottom.Control = RowVarEdit
|
||||
Left = 194
|
||||
Height = 15
|
||||
Top = 16
|
||||
Width = 67
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Row Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = ColVarEdit
|
||||
AnchorSideBottom.Control = ColVarEdit
|
||||
Left = 194
|
||||
Height = 15
|
||||
Top = 86
|
||||
Width = 87
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Column Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
AnchorSideLeft.Control = FreqVarEdit
|
||||
AnchorSideBottom.Control = FreqVarEdit
|
||||
Left = 194
|
||||
Height = 15
|
||||
Top = 168
|
||||
Width = 99
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 2
|
||||
Caption = 'Frequency Variable'
|
||||
ParentColor = False
|
||||
end
|
||||
object VarList: TListBox
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideTop.Control = Page1
|
||||
AnchorSideRight.Control = RowInBtn
|
||||
AnchorSideBottom.Control = Page1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 228
|
||||
Top = 0
|
||||
Width = 150
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 8
|
||||
ItemHeight = 0
|
||||
OnDblClick = VarListDblClick
|
||||
OnSelectionChange = VarListSelectionChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object RowInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = VarList
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 8
|
||||
Width = 28
|
||||
BorderSpacing.Top = 8
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = RowInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 1
|
||||
end
|
||||
object RowOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideTop.Control = RowInBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 40
|
||||
Width = 28
|
||||
BorderSpacing.Top = 4
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = RowOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object ColInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Label2
|
||||
AnchorSideBottom.Control = ColVarEdit
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 86
|
||||
Width = 28
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = ColInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 4
|
||||
end
|
||||
object ColOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = ColInBtn
|
||||
AnchorSideTop.Control = ColInBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 118
|
||||
Width = 28
|
||||
BorderSpacing.Top = 4
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = ColOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 5
|
||||
end
|
||||
object FreqInBtn: TBitBtn
|
||||
AnchorSideLeft.Control = Page1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideBottom.Control = FreqOutBtn
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 160
|
||||
Width = 28
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 4
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 1
|
||||
OnClick = FreqInBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 7
|
||||
end
|
||||
object FreqOutBtn: TBitBtn
|
||||
AnchorSideLeft.Control = FreqInBtn
|
||||
AnchorSideBottom.Control = VarList
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 158
|
||||
Height = 28
|
||||
Top = 192
|
||||
Width = 28
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Bottom = 8
|
||||
Enabled = False
|
||||
Images = MainDataModule.ImageList
|
||||
ImageIndex = 0
|
||||
OnClick = FreqOutBtnClick
|
||||
Spacing = 0
|
||||
TabOrder = 8
|
||||
end
|
||||
object RowVarEdit: TEdit
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = RowOutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 194
|
||||
Height = 23
|
||||
Top = 33
|
||||
Width = 150
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
Text = 'RowVarEdit'
|
||||
end
|
||||
object ColVarEdit: TEdit
|
||||
AnchorSideLeft.Control = RowInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = VarList
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 194
|
||||
Height = 23
|
||||
Top = 103
|
||||
Width = 150
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
ReadOnly = True
|
||||
TabOrder = 6
|
||||
Text = 'ColVarEdit'
|
||||
end
|
||||
object FreqVarEdit: TEdit
|
||||
AnchorSideLeft.Control = FreqInBtn
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideRight.Control = Page1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = FreqOutBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 194
|
||||
Height = 23
|
||||
Top = 185
|
||||
Width = 150
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 12
|
||||
ReadOnly = True
|
||||
TabOrder = 9
|
||||
Text = 'FreqVarEdit'
|
||||
end
|
||||
end
|
||||
object NoColsLabel: TLabel
|
||||
AnchorSideLeft.Control = NoRowsEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = NoColsEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 138
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 87
|
||||
BorderSpacing.Left = 24
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'No. of Columns:'
|
||||
ParentColor = False
|
||||
end
|
||||
object NoRowsEdit: TEdit
|
||||
AnchorSideLeft.Control = NoRowsLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Page2
|
||||
Left = 75
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 39
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 8
|
||||
OnKeyPress = NoRowsEditKeyPress
|
||||
TabOrder = 0
|
||||
Text = 'NoRowsEdit'
|
||||
end
|
||||
object NoColsEdit: TEdit
|
||||
AnchorSideLeft.Control = NoColsLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Page2
|
||||
AnchorSideRight.Control = Page2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 233
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 46
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 8
|
||||
OnKeyPress = NoColsEditKeyPress
|
||||
TabOrder = 1
|
||||
Text = 'Edit1'
|
||||
end
|
||||
object Grid: TStringGrid
|
||||
AnchorSideLeft.Control = Page2
|
||||
AnchorSideTop.Control = NoRowsEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Page2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Page2
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 235
|
||||
Top = 31
|
||||
Width = 373
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 8
|
||||
ColCount = 2
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goTabs, goThumbTracking, goSmoothScroll]
|
||||
RowCount = 2
|
||||
TabOrder = 2
|
||||
object Page2: TPage
|
||||
object NoRowsLabel: TLabel
|
||||
AnchorSideLeft.Control = Page2
|
||||
AnchorSideTop.Control = NoRowsEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 67
|
||||
Caption = 'No. of Rows:'
|
||||
ParentColor = False
|
||||
end
|
||||
object NoColsLabel: TLabel
|
||||
AnchorSideLeft.Control = NoRowsEdit
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = NoColsEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 138
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 87
|
||||
BorderSpacing.Left = 24
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'No. of Columns:'
|
||||
ParentColor = False
|
||||
end
|
||||
object NoRowsEdit: TEdit
|
||||
AnchorSideLeft.Control = NoRowsLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Page2
|
||||
Left = 75
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 39
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 8
|
||||
OnKeyPress = NoRowsEditKeyPress
|
||||
TabOrder = 0
|
||||
Text = 'NoRowsEdit'
|
||||
end
|
||||
object NoColsEdit: TEdit
|
||||
AnchorSideLeft.Control = NoColsLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Page2
|
||||
AnchorSideRight.Control = Page2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 233
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 46
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 8
|
||||
OnKeyPress = NoColsEditKeyPress
|
||||
TabOrder = 1
|
||||
Text = 'Edit1'
|
||||
end
|
||||
object Grid: TStringGrid
|
||||
AnchorSideLeft.Control = Page2
|
||||
AnchorSideTop.Control = NoRowsEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Page2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Page2
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 197
|
||||
Top = 31
|
||||
Width = 344
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
AutoAdvance = aaDown
|
||||
BorderSpacing.Top = 8
|
||||
ColCount = 2
|
||||
MouseWheelOption = mwGrid
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goEditing, goTabs, goThumbTracking, goSmoothScroll]
|
||||
RowCount = 2
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
object Bevel1: TBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = CloseBtn
|
||||
Left = 0
|
||||
Height = 8
|
||||
Top = 303
|
||||
Width = 425
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Shape = bsBottomLine
|
||||
inherited ParamsSplitter: TSplitter
|
||||
Left = 356
|
||||
Height = 352
|
||||
end
|
||||
object Bevel2: TBevel
|
||||
object Bevel2: TBevel[2]
|
||||
Left = 3
|
||||
Height = 14
|
||||
Top = 336
|
||||
|
@ -5,24 +5,19 @@ unit TwoWayLogLinUnit;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
|
||||
ExtCtrls, StdCtrls, Buttons, Grids,
|
||||
OutputUnit, MainUnit, Globals, DataProcs, ContextHelpUnit;
|
||||
MainUnit, Globals, BasicStatsReportFormUnit;
|
||||
|
||||
type
|
||||
|
||||
{ TTwoWayLogLinFrm }
|
||||
{ TTwoWayLogLinForm }
|
||||
|
||||
TTwoWayLogLinFrm = class(TForm)
|
||||
Bevel1: TBevel;
|
||||
TTwoWayLogLinForm = class(TBasicStatsReportForm)
|
||||
Bevel2: TBevel;
|
||||
HelpBtn: TButton;
|
||||
Notebook1: TNotebook;
|
||||
Notebook: TNotebook;
|
||||
Page1: TPage;
|
||||
Page2: TPage;
|
||||
ResetBtn: TButton;
|
||||
ComputeBtn: TButton;
|
||||
CloseBtn: TButton;
|
||||
RowInBtn: TBitBtn;
|
||||
RowOutBtn: TBitBtn;
|
||||
ColInBtn: TBitBtn;
|
||||
@ -44,240 +39,124 @@ type
|
||||
VarList: TListBox;
|
||||
procedure ColInBtnClick(Sender: TObject);
|
||||
procedure ColOutBtnClick(Sender: TObject);
|
||||
procedure ComputeBtnClick(Sender: TObject);
|
||||
procedure FileFromGrpClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FreqInBtnClick(Sender: TObject);
|
||||
procedure FreqOutBtnClick(Sender: TObject);
|
||||
procedure HelpBtnClick(Sender: TObject);
|
||||
procedure NoColsEditKeyPress(Sender: TObject; var Key: char);
|
||||
procedure NoRowsEditKeyPress(Sender: TObject; var Key: char);
|
||||
procedure ResetBtnClick(Sender: TObject);
|
||||
procedure RowInBtnClick(Sender: TObject);
|
||||
procedure RowOutBtnClick(Sender: TObject);
|
||||
procedure VarListDblClick(Sender: TObject);
|
||||
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||
|
||||
private
|
||||
{ private declarations }
|
||||
FAutoSized: Boolean;
|
||||
procedure UpdateBtnStates;
|
||||
|
||||
procedure PrintTable(Nrows, Ncols: integer; const Data: DblDyneMat;
|
||||
const RowMarg, ColMarg: DblDyneVec; Total: double; AReport: TStrings);
|
||||
procedure Iterate(Nrows, Ncols: integer;
|
||||
const Data: DblDyneMat; const RowMarg, ColMarg: DblDyneVec;
|
||||
var Total: double;
|
||||
procedure Iterate(Nrows, Ncols: integer; const RowMarg, ColMarg: DblDyneVec;
|
||||
const Expected: DblDyneMat; const NewRowMarg, NewColMarg: DblDyneVec;
|
||||
var NewTotal: double);
|
||||
procedure PrintLamdas(Nrows, Ncols : integer; const CellLambdas: DblDyneCube;
|
||||
mu: double; AReport: TStrings);
|
||||
|
||||
protected
|
||||
procedure AdjustConstraints; override;
|
||||
procedure Compute; override;
|
||||
procedure UpdateBtnStates; override;
|
||||
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
||||
|
||||
public
|
||||
{ public declarations }
|
||||
procedure Reset; override;
|
||||
end;
|
||||
|
||||
var
|
||||
TwoWayLogLinFrm: TTwoWayLogLinFrm;
|
||||
TwoWayLogLinForm: TTwoWayLogLinForm;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
Math;
|
||||
Math,
|
||||
Utils, GridProcs;
|
||||
|
||||
{ TTwoWayLogLinFrm }
|
||||
const
|
||||
INVALID_INT_ERROR = 'Valid positive integer required.';
|
||||
|
||||
procedure TTwoWayLogLinFrm.ResetBtnClick(Sender: TObject);
|
||||
VAR i, j : integer;
|
||||
|
||||
{ TTwoWayLogLinForm }
|
||||
|
||||
procedure TTwoWayLogLinForm.AdjustConstraints;
|
||||
begin
|
||||
for i := 0 to Grid.RowCount - 1 do
|
||||
for j := 0 to Grid.ColCount - 1 do
|
||||
Grid.Cells[j,i] := '';
|
||||
Grid.ColCount := 3;
|
||||
Grid.RowCount := 2;
|
||||
Grid.Cells[0,0] := 'ROW';
|
||||
Grid.Cells[1,0] := 'COL';
|
||||
Grid.Cells[2,0] := 'FREQ';
|
||||
VarList.Clear;
|
||||
for i := 1 to NoVariables do
|
||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||
RowVarEdit.Text := '';
|
||||
ColVarEdit.Text := '';
|
||||
FreqVarEdit.Text := '';
|
||||
NoRowsEdit.Text := '';
|
||||
NoColsEdit.Text := '';
|
||||
FileFromGrp.ItemIndex := -1;
|
||||
Notebook1.Hide;
|
||||
{
|
||||
VarList.Visible := false;
|
||||
RowInBtn.Enabled := false;
|
||||
RowOutBtn.Enabled := false;
|
||||
ColInBtn.Enabled := false;
|
||||
ColOutBtn.Enabled := false;
|
||||
FreqInBtn.Enabled := false;
|
||||
FreqOutBtn.Enabled := false;
|
||||
Label1.Visible := false;
|
||||
Label2.Visible := false;
|
||||
Label3.Visible := false;
|
||||
RowVarEdit.Visible := false;
|
||||
ColVarEdit.Visible := false;
|
||||
FreqVarEdit.Visible := false;
|
||||
// Memo1.Visible := false;
|
||||
NoRowsLabel.Visible := false;
|
||||
NoColsLabel.Visible := false;
|
||||
NoRowsEdit.Visible := false;
|
||||
NoColsEdit.Visible := false;
|
||||
Grid.Visible := false;
|
||||
}
|
||||
inherited;
|
||||
ParamsPanel.Constraints.MinWidth := MaxValue([
|
||||
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
|
||||
FileFromGrp.Width,
|
||||
NoColsEdit.Left + NoColsEdit.Width
|
||||
]);
|
||||
ParamsPanel.Constraints.MinHeight :=
|
||||
FileFromGrp.Height + Notebook.BorderSpacing.Top +
|
||||
FreqOutbtn.Top + FreqOutBtn.Height + ButtonBevel.Height +
|
||||
CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.RowInBtnClick(Sender: TObject);
|
||||
|
||||
procedure TTwoWayLogLinForm.ColInBtnClick(Sender: TObject);
|
||||
var
|
||||
index: integer;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if (index > -1) and (RowVarEdit.Text = '') then
|
||||
if (index > -1) and (ColVarEdit.Text = '') then
|
||||
begin
|
||||
RowVarEdit.Text := VarList.Items[index];
|
||||
ColVarEdit.Text := VarList.Items[index];
|
||||
VarList.Items.Delete(index);
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.RowOutBtnClick(Sender: TObject);
|
||||
|
||||
procedure TTwoWayLogLinForm.ColOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if RowVarEdit.Text <> '' then
|
||||
if ColVarEdit.Text <> '' then
|
||||
begin
|
||||
VarList.Items.Add(RowVarEdit.Text);
|
||||
RowVarEdit.Text := '';
|
||||
VarList.Items.Add(ColVarEdit.Text);
|
||||
ColVarEdit.Text := '';
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FormActivate(Sender: TObject);
|
||||
|
||||
procedure TTwoWayLogLinForm.Compute;
|
||||
var
|
||||
w: Integer;
|
||||
begin
|
||||
if FAutoSized then
|
||||
exit;
|
||||
|
||||
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
||||
HelpBtn.Constraints.MinWidth := w;
|
||||
ResetBtn.Constraints.MinWidth := w;
|
||||
ComputeBtn.Constraints.MinWidth := w;
|
||||
CloseBtn.Constraints.MinWidth := w;
|
||||
|
||||
Constraints.MinWidth := Width;
|
||||
Constraints.MinHeight := Height;
|
||||
|
||||
FAutoSized := true;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Assert(OS3MainFrm <> nil);
|
||||
if OutputFrm = nil then Application.CreateForm(TOutputFrm, OutputFrm);
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FormShow(Sender: TObject);
|
||||
begin
|
||||
ResetBtnClick(Self);
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FreqInBtnClick(Sender: TObject);
|
||||
var
|
||||
index: integer;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if (index > -1) and (FreqVarEdit.Text = '') then
|
||||
begin
|
||||
FreqVarEdit.Text := VarList.Items[index];
|
||||
VarList.Items.Delete(index);
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FreqOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if FreqVarEdit.Text <> '' then
|
||||
begin
|
||||
VarList.Items.Add(FreqVarEdit.Text);
|
||||
FreqVarEdit.Text := '';
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.HelpBtnClick(Sender: TObject);
|
||||
begin
|
||||
if ContextHelpForm = nil then
|
||||
Application.CreateForm(TContextHelpForm, ContextHelpForm);
|
||||
ContextHelpForm.HelpMessage((Sender as TButton).Tag);
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.NoColsEditKeyPress(Sender: TObject; var Key: char);
|
||||
var
|
||||
i, j, row : integer;
|
||||
Ncols, Nrows : integer;
|
||||
|
||||
begin
|
||||
if ord(Key) = 13 then
|
||||
begin
|
||||
Nrows := StrToInt(NoRowsEdit.Text);
|
||||
Ncols := StrToInt(NoColsEdit.Text);
|
||||
Grid.RowCount := (Nrows * Ncols) + 1;
|
||||
// setup row and column values in the grid
|
||||
row := 1;
|
||||
for j := 1 to Ncols do
|
||||
begin
|
||||
for i := 1 to Nrows do
|
||||
begin
|
||||
Grid.Cells[0,row] := IntToStr(i);
|
||||
Grid.Cells[1,row] := IntToStr(j);
|
||||
row := row + 1;
|
||||
end;
|
||||
end;
|
||||
Grid.SetFocus;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.NoRowsEditKeyPress(Sender: TObject; var Key: char);
|
||||
begin
|
||||
if ord(Key) = 13 then NoColsEdit.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.ComputeBtnClick(Sender: TObject);
|
||||
var
|
||||
Data : DblDyneMat;
|
||||
Prop : DblDyneMat;
|
||||
LogData : DblDyneMat;
|
||||
Expected : DblDyneMat;
|
||||
i, j, k : integer;
|
||||
RowMarg : DblDyneVec;
|
||||
NewRowMarg : DblDyneVec;
|
||||
RowLogs : DblDyneVec;
|
||||
ColMarg : DblDyneVec;
|
||||
NewColMarg : DblDyneVec;
|
||||
ColLogs : DblDyneVec;
|
||||
CellLambdas : DblDyneCube;
|
||||
Total : double;
|
||||
NewTotal: double = 0.0;
|
||||
TotalLogs : double;
|
||||
mu : double;
|
||||
row, col : integer;
|
||||
ModelTotal : double;
|
||||
astr : string;
|
||||
Ysqr : double;
|
||||
DF : integer;
|
||||
chisqr: double;
|
||||
odds : double;
|
||||
Nrows, Ncols : integer;
|
||||
RowCol, ColCol, Fcol : integer;
|
||||
GridPos : IntDyneVec;
|
||||
value : integer;
|
||||
Fx : double;
|
||||
lReport: TStrings;
|
||||
|
||||
Data: DblDyneMat = nil;
|
||||
Prop: DblDyneMat = nil;
|
||||
LogData: DblDyneMat = nil;
|
||||
Expected: DblDyneMat = nil;
|
||||
i, j, k: integer;
|
||||
RowMarg: DblDyneVec = nil;
|
||||
NewRowMarg: DblDyneVec = nil;
|
||||
RowLogs: DblDyneVec = nil;
|
||||
ColMarg: DblDyneVec = nil;
|
||||
NewColMarg: DblDyneVec = nil;
|
||||
ColLogs: DblDyneVec =nil;
|
||||
CellLambdas: DblDyneCube = nil;
|
||||
Total: double;
|
||||
NewTotal: double = 0.0;
|
||||
TotalLogs: double;
|
||||
mu: double;
|
||||
row, col: integer;
|
||||
ModelTotal: double;
|
||||
astr: string;
|
||||
Ysqr: double;
|
||||
DF: integer;
|
||||
chisqr: double;
|
||||
odds: double;
|
||||
Nrows, Ncols: integer;
|
||||
RowCol, ColCol, Fcol: integer;
|
||||
GridPos: IntDyneVec = nil;
|
||||
value: integer;
|
||||
Fx: double;
|
||||
lReport: TStrings;
|
||||
begin
|
||||
Total := 0.0;
|
||||
TotalLogs := 0.0;
|
||||
@ -287,12 +166,10 @@ begin
|
||||
if FileFromGrp.ItemIndex = 0 then // mainfrm input
|
||||
begin
|
||||
SetLength(GridPos,3);
|
||||
for i := 1 to NoVariables do
|
||||
begin
|
||||
if RowVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[0] := i;
|
||||
if ColVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[1] := i;
|
||||
if FreqVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[2] := i;
|
||||
end;
|
||||
GridPos[0] := GetVariableIndex(OS3MainFrm.DataGrid, RowVarEdit.Text);
|
||||
GridPos[1] := GetVariableIndex(OS3MainFrm.DataGrid, ColVarEdit.Text);
|
||||
GridPos[2] := GetVariableIndex(OS3MainFrm.DataGrid, FreqVarEdit.Text);
|
||||
|
||||
// get no. of rows and columns
|
||||
for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do
|
||||
begin
|
||||
@ -323,10 +200,10 @@ begin
|
||||
Fcol := GridPos[2];
|
||||
for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do
|
||||
begin
|
||||
if Not GoodRecord(i, 3, GridPos) then continue;
|
||||
row := StrToInt(OS3MainFrm.DataGrid.Cells[rowcol,i]);
|
||||
col := StrToInt(OS3MainFrm.DataGrid.Cells[colcol,i]);
|
||||
Fx := StrToInt(OS3MainFrm.DataGrid.Cells[Fcol,i]);
|
||||
if not GoodRecord(OS3MainFrm.DataGrid, i, GridPos) then continue;
|
||||
row := StrToInt(OS3MainFrm.DataGrid.Cells[rowcol, i]);
|
||||
col := StrToInt(OS3MainFrm.DataGrid.Cells[colcol, i]);
|
||||
Fx := StrToInt(OS3MainFrm.DataGrid.Cells[Fcol, i]);
|
||||
Data[row,col] := Data[row,col] + Fx;
|
||||
Total := Total + Fx;
|
||||
end;
|
||||
@ -460,7 +337,7 @@ begin
|
||||
lReport.Add('Y squared statistic for model fit: ' + format('%.3f',[Ysqr]) + ' D.F. 0');
|
||||
|
||||
lReport.Add('');
|
||||
lReport.Add('=======================================================================');
|
||||
lReport.Add(DIVIDER_AUTO);
|
||||
lReport.Add('');
|
||||
|
||||
// Do the model of independence
|
||||
@ -468,7 +345,7 @@ begin
|
||||
lReport.Add('');
|
||||
|
||||
lReport.Add('Expected Frequencies');
|
||||
Iterate(Nrows,Ncols, Data, RowMarg, ColMarg, Total, Expected, NewRowMarg, NewColMarg, NewTotal);
|
||||
Iterate(Nrows, Ncols, RowMarg, ColMarg, Expected, NewRowMarg, NewColMarg, NewTotal);
|
||||
PrintTable(Nrows, Ncols, Expected, NewRowMarg, NewColMarg, NewTotal, lReport);
|
||||
for i := 1 to Nrows do
|
||||
for j := 1 to Ncols do
|
||||
@ -517,7 +394,7 @@ begin
|
||||
lReport.Add('Chi-squared = %.3f with %d D.F.', [chisqr, DF]);
|
||||
|
||||
lReport.Add('');
|
||||
lReport.Add('=======================================================================');
|
||||
lReport.Add(DIVIDER_AUTO);
|
||||
lReport.Add('');
|
||||
|
||||
// Do no Column Effects model
|
||||
@ -580,7 +457,7 @@ begin
|
||||
lReport.Add(astr);
|
||||
|
||||
lReport.Add('');
|
||||
lReport.Add('=======================================================================');
|
||||
lReport.Add(DIVIDER_AUTO);
|
||||
lReport.Add('');
|
||||
|
||||
// Do no Row Effects model
|
||||
@ -641,7 +518,7 @@ begin
|
||||
lReport.Add(astr);
|
||||
|
||||
lReport.Add('');
|
||||
lReport.Add('=======================================================================');
|
||||
lReport.Add(DIVIDER_AUTO);
|
||||
lReport.Add('');
|
||||
|
||||
// Do equiprobability model
|
||||
@ -690,93 +567,56 @@ begin
|
||||
Ysqr := Ysqr + Data[i,j] * (ln(Data[i,j]) - ln(Expected[i,j]));
|
||||
Ysqr := 2.0 * Ysqr;
|
||||
lReport.Add('');
|
||||
astr := 'Y squared statistic for model fit: ' + format('%.3f',[Ysqr]);
|
||||
astr := 'Y squared statistic for model fit: ' + Format('%.3f',[Ysqr]);
|
||||
DF := Nrows * Ncols - 1;
|
||||
astr := astr + ', D.F. ' + IntToStr(DF);
|
||||
lReport.Add(astr);
|
||||
|
||||
DisplayReport(lReport);
|
||||
FReportFrame.DisplayReport(lReport);
|
||||
|
||||
finally
|
||||
lReport.Free;
|
||||
|
||||
NewColMarg := nil;
|
||||
NewRowMarg := nil;
|
||||
Expected := nil;
|
||||
LogData := nil;
|
||||
Prop := nil;
|
||||
ColLogs := nil;
|
||||
ColMarg := nil;
|
||||
RowLogs := nil;
|
||||
RowMarg := nil;
|
||||
CellLambdas := nil;
|
||||
Data := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.FileFromGrpClick(Sender: TObject);
|
||||
|
||||
procedure TTwoWayLogLinForm.FileFromGrpClick(Sender: TObject);
|
||||
begin
|
||||
Notebook1.PageIndex := FileFromGrp.ItemIndex;
|
||||
Notebook1.Show;
|
||||
Notebook.PageIndex := FileFromGrp.ItemIndex;
|
||||
Notebook.Show;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.ColInBtnClick(Sender: TObject);
|
||||
|
||||
procedure TTwoWayLogLinForm.FreqInBtnClick(Sender: TObject);
|
||||
var
|
||||
index: integer;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if (index > -1) and (ColVarEdit.Text = '') then
|
||||
if (index > -1) and (FreqVarEdit.Text = '') then
|
||||
begin
|
||||
ColVarEdit.Text := VarList.Items[index];
|
||||
FreqVarEdit.Text := VarList.Items[index];
|
||||
VarList.Items.Delete(index);
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.ColOutBtnClick(Sender: TObject);
|
||||
procedure TTwoWayLogLinForm.FreqOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if ColVarEdit.Text <> '' then
|
||||
if FreqVarEdit.Text <> '' then
|
||||
begin
|
||||
VarList.Items.Add(ColVarEdit.Text);
|
||||
ColVarEdit.Text := '';
|
||||
VarList.Items.Add(FreqVarEdit.Text);
|
||||
FreqVarEdit.Text := '';
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.PrintTable(Nrows, Ncols : integer;
|
||||
const Data: DblDyneMat; const RowMarg, ColMarg: DblDyneVec;
|
||||
Total: double; AReport: TStrings);
|
||||
var
|
||||
astr: string;
|
||||
i, j: integer;
|
||||
begin
|
||||
astr := 'ROW/COL ';
|
||||
for j := 1 to Ncols do astr := astr + Format(' %3d ', [j]);
|
||||
astr := astr + ' TOTAL';
|
||||
AReport. Add(astr);
|
||||
|
||||
for i := 1 to Nrows do
|
||||
begin
|
||||
astr := Format(' %3d ', [i]);
|
||||
for j := 1 to Ncols do
|
||||
astr := astr + Format(' %8.2f ', [Data[i,j]]);
|
||||
astr := astr + Format(' %8.2f ', [RowMarg[i]]);
|
||||
AReport.Add(astr);
|
||||
end;
|
||||
|
||||
astr := 'TOTAL ';
|
||||
for j := 1 to Ncols do astr := astr + Format(' %8.2f ',[ColMarg[j]]);
|
||||
astr := astr + Format(' %8.2f ', [Total]);
|
||||
AReport.Add(astr);
|
||||
AReport.Add('');
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.Iterate(Nrows, Ncols: integer;
|
||||
const Data: DblDyneMat; const RowMarg, ColMarg: DblDyneVec; var Total: double;
|
||||
const Expected: DblDyneMat; const NewRowMarg, NewColMarg: DblDyneVec; var NewTotal: double);
|
||||
procedure TTwoWayLogLinForm.Iterate(Nrows, Ncols: integer;
|
||||
const RowMarg, ColMarg: DblDyneVec; const Expected: DblDyneMat;
|
||||
const NewRowMarg, NewColMarg: DblDyneVec; var NewTotal: double);
|
||||
Label Step;
|
||||
var
|
||||
Aprevious: DblDyneMat;
|
||||
Aprevious: DblDyneMat = nil;
|
||||
i, j: integer;
|
||||
delta: double;
|
||||
difference: double;
|
||||
@ -838,7 +678,60 @@ Step:
|
||||
Aprevious := nil;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.PrintLamdas(Nrows,Ncols: integer;
|
||||
|
||||
procedure TTwoWayLogLinForm.NoColsEditKeyPress(Sender: TObject; var Key: char);
|
||||
var
|
||||
i, j, row: integer;
|
||||
nCols, nRows: integer;
|
||||
begin
|
||||
if ord(Key) = 13 then
|
||||
begin
|
||||
if not TryStrToInt(NoRowsEdit.Text, nRows) then
|
||||
begin
|
||||
ErrorMsg(INVALID_INT_ERROR);
|
||||
NoRowsEdit.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToInt(NoColsEdit.Text, nCols) then
|
||||
begin
|
||||
ErrorMsg(INVALID_INT_ERROR);
|
||||
NoColsEdit.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
Grid.RowCount := nRows * nCols + 1;
|
||||
|
||||
// setup row and column values in the grid
|
||||
row := 1;
|
||||
for j := 1 to nCols do
|
||||
begin
|
||||
for i := 1 to nRows do
|
||||
begin
|
||||
Grid.Cells[0,row] := IntToStr(i);
|
||||
Grid.Cells[1,row] := IntToStr(j);
|
||||
row := row + 1;
|
||||
end;
|
||||
end;
|
||||
Grid.SetFocus;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinForm.NoRowsEditKeyPress(Sender: TObject; var Key: char);
|
||||
var
|
||||
n: Integer;
|
||||
begin
|
||||
if Key = #13 then begin
|
||||
if not TryStrToInt(NoRowsEdit.Text, n) then
|
||||
begin
|
||||
ErrorMsg(INVALID_INT_ERROR);
|
||||
NoRowsEdit.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
NoColsEdit.SetFocus;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.PrintLamdas(Nrows,Ncols: integer;
|
||||
const CellLambdas: DblDyneCube; mu: double; AReport: TStrings);
|
||||
var
|
||||
i, j, k: integer;
|
||||
@ -860,8 +753,95 @@ begin
|
||||
AReport.Add('');
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.UpdateBtnStates;
|
||||
|
||||
procedure TTwoWayLogLinForm.PrintTable(Nrows, Ncols : integer;
|
||||
const Data: DblDyneMat; const RowMarg, ColMarg: DblDyneVec;
|
||||
Total: double; AReport: TStrings);
|
||||
var
|
||||
astr: string;
|
||||
i, j: integer;
|
||||
begin
|
||||
astr := 'ROW/COL ';
|
||||
for j := 1 to Ncols do astr := astr + Format(' %3d ', [j]);
|
||||
astr := astr + ' TOTAL';
|
||||
AReport. Add(astr);
|
||||
|
||||
for i := 1 to Nrows do
|
||||
begin
|
||||
astr := Format(' %3d ', [i]);
|
||||
for j := 1 to Ncols do
|
||||
astr := astr + Format(' %8.2f ', [Data[i,j]]);
|
||||
astr := astr + Format(' %8.2f ', [RowMarg[i]]);
|
||||
AReport.Add(astr);
|
||||
end;
|
||||
|
||||
astr := 'TOTAL ';
|
||||
for j := 1 to Ncols do astr := astr + Format(' %8.2f ',[ColMarg[j]]);
|
||||
astr := astr + Format(' %8.2f ', [Total]);
|
||||
AReport.Add(astr);
|
||||
AReport.Add('');
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.Reset;
|
||||
var
|
||||
i, j: integer;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
for i := 0 to Grid.RowCount - 1 do
|
||||
for j := 0 to Grid.ColCount - 1 do
|
||||
Grid.Cells[j,i] := '';
|
||||
Grid.ColCount := 3;
|
||||
Grid.RowCount := 2;
|
||||
Grid.FixedCols := 2;
|
||||
Grid.Cells[0,0] := 'ROW';
|
||||
Grid.Cells[1,0] := 'COL';
|
||||
Grid.Cells[2,0] := 'FREQ';
|
||||
|
||||
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
|
||||
|
||||
RowVarEdit.Clear;
|
||||
ColVarEdit.Clear;
|
||||
FreqVarEdit.Clear;
|
||||
NoRowsEdit.Clear;
|
||||
NoColsEdit.Clear;
|
||||
|
||||
FileFromGrp.ItemIndex := -1;
|
||||
|
||||
Notebook.Hide;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.RowInBtnClick(Sender: TObject);
|
||||
var
|
||||
index: integer;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if (index > -1) and (RowVarEdit.Text = '') then
|
||||
begin
|
||||
RowVarEdit.Text := VarList.Items[index];
|
||||
VarList.Items.Delete(index);
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.RowOutBtnClick(Sender: TObject);
|
||||
begin
|
||||
if RowVarEdit.Text <> '' then
|
||||
begin
|
||||
VarList.Items.Add(RowVarEdit.Text);
|
||||
RowVarEdit.Text := '';
|
||||
end;
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.UpdateBtnStates;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
RowInBtn.Enabled := (VarList.ItemIndex > -1) and (RowVarEdit.Text = '');
|
||||
ColInBtn.Enabled := (VarList.ItemIndex > -1) and (ColVarEdit.Text = '');
|
||||
FreqInBtn.Enabled := (VarList.ItemIndex > -1) and (FreqVarEdit.Text = '');
|
||||
@ -870,13 +850,87 @@ begin
|
||||
FreqOutBtn.Enabled := (FreqVarEdit.Text <> '');
|
||||
end;
|
||||
|
||||
procedure TTwoWayLogLinFrm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
|
||||
function TTwoWayLogLinForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
||||
var
|
||||
i, n: Integer;
|
||||
begin
|
||||
Result := false;
|
||||
|
||||
if FileFromGrp.ItemIndex = 0 then // mainfrm input
|
||||
begin
|
||||
if RowVarEdit.Text = '' then
|
||||
begin
|
||||
AMsg := 'Row variable is not selected.';
|
||||
AControl := VarList;
|
||||
exit;
|
||||
end;
|
||||
if ColVarEdit.Text = '' then
|
||||
begin
|
||||
AMsg := 'Column variable is not selected.';
|
||||
AControl := VarList;
|
||||
exit;
|
||||
end;
|
||||
if FreqVarEdit.Text = '' then
|
||||
begin
|
||||
AMsg := 'Frequency variable is not selected.';
|
||||
AControl := VarList;
|
||||
exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
for i := 1 to Grid.RowCount-1 do
|
||||
begin
|
||||
if Grid.Cells[2, i] = '' then
|
||||
begin
|
||||
AMsg := 'Data missing in row ' + IntToStr(i);
|
||||
AControl := Grid;
|
||||
Grid.Row := i;
|
||||
Grid.Col := 2;
|
||||
exit;
|
||||
end;
|
||||
if not TryStrToInt(Grid.Cells[2, i], n) then
|
||||
begin
|
||||
AMsg := 'No valid integer in row ' + IntToStr(i);
|
||||
AControl := Grid;
|
||||
Grid.Row := i;
|
||||
Grid.Col := 2;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.VarListDblClick(Sender: TObject);
|
||||
var
|
||||
index: Integer;
|
||||
s: String;
|
||||
begin
|
||||
index := VarList.ItemIndex;
|
||||
if index > -1 then
|
||||
begin
|
||||
s := VarList.Items[index];
|
||||
if RowVarEdit.Text = '' then
|
||||
RowVarEdit.Text := s
|
||||
else if ColVarEdit.Text = '' then
|
||||
ColVarEdit.Text := s
|
||||
else if FreqVarEdit.Text = '' then
|
||||
FreqVarEdit.Text := s
|
||||
else
|
||||
exit;
|
||||
VarList.Items.Delete(index);
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TTwoWayLogLinForm.VarListSelectionChange(Sender: TObject; User: boolean);
|
||||
begin
|
||||
UpdateBtnStates;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I twowayloglinunit.lrs}
|
||||
|
||||
end.
|
||||
|
||||
|
@ -1490,9 +1490,9 @@ end;
|
||||
// Menu "Analysis" > "Cross-classification" > "AxB Log Linear"
|
||||
procedure TOS3MainFrm.mnuAnalysisCC_ABLogLinClick(Sender: TObject);
|
||||
begin
|
||||
if TwoWayLogLinFrm = nil then
|
||||
Application.CreateForm(TTwoWayLogLinFrm, TwoWayLogLinFrm);
|
||||
TwoWayLogLinFrm.Show;
|
||||
if TwoWayLogLinForm = nil then
|
||||
Application.CreateForm(TTwoWayLogLinForm, TwoWayLogLinForm);
|
||||
TwoWayLogLinForm.Show;
|
||||
end;
|
||||
|
||||
// Menu "Analysis" > "Cross-Classification" > "AxBxC Log Linear"
|
||||
|
Reference in New Issue
Block a user