From 92ac9ce5a8ce1a358ed14ab59799e406b1cdc4a5 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 12 Nov 2020 15:23:22 +0000 Subject: [PATCH] LazStats: Inherit ABCNestedUnit from BasicStatsReportAndChartForm. Move integrated directions to Lazstats.hlp git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7863 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/lazstats/LazStats.hlp | 3 +- .../analysis/comparisons/abcnestedunit.lfm | 757 ++++++++---------- .../analysis/comparisons/abcnestedunit.pas | 206 +++-- .../forms/analysis/comparisons/bnestaunit.lfm | 6 +- .../forms/analysis/comparisons/bnestaunit.pas | 2 +- 5 files changed, 468 insertions(+), 506 deletions(-) diff --git a/applications/lazstats/LazStats.hlp b/applications/lazstats/LazStats.hlp index b9b25c144..0887e9c9a 100644 --- a/applications/lazstats/LazStats.hlp +++ b/applications/lazstats/LazStats.hlp @@ -70,4 +70,5 @@ correlation, means, standard deviations and confidence interval for each correla 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. 168=This procedure lets you enter the number of observed values and the number of expected values for one or more categories.\nEnter the values as indicated and when finished, press the compute button. -169=Directions:\nFor independent groups data, first click the variable to be analyzed then click the variable containing group codes.\nFor dependent variables it is assumed the data for each pair of values are in a case.\nEnter the names of those two variables. \ No newline at end of file +169=Directions:\nFor independent groups data, first click the variable to be analyzed then click the variable containing group codes.\nFor dependent variables it is assumed the data for each pair of values are in a case.\nEnter the names of those two variables. +170=Directions:\nThis analysis assumes that levels of Factor B are Nested within levels of Factor A. It is assumed that all factors are fixed level factors.\n\nThe variables for the group coding should be defined as integers. The dependent variable should be defined as a floating point variable. The number of cases for each ABC group should be equal and the number of B treatments in in each A level should be equal. The number of C treatment levels should be the same for each AB combination.\n\nClick the variable for each factor variable and the corresponding arrow to enter it in the edit box for that variable. Select the type of plot desired for the means (if any.) Click the Compute button to continue. \ No newline at end of file diff --git a/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.lfm b/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.lfm index 68d5b0b40..65d576dfd 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.lfm +++ b/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.lfm @@ -1,433 +1,63 @@ -object ABCNestedForm: TABCNestedForm - Left = 529 - Height = 640 - Top = 153 - Width = 479 - AutoSize = True +inherited ABCNestedForm: TABCNestedForm + Left = 383 + Height = 481 + Top = 191 + Width = 843 Caption = 'ABCNestedForm' - ClientHeight = 640 - ClientWidth = 479 - OnActivate = FormActivate - OnCreate = FormCreate - OnShow = ResetBtnClick - Position = poMainFormCenter - LCLVersion = '2.1.0.0' - object ResetBtn: TButton - AnchorSideRight.Control = ComputeBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 266 - Height = 25 - Top = 607 - Width = 54 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 12 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Reset' - OnClick = ResetBtnClick - TabOrder = 2 - end - object ComputeBtn: TButton - AnchorSideRight.Control = CloseBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 328 - Height = 25 - Top = 607 - Width = 76 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Compute' - OnClick = ComputeBtnClick - TabOrder = 3 - end - object CloseBtn: TButton - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 412 - Height = 25 - Top = 607 - Width = 55 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 12 - BorderSpacing.Bottom = 8 - Caption = 'Close' - ModalResult = 11 - TabOrder = 4 - end - object OptionsBox: TRadioGroup - AnchorSideLeft.Control = Owner - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Bevel1 - Left = 8 - Height = 72 - Top = 519 - Width = 463 - Anchors = [akLeft, akRight, akBottom] - AutoFill = True - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Right = 8 - Caption = 'OptionsBox' - ChildSizing.LeftRightSpacing = 12 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.HorizontalSpacing = 16 - ChildSizing.VerticalSpacing = 2 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 2 - ClientHeight = 52 - ClientWidth = 459 - Columns = 2 - Items.Strings = ( - 'Plot means using 2D Horizontal Bars' - 'Plot means using 3D Horizontal Bars' - 'Plot means using 2D Vertical Bars' - 'Plot means using 3D Vertical Bars' - ) - TabOrder = 1 - end - object Bevel1: TBevel - AnchorSideLeft.Control = Owner - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = CloseBtn - Left = 0 - Height = 8 - Top = 591 - Width = 479 - 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 = 463 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - Caption = 'Directions: This analysis assumes that levels of Factor B are Nested within levels of Factor A. It is assumed that all factors are fixed level factors.'#13#10#13#10'The variables for the group coding should be defined as integers. The dependent variable should be defined as a floating point variable. The number of cases for each ABC group should be equal and the number of B treatments in in each A level should be equal. The number of C treatment levels should be the same for each AB combination.'#13#10#13#10'Click the variable for each factor variable and the corresponding arrow to enter it in the edit box for that variable. Select the type of plot desired for the means (if any.) Click the Compute button to continue.' - ParentColor = False - WordWrap = True - end - object Panel1: TPanel - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = Memo1 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = OptionsBox - Left = 8 - Height = 307 - Top = 204 - Width = 463 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Top = 16 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - BevelOuter = bvNone - ClientHeight = 307 - ClientWidth = 463 - TabOrder = 0 - object Label2: TLabel - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideBottom.Control = FactorAEdit - Left = 253 - Height = 15 - Top = 25 - Width = 88 - Anchors = [akLeft, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 2 - Caption = 'Factor A Variable' - ParentColor = False + ClientHeight = 481 + ClientWidth = 843 + inherited ParamsPanel: TPanel + Height = 465 + Width = 329 + ClientHeight = 465 + ClientWidth = 329 + inherited CloseBtn: TButton + Left = 274 + Top = 440 + TabOrder = 17 end - object Label3: TLabel - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideBottom.Control = FactorBEdit - Left = 253 - Height = 15 - Top = 101 - Width = 115 - Anchors = [akLeft, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 2 - Caption = 'Factor B (Nested in A)' - ParentColor = False + inherited ComputeBtn: TButton + Left = 190 + Top = 440 + TabOrder = 16 end - object Label4: TLabel - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideBottom.Control = DepEdit - Left = 253 - Height = 15 - Top = 253 - Width = 102 - Anchors = [akLeft, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 2 - Caption = 'Dependent Variable' - ParentColor = False + inherited ResetBtn: TButton + Left = 128 + Top = 440 + TabOrder = 15 end - object VarList: TListBox - AnchorSideLeft.Control = Panel1 + inherited HelpBtn: TButton + Tag = 170 + Left = 69 + Top = 440 + TabOrder = 14 + end + inherited ButtonBevel: TBevel + Top = 424 + Width = 329 + end + object VarList: TListBox[5] AnchorSideTop.Control = Label1 AnchorSideTop.Side = asrBottom AnchorSideRight.Control = AInBtn - AnchorSideBottom.Control = Panel1 - AnchorSideBottom.Side = asrBottom + AnchorSideBottom.Control = OptionsGroup Left = 0 - Height = 290 + Height = 285 Top = 17 - Width = 209 + Width = 144 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Top = 2 - BorderSpacing.Right = 8 + BorderSpacing.Right = 6 + BorderSpacing.Bottom = 8 ItemHeight = 0 MultiSelect = True + OnDblClick = VarListDblClick OnSelectionChange = VarListSelectionChange TabOrder = 0 end - object AInBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = VarList - Left = 217 - Height = 28 - Top = 17 - Width = 28 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = AInBtnClick - Spacing = 0 - TabOrder = 1 - end - object AOutBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = AInBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 49 - Width = 28 - BorderSpacing.Top = 4 - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = AOutBtnClick - Spacing = 0 - TabOrder = 2 - end - object BInBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = AOutBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 93 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = BInBtnClick - Spacing = 0 - TabOrder = 4 - end - object BOutBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = BInBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 125 - Width = 28 - BorderSpacing.Top = 4 - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = BOutBtnClick - Spacing = 0 - TabOrder = 5 - end - object DepInBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = COutBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 245 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = DepInBtnClick - Spacing = 0 - TabOrder = 10 - end - object DepOutBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = DepInBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 277 - Width = 28 - BorderSpacing.Top = 4 - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = DepOutBtnClick - Spacing = 0 - TabOrder = 11 - end - object FactorAEdit: TEdit - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Panel1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = AOutBtn - AnchorSideBottom.Side = asrBottom - Left = 253 - Height = 23 - Top = 42 - Width = 210 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 3 - Text = 'FactorAEdit' - end - object FactorBEdit: TEdit - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Panel1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = BOutBtn - AnchorSideBottom.Side = asrBottom - Left = 253 - Height = 23 - Top = 118 - Width = 210 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 6 - Text = 'FactorBEdit' - end - object DepEdit: TEdit - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Panel1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = DepOutBtn - AnchorSideBottom.Side = asrBottom - Left = 253 - Height = 23 - Top = 270 - Width = 210 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 12 - Text = 'DepEdit' - end - object CInBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = BOutBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 169 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = CInBtnClick - Spacing = 0 - TabOrder = 7 - end - object COutBtn: TBitBtn - AnchorSideLeft.Control = Panel1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = CInBtn - AnchorSideTop.Side = asrBottom - Left = 217 - Height = 28 - Top = 201 - Width = 28 - BorderSpacing.Top = 4 - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = COutBtnClick - Spacing = 0 - TabOrder = 8 - end - object FactorCEdit: TEdit - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Panel1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = COutBtn - AnchorSideBottom.Side = asrBottom - Left = 253 - Height = 23 - Top = 194 - Width = 210 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 9 - Text = 'FactorCEdit' - end - object Label5: TLabel - AnchorSideLeft.Control = AInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideBottom.Control = FactorCEdit - Left = 253 - Height = 15 - Top = 177 - Width = 88 - Anchors = [akLeft, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 2 - Caption = 'Factor C Variable' - ParentColor = False - end - object Label1: TLabel - AnchorSideLeft.Control = Panel1 - AnchorSideTop.Control = Panel1 + object Label1: TLabel[6] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = ParamsPanel Left = 0 Height = 15 Top = 0 @@ -435,5 +65,304 @@ object ABCNestedForm: TABCNestedForm Caption = 'Available Variables:' ParentColor = False end + object AInBtn: TBitBtn[7] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = DepOutBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 93 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = AInBtnClick + Spacing = 0 + TabOrder = 4 + end + object AOutBtn: TBitBtn[8] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = AInBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 125 + Width = 28 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = AOutBtnClick + Spacing = 0 + TabOrder = 5 + end + object BInBtn: TBitBtn[9] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = AOutBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 169 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = BInBtnClick + Spacing = 0 + TabOrder = 7 + end + object BOutBtn: TBitBtn[10] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = BInBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 201 + Width = 28 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = BOutBtnClick + Spacing = 0 + TabOrder = 8 + end + object DepInBtn: TBitBtn[11] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = VarList + Left = 150 + Height = 28 + Top = 17 + Width = 28 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = DepInBtnClick + Spacing = 0 + TabOrder = 1 + end + object DepOutBtn: TBitBtn[12] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = DepInBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 49 + Width = 28 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = DepOutBtnClick + Spacing = 0 + TabOrder = 2 + end + object CInBtn: TBitBtn[13] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = BOutBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 245 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = CInBtnClick + Spacing = 0 + TabOrder = 10 + end + object COutBtn: TBitBtn[14] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = CInBtn + AnchorSideTop.Side = asrBottom + Left = 150 + Height = 28 + Top = 277 + Width = 28 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = COutBtnClick + Spacing = 0 + TabOrder = 11 + end + object Label2: TLabel[15] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideBottom.Control = FactorAEdit + Left = 186 + Height = 15 + Top = 101 + Width = 88 + Anchors = [akLeft, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 2 + Caption = 'Factor A Variable' + ParentColor = False + end + object Label3: TLabel[16] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideBottom.Control = FactorBEdit + Left = 186 + Height = 15 + Top = 177 + Width = 115 + Anchors = [akLeft, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 2 + Caption = 'Factor B (Nested in A)' + ParentColor = False + end + object Label4: TLabel[17] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideBottom.Control = DepEdit + Left = 186 + Height = 15 + Top = 25 + Width = 102 + Anchors = [akLeft, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 2 + Caption = 'Dependent Variable' + ParentColor = False + end + object FactorAEdit: TEdit[18] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = AOutBtn + AnchorSideBottom.Side = asrBottom + Left = 186 + Height = 23 + Top = 118 + Width = 143 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 6 + Text = 'FactorAEdit' + end + object FactorBEdit: TEdit[19] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = BOutBtn + AnchorSideBottom.Side = asrBottom + Left = 186 + Height = 23 + Top = 194 + Width = 143 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 9 + Text = 'FactorBEdit' + end + object DepEdit: TEdit[20] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = DepOutBtn + AnchorSideBottom.Side = asrBottom + Left = 186 + Height = 23 + Top = 42 + Width = 143 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 3 + Text = 'DepEdit' + end + object FactorCEdit: TEdit[21] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = COutBtn + AnchorSideBottom.Side = asrBottom + Left = 186 + Height = 23 + Top = 270 + Width = 143 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 12 + Text = 'FactorCEdit' + end + object Label5: TLabel[22] + AnchorSideLeft.Control = AInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideBottom.Control = FactorCEdit + Left = 186 + Height = 15 + Top = 253 + Width = 88 + Anchors = [akLeft, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 2 + Caption = 'Factor C Variable' + ParentColor = False + end + object OptionsGroup: TRadioGroup[23] + AnchorSideLeft.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = ButtonBevel + Left = 8 + Height = 114 + Top = 310 + Width = 239 + Anchors = [akLeft, akBottom] + AutoFill = True + AutoSize = True + BorderSpacing.Left = 8 + BorderSpacing.Right = 8 + Caption = 'Plot options' + ChildSizing.LeftRightSpacing = 12 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.HorizontalSpacing = 16 + ChildSizing.VerticalSpacing = 2 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 94 + ClientWidth = 235 + Items.Strings = ( + 'Plot means using 2D Horizontal Bars' + 'Plot means using 3D Horizontal Bars' + 'Plot means using 2D Vertical Bars' + 'Plot means using 3D Vertical Bars' + ) + TabOrder = 13 + end + end + inherited ParamsSplitter: TSplitter + Left = 341 + Height = 481 + end + inherited PageControl: TPageControl + Left = 350 + Height = 465 + Width = 485 + ActivePage = ReportPage + TabIndex = 0 end end diff --git a/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.pas b/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.pas index fc100b192..86cc34888 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/abcnestedunit.pas @@ -5,16 +5,15 @@ unit ABCNestedUnit; interface uses - Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls, - MainUnit, OutputUnit, GraphLib, Globals; + MainUnit, GraphLib, Globals, BasicStatsReportAndChartFormUnit; type { TABCNestedForm } - TABCNestedForm = class(TForm) - Bevel1: TBevel; + TABCNestedForm = class(TBasicStatsReportAndChartForm) FactorCEdit: TEdit; FactorAEdit: TEdit; AInBtn: TBitBtn; @@ -22,7 +21,6 @@ type FactorBEdit: TEdit; BInBtn: TBitBtn; BOutBtn: TBitBtn; - ComputeBtn: TButton; DepEdit: TEdit; DepInBtn: TBitBtn; CInBtn: TBitBtn; @@ -34,28 +32,21 @@ type Label4: TLabel; Label5: TLabel; Memo1: TLabel; - OptionsBox: TRadioGroup; + OptionsGroup: TRadioGroup; Panel1: TPanel; - ResetBtn: TButton; - CloseBtn: TButton; VarList: TListBox; procedure AInBtnClick(Sender: TObject); procedure AOutBtnClick(Sender: TObject); procedure BInBtnClick(Sender: TObject); procedure BOutBtnClick(Sender: TObject); procedure CInBtnClick(Sender: TObject); - procedure ComputeBtnClick(Sender: TObject); procedure COutBtnClick(Sender: TObject); procedure DepInBtnClick(Sender: TObject); procedure DepOutBtnClick(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure ResetBtnClick(Sender: TObject); + procedure VarListDblClick(Sender: TObject); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); private - { private declarations } - FAutoSized: Boolean; CellCount: IntDyneCube; ASS, BSS, CSS, ASumSqr, BSumSqr, CSumSqr, AMeans, BMeans, ASDs : DblDyneVec; CMeans, BSDs, CSDs : DblDyneVec; @@ -69,7 +60,7 @@ type SSTot, SumSqrTot, TotMean, MSTot, SSA, MSA, SSB, MSB, SSW, MSW : double; SSC, MSC, SSAC, MSAC, SSBwAC, SSAB, MSBwAC : double; TotN, dfA, dfBwA, dfwcell, dftotal, dfC, dfAC, dfBwAC : integer; - ColNoSelected : IntDyneVec; + ColNoSelected: IntDyneVec; function GetVars: Boolean; procedure GetMemory; @@ -80,44 +71,52 @@ type procedure ReleaseMemory; procedure TwoWayPlot; - procedure UpdateBtnStates; + protected + procedure AdjustConstraints; override; + procedure Compute; override; + procedure UpdateBtnStates; override; + public - { public declarations } + constructor Create(AOwner: TComponent); override; + procedure Reset; override; end; var ABCNestedForm: TABCNestedForm; + implementation +{$R *.lfm} + uses Math, MathUnit; + { TABCNestedForm } -procedure TABCNestedForm.ResetBtnClick(Sender: TObject); -VAR - i : integer; +constructor TABCNestedForm.Create(AOwner: TComponent); begin - VarList.Items.Clear; - FactorAEdit.Text := ''; - FactorBEdit.Text := ''; - FactorCEdit.Text := ''; - DepEdit.Text := ''; - AInBtn.Enabled := true; - AOutBtn.Enabled := false; - BInBtn.Enabled := true; - BOutBtn.Enabled := false; - CInBtn.Enabled := true; - COutBtn.Enabled := false; - DepInBtn.Enabled := true; - DepoutBtn.Enabled := false; - OptionsBox.ItemIndex := 3; - for i := 1 to NoVariables do - VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); - OptionsBox.ItemIndex := 3; + inherited; + if GraphFrm = nil then + Application.CreateForm(TGraphFrm, GraphFrm); end; + +procedure TABCNestedForm.AdjustConstraints; +begin + inherited; + + ParamsPanel.Constraints.MinWidth := Max( + 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left, + MaxValue([Label2.Width, Label3.Width, Label4.Width, Label5.Width])*2 + AInBtn.Width + VarList.BorderSpacing.Right*2 + ); + ParamsPanel.Constraints.MinHeight := COutBtn.Top + COutBtn.Height + + VarList.BorderSpacing.Bottom + OptionsGroup.Height + + ButtonBevel.Height + CloseBtn.Height + CloseBtn.BorderSpacing.Top; +end; + + procedure TABCNestedForm.AInBtnClick(Sender: TObject); var index: integer; @@ -164,6 +163,7 @@ begin UpdateBtnStates; end; + procedure TABCNestedForm.CInBtnClick(Sender: TObject); var index: integer; @@ -177,7 +177,19 @@ begin UpdateBtnStates; end; -procedure TABCNestedForm.ComputeBtnClick(Sender: TObject); + +procedure TABCNestedForm.COutBtnClick(Sender: TObject); +begin + if FactorCEdit.Text <> '' then + begin + VarList.Items.Add(FactorCEdit.Text); + FactorCEdit.Text := ''; + end; + UpdateBtnStates; +end; + + +procedure TABCNestedForm.Compute; var lReport: TStrings; begin @@ -198,15 +210,6 @@ begin end; end; -procedure TABCNestedForm.COutBtnClick(Sender: TObject); -begin - if FactorCEdit.Text <> '' then - begin - VarList.Items.Add(FactorCEdit.Text); - FactorCEdit.Text := ''; - end; - UpdateBtnStates; -end; procedure TABCNestedForm.DepInBtnClick(Sender: TObject); var @@ -221,6 +224,7 @@ begin UpdateBtnStates; end; + procedure TABCNestedForm.DepOutBtnClick(Sender: TObject); begin if DepEdit.Text <> '' then @@ -231,30 +235,6 @@ begin UpdateBtnStates; end; -procedure TABCNestedForm.FormActivate(Sender: TObject); -var - w: Integer; -begin - if FAutoSized then - exit; - - w := {%H-}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 TABCNestedForm.FormCreate(Sender: TObject); -begin - Assert(OS3MainFrm <> nil); - if GraphFrm = nil then - Application.CreateForm(TGraphFrm, GraphFrm); -end; function TABCNestedForm.GetVars: Boolean; var @@ -272,12 +252,12 @@ begin BCol := 0; CCol := 0; YCol := 0; - MinA := 1000; - MaxA := -1000; - MinB := 1000; - MaxB := -1000; - MinC := 1000; - MaxC := -1000; + MinA := MaxInt; + MaxA := -MaxInt; + MinB := MaxInt; + MaxB := -MaxInt; + MinC := MaxInt; + MaxC := -MaxInt; for i := 1 to NoVariables do begin strvalue := Trim(OS3MainFrm.DataGrid.Cells[i,0]); @@ -334,6 +314,7 @@ begin Result := true; end; + procedure TABCNestedForm.GetMemory; begin SetLength(SS,NoBLevels,NoALevels,NoCLevels); @@ -368,6 +349,7 @@ begin SetLength(ABSDs,NoALevels,NoBLevels); end; + procedure TABCNestedForm.GetSums; VAR Aindex, Bindex, Cindex, i, j, k: integer; @@ -545,12 +527,13 @@ begin SumSqrTot := SumSqrTot * SumSqrTot; end; + procedure TABCNestedForm.ShowMeans(AReport: TStrings); var i, j, k : integer; begin AReport.Add('Nested ANOVA by Bill Miller'); - AReport.Add('File Analyzed = %s', [OS3MainFrm.FileNameEdit.Text]); + AReport.Add('File Analyzed: %s', [OS3MainFrm.FileNameEdit.Text]); AReport.Add(''); AReport.Add('CELL MEANS'); @@ -603,6 +586,7 @@ begin // OutputFrm.ShowModal; end; + procedure TABCNestedForm.GetResults; VAR temp, temp2, temp3, temp4, constant : double; @@ -700,6 +684,7 @@ begin MSW := SSW / dfwcell; end; + procedure TABCNestedForm.ShowResults(AReport: TStrings); VAR F, PF : double; @@ -731,9 +716,10 @@ begin AReport.Add('w.cells %4D %10.3f%10.3f', [dfwcell, SSW, MSW]); AReport.Add('Total %4D %10.3f', [dftotal, SSTot]); - DisplayReport(AReport); + FReportFrame.DisplayReport(AReport); end; + procedure TABCNestedForm.ReleaseMemory; begin ColNoSelected := nil; @@ -769,14 +755,37 @@ begin SS := nil; end; + +procedure TABCNestedForm.Reset; +var + i: integer; +begin + inherited; + + VarList.Items.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); + + FactorAEdit.Clear; + FactorBEdit.Clear; + FactorCEdit.Clear; + DepEdit.Clear; + + OptionsGroup.ItemIndex := 3; + OptionsGroup.ItemIndex := 3; + + UpdateBtnStates; +end; + + procedure TABCNestedForm.TwoWayPlot; -VAR +var plottype, i, j, k : integer; maxmean, XBar : double; title, setstring : string; XValue : DblDyneVec = nil; begin - case OptionsBox.ItemIndex of + case OptionsGroup.ItemIndex of 0: plottype := 9; 1: plottype := 10; 2: plottype := 1; @@ -976,13 +985,11 @@ begin XValue := nil; end; -procedure TABCNestedForm.VarListSelectionChange(Sender: TObject; User: boolean); -begin - UpdateBtnStates; -end; procedure TABCNestedForm.UpdateBtnStates; begin + inherited; + AInBtn.Enabled := (VarList.ItemIndex > -1) and (FactorAEdit.Text = ''); BInBtn.Enabled := (VarList.ItemIndex > -1) and (FactorBEdit.Text = ''); CInBtn.Enabled := (VarList.ItemIndex > -1) and (FactorCEdit.Text = ''); @@ -993,8 +1000,33 @@ begin DepOutBtn.Enabled := (DepEdit.Text <> ''); end; -initialization - {$I abcnestedunit.lrs} + +procedure TABCNestedForm.VarListDblClick(Sender: TObject); +var + index: Integer; + s: String; +begin + index := VarList.ItemIndex; + if index > -1 then begin + s := VarList.Items[index]; + if FactorAEdit.Text = '' then + FactorAEdit.Text := s + else if FactorBEdit.Text = '' then + FactorBEdit.Text := s + else if FactorCEdit.Text = '' then + FactorCEdit.Text := s + else if DepEdit.Text = '' then + DepEdit.Text := s; + UpdateBtnStates; + end; +end; + + +procedure TABCNestedForm.VarListSelectionChange(Sender: TObject; User: boolean); +begin + UpdateBtnStates; +end; + end. diff --git a/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.lfm b/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.lfm index e76858926..2b7854ed3 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.lfm +++ b/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.lfm @@ -11,7 +11,7 @@ object BNestedAForm: TBNestedAForm OnCreate = FormCreate OnShow = ResetBtnClick Position = poMainFormCenter - LCLVersion = '2.1.0.0' + LCLVersion = '2.0.10.0' object Label1: TLabel AnchorSideLeft.Control = Owner AnchorSideTop.Control = Memo1 @@ -295,7 +295,7 @@ object BNestedAForm: TBNestedAForm end object OptionsBox: TRadioGroup AnchorSideLeft.Control = Owner - AnchorSideBottom.Control = Bevel1 + AnchorSideBottom.Control = ButtonBevel Left = 8 Height = 72 Top = 377 @@ -355,7 +355,7 @@ object BNestedAForm: TBNestedAForm ParentColor = False WordWrap = True end - object Bevel1: TBevel + object ButtonBevel: TBevel AnchorSideLeft.Control = Owner AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom diff --git a/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.pas b/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.pas index 488effd7a..b7f212ac3 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/bnestaunit.pas @@ -18,7 +18,7 @@ type AInBtn: TBitBtn; AOutBtn: TBitBtn; BCodes: TEdit; - Bevel1: TBevel; + ButtonBevel: TBevel; BInBtn: TBitBtn; BOutBtn: TBitBtn; Memo1: TLabel;