diff --git a/applications/lazstats/LazStats.hlp b/applications/lazstats/LazStats.hlp index 8f2dabd52..b9b25c144 100644 --- a/applications/lazstats/LazStats.hlp +++ b/applications/lazstats/LazStats.hlp @@ -69,4 +69,5 @@ correlation, means, standard deviations and confidence interval for each correla 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. 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. \ No newline at end of file +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 diff --git a/applications/lazstats/source/LazStats.lpi b/applications/lazstats/source/LazStats.lpi index 62bd5cbe5..eaeaef4b8 100644 --- a/applications/lazstats/source/LazStats.lpi +++ b/applications/lazstats/source/LazStats.lpi @@ -323,7 +323,7 @@ - + diff --git a/applications/lazstats/source/forms/analysis/comparisons/axsanovaunit.pas b/applications/lazstats/source/forms/analysis/comparisons/axsanovaunit.pas index 52abba7ef..cbbf58030 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/axsanovaunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/axsanovaunit.pas @@ -99,11 +99,11 @@ type procedure TukeyBTest( ErrorMS : double; { within groups error } ErrorDF : double; { degrees of freedom within } - group_total : DblDyneVec; { vector of group sums } - group_count : DblDyneVec; { vector of group n's } - min_grp : integer; { smallest group code } - max_grp : integer; { largest group code } - groupsize : double; { size of groups (all equal) } + group_total : DblDyneVec; { vector of group sums } + group_count : DblDyneVec; { vector of group n's } + min_grp : integer; { smallest group code } + max_grp : integer; { largest group code } + groupsize : double; { size of groups (all equal) } AReport : TStrings); public diff --git a/applications/lazstats/source/forms/analysis/comparisons/ttestunit.lfm b/applications/lazstats/source/forms/analysis/comparisons/ttestunit.lfm index fa69df7e2..be49fb42f 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/ttestunit.lfm +++ b/applications/lazstats/source/forms/analysis/comparisons/ttestunit.lfm @@ -1,684 +1,706 @@ -object TtestFrm: TTtestFrm - Left = 629 - Height = 505 - Top = 216 - Width = 544 +inherited TtestForm: TTtestForm + Left = 947 + Height = 546 + Top = 176 + Width = 889 HelpType = htKeyword HelpKeyword = 'html/tTests.htm' - AutoSize = True Caption = 'Comparison of Two Sample Means' - ClientHeight = 505 - ClientWidth = 544 - OnActivate = FormActivate - OnCreate = FormCreate - OnShow = FormShow - Position = poMainFormCenter - LCLVersion = '2.1.0.0' - object Label1: TLabel - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = CloseBtn - AnchorSideTop.Side = asrCenter - Left = 8 - Height = 15 - Top = 477 - Width = 149 - BorderSpacing.Left = 8 - Caption = 'Percent Confidence Interval:' - ParentColor = False - end - object RadioGroup1: TRadioGroup - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = Owner - Left = 8 - Height = 72 - Top = 8 - Width = 195 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - Caption = 'Data Entry By:' - ChildSizing.LeftRightSpacing = 12 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.VerticalSpacing = 2 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 52 - ClientWidth = 191 - Items.Strings = ( - 'Values Entered on this Form' - 'Values in the data grid file' - ) - OnClick = RadioGroup1Click - TabOrder = 0 - end - object RadioGroup2: TRadioGroup - AnchorSideLeft.Control = RadioGroup1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Owner - Left = 219 - Height = 72 - Top = 8 - Width = 152 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 16 - BorderSpacing.Top = 8 - Caption = 'Test Assumptions:' - ChildSizing.LeftRightSpacing = 12 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.VerticalSpacing = 2 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 52 - ClientWidth = 148 - Items.Strings = ( - 'Independent Scores' - 'Correlated Scores' - ) - OnClick = RadioGroup2Click - TabOrder = 1 - end - object CInterval: TEdit - AnchorSideLeft.Control = Label1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = ResetBtn - AnchorSideTop.Side = asrCenter - Left = 165 - Height = 23 - Top = 473 - Width = 46 - Alignment = taRightJustify - BorderSpacing.Left = 8 - TabOrder = 4 - Text = '95.0' - end - object ResetBtn: TButton - AnchorSideRight.Control = ComputeBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 331 - Height = 25 - Top = 472 - Width = 54 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 12 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Reset' - OnClick = ResetBtnClick - TabOrder = 5 - end - object ComputeBtn: TButton - AnchorSideRight.Control = CloseBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 393 - Height = 25 - Top = 472 - Width = 76 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Compute' - OnClick = ComputeBtnClick - TabOrder = 6 - end - object CloseBtn: TButton - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 477 - Height = 25 - Top = 472 - Width = 55 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 12 - BorderSpacing.Bottom = 8 - Caption = 'Close' - ModalResult = 11 - TabOrder = 7 - end - object RadioGroup3: TRadioGroup - AnchorSideLeft.Control = RadioGroup2 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Owner - Left = 387 - Height = 72 - Top = 8 - Width = 140 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 16 - BorderSpacing.Top = 8 - Caption = 'Test Probability' - ChildSizing.LeftRightSpacing = 6 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.VerticalSpacing = 2 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 52 - ClientWidth = 136 - ItemIndex = 0 - Items.Strings = ( - 'Two-tailed (default)' - 'One-tailed' - ) - TabOrder = 2 - end - object Notebook1: TNotebook - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = Bevel3 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Bevel2 - Left = 8 - Height = 360 - Top = 96 - Width = 528 - PageIndex = 0 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - TabOrder = 3 - object Page1: TPage - object Panel2: TPanel - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = Page1 - Left = 48 - Height = 117 - Top = 16 - Width = 433 - AutoSize = True - BorderSpacing.Top = 16 - BevelOuter = bvNone - ClientHeight = 117 - ClientWidth = 433 - TabOrder = 0 + ClientHeight = 546 + ClientWidth = 889 + inherited ParamsPanel: TPanel + Height = 530 + Width = 368 + ClientHeight = 530 + ClientWidth = 368 + inherited CloseBtn: TButton + Left = 313 + Top = 505 + TabOrder = 8 + end + inherited ComputeBtn: TButton + Left = 229 + Top = 505 + TabOrder = 7 + end + inherited ResetBtn: TButton + Left = 167 + Top = 505 + TabOrder = 6 + end + inherited HelpBtn: TButton + Tag = 169 + Left = 108 + Top = 505 + TabOrder = 5 + end + inherited ButtonBevel: TBevel + Top = 489 + Width = 368 + end + object Label1: TLabel[5] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = CInterval + AnchorSideTop.Side = asrCenter + Left = 0 + Height = 15 + Top = 115 + Width = 149 + Caption = 'Percent Confidence Interval:' + ParentColor = False + end + object CInterval: TEdit[6] + AnchorSideLeft.Control = Label1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = TailCombo + AnchorSideTop.Side = asrBottom + Left = 157 + Height = 23 + Top = 111 + Width = 70 + Alignment = taRightJustify + BorderSpacing.Left = 8 + BorderSpacing.Top = 8 + BorderSpacing.Bottom = 4 + TabOrder = 3 + Text = '95.0' + end + object Notebook: TNotebook[7] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = Bevel3 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = ButtonBevel + Left = 0 + Height = 335 + Top = 154 + Width = 368 + PageIndex = 0 + Anchors = [akTop, akLeft, akRight, akBottom] + TabOrder = 4 + object Page1: TPage object Mean1Label: TLabel - AnchorSideTop.Control = Mean1 - AnchorSideTop.Side = asrCenter - Left = 8 + AnchorSideLeft.Control = Mean1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Page1 + Left = 83 Height = 15 - Top = 4 + Top = 32 Width = 39 - BorderSpacing.Left = 8 + BorderSpacing.Top = 32 Caption = 'Mean 1' ParentColor = False end object Mean2Label: TLabel - AnchorSideTop.Control = Mean2 - AnchorSideTop.Side = asrCenter + AnchorSideTop.Control = Mean1 + AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Mean1Label AnchorSideRight.Side = asrBottom - Left = 8 + Left = 83 Height = 15 - Top = 51 + Top = 104 Width = 39 Anchors = [akTop, akRight] - BorderSpacing.Left = 8 + BorderSpacing.Top = 32 Caption = 'Mean 2' ParentColor = False end object SD1Label: TLabel - AnchorSideLeft.Control = Mean1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = SD1 - AnchorSideTop.Side = asrCenter - Left = 145 + AnchorSideLeft.Control = SD1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Mean1Label + Left = 157 Height = 15 - Top = 4 + Top = 32 Width = 55 - BorderSpacing.Left = 24 + BorderSpacing.Left = 20 Caption = 'Std. Dev. 1' ParentColor = False end object SD2Label: TLabel - AnchorSideTop.Control = SD2 - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = SD2 - Left = 145 + AnchorSideLeft.Control = SD2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Mean2Label + Left = 157 Height = 15 - Top = 51 + Top = 104 Width = 55 - Anchors = [akTop, akRight] BorderSpacing.Right = 8 Caption = 'Std. Dev. 2' ParentColor = False end object SampSize1Label: TLabel - AnchorSideLeft.Control = SD1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = N1 - AnchorSideTop.Side = asrCenter - Left = 292 + AnchorSideLeft.Control = N1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Mean1Label + Left = 231 Height = 15 - Top = 4 + Top = 32 Width = 71 - BorderSpacing.Left = 24 + BorderSpacing.Left = 20 Caption = 'Sample Size 1' ParentColor = False end object SampSize2Label: TLabel - AnchorSideTop.Control = N2 - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = N2 - Left = 292 + AnchorSideLeft.Control = N2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Mean2Label + Left = 231 Height = 15 - Top = 51 + Top = 104 Width = 71 - Anchors = [akTop] BorderSpacing.Right = 8 Caption = 'Sample Size 2' ParentColor = False end - object CorBetweenLabel: TLabel - AnchorSideTop.Control = Cor12 - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = Cor12 - Left = 60 + object Cor12Label: TLabel + AnchorSideLeft.Control = Cor12 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = SD2 + AnchorSideTop.Side = asrBottom + Left = 111 Height = 15 - Top = 98 + Top = 176 Width = 147 - Anchors = [akTop, akRight] + BorderSpacing.Top = 32 BorderSpacing.Right = 8 Caption = 'Correlation Between Scores:' ParentColor = False end object Mean1: TEdit - AnchorSideLeft.Control = Mean1Label AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Panel2 - Left = 55 + AnchorSideTop.Control = Mean1Label + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = SD1 + Left = 77 Height = 23 - Top = 0 - Width = 66 + Top = 49 + Width = 50 Alignment = taRightJustify - BorderSpacing.Left = 8 + Anchors = [akTop, akRight] + BorderSpacing.Left = 6 + BorderSpacing.Top = 2 + BorderSpacing.Right = 32 TabOrder = 0 Text = 'Mean1' end object Mean2: TEdit AnchorSideLeft.Control = Mean1 - AnchorSideTop.Control = Mean1 + AnchorSideTop.Control = Mean2Label AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Mean1 AnchorSideRight.Side = asrBottom - Left = 55 + Left = 77 Height = 23 - Top = 47 - Width = 66 + Top = 121 + Width = 50 Alignment = taRightJustify - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 24 - TabOrder = 3 + Anchors = [akTop, akRight] + BorderSpacing.Top = 2 + TabOrder = 1 Text = 'Mean2' end object SD1: TEdit - AnchorSideLeft.Control = SD1Label - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Panel2 - Left = 208 + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Mean1 + Left = 159 Height = 23 - Top = 0 - Width = 60 + Top = 49 + Width = 50 Alignment = taRightJustify - BorderSpacing.Left = 8 - TabOrder = 1 + BorderSpacing.Left = 6 + TabOrder = 2 Text = 'SD1' end object SD2: TEdit AnchorSideLeft.Control = SD1 - AnchorSideTop.Control = SD1 - AnchorSideTop.Side = asrBottom + AnchorSideTop.Control = Mean2 AnchorSideRight.Control = SD1 AnchorSideRight.Side = asrBottom - Left = 208 + Left = 159 Height = 23 - Top = 47 - Width = 60 + Top = 121 + Width = 50 Alignment = taRightJustify - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 24 - TabOrder = 4 + Anchors = [akTop, akRight] + TabOrder = 3 Text = 'SD2' end object N1: TEdit - AnchorSideLeft.Control = SampSize1Label + AnchorSideLeft.Control = SD1 AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Panel2 - Left = 371 + AnchorSideTop.Control = Mean1 + Left = 241 Height = 23 - Top = 0 - Width = 62 + Top = 49 + Width = 50 Alignment = taRightJustify - BorderSpacing.Left = 8 - TabOrder = 2 + BorderSpacing.Left = 32 + TabOrder = 4 Text = 'N1' end object N2: TEdit AnchorSideLeft.Control = N1 - AnchorSideTop.Control = N1 - AnchorSideTop.Side = asrBottom + AnchorSideTop.Control = Mean2 AnchorSideRight.Control = N1 AnchorSideRight.Side = asrBottom - Left = 371 + Left = 241 Height = 23 - Top = 47 - Width = 62 + Top = 121 + Width = 50 Alignment = taRightJustify - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 24 + Anchors = [akTop, akRight] TabOrder = 5 Text = 'N2' end object Cor12: TEdit AnchorSideLeft.Control = SD1 AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = SD2 + AnchorSideTop.Control = Cor12Label AnchorSideTop.Side = asrBottom - Left = 215 + Left = 159 Height = 23 - Top = 94 - Width = 47 + Top = 193 + Width = 50 Alignment = taRightJustify - BorderSpacing.Top = 24 + BorderSpacing.Top = 2 TabOrder = 6 Text = 'Cor12' end end - end - object Page2: TPage - object Memo1: TLabel - AnchorSideLeft.Control = Page2 - AnchorSideTop.Control = Page2 - AnchorSideRight.Control = Page2 - AnchorSideRight.Side = asrBottom - Left = 0 - Height = 75 - Top = 0 - Width = 528 - Anchors = [akTop, akLeft, akRight] - Caption = 'Directions: '#13#10'For independent groups data, first click the variable to be analyzed then click the variable containing group codes. '#13#10'For dependent variables it is assumed the data for each pair of values are in a case. '#13#10'Enter the names of those two variables.' - ParentColor = False - WordWrap = True - end - object SelVarLabel: TLabel - AnchorSideLeft.Control = Page2 - AnchorSideTop.Control = Memo1 - AnchorSideTop.Side = asrBottom - Left = 0 - Height = 15 - Top = 91 - Width = 83 - BorderSpacing.Top = 16 - Caption = 'Select Variables:' - ParentColor = False - end - object ListBox1: TListBox - AnchorSideLeft.Control = Page2 - AnchorSideTop.Control = SelVarLabel - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Bevel1 - AnchorSideBottom.Control = Page2 - AnchorSideBottom.Side = asrBottom - Left = 0 - Height = 252 - Top = 108 - Width = 256 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Top = 2 - ItemHeight = 0 - OnClick = ListBox1Click - TabOrder = 0 - end - object Bevel1: TBevel - AnchorSideLeft.Control = Page2 - AnchorSideLeft.Side = asrCenter - Left = 256 - Height = 91 - Top = 92 - Width = 16 - Shape = bsSpacer - end - object FirstVarLabel: TLabel - AnchorSideLeft.Control = Bevel1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Var1 - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = Var1 - Left = 284 - Height = 15 - Top = 112 - Width = 62 - Alignment = taRightJustify - BorderSpacing.Left = 12 - BorderSpacing.Right = 8 - Caption = '1st Variable:' - ParentColor = False - end - object SecdVarLabel: TLabel - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Var2 - Left = 279 - Height = 15 - Top = 143 - Width = 67 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Right = 8 - Caption = '2nd Variable:' - ParentColor = False - end - object GrpLabel: TLabel - AnchorSideTop.Control = Grp - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = Grp - Left = 279 - Height = 15 - Top = 143 - Width = 67 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Right = 8 - Caption = 'Group Code:' - ParentColor = False - end - object Bevel5: TBevel - Left = 273 - Height = 11 - Top = 92 - Width = 87 - Shape = bsSpacer - end - object Var1: TEdit - AnchorSideLeft.Control = FirstVarLabel - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = ListBox1 - AnchorSideRight.Control = Page2 - AnchorSideRight.Side = asrBottom - Left = 354 - Height = 23 - Top = 108 - Width = 174 - Anchors = [akTop, akLeft, akRight] - TabOrder = 1 - Text = 'Var1' - end - object Var2: TEdit - AnchorSideLeft.Control = Var1 - AnchorSideTop.Control = Var1 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Var1 - AnchorSideRight.Side = asrBottom - Left = 354 - Height = 23 - Top = 139 - Width = 174 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 8 - TabOrder = 2 - Text = 'Var2' - end - object Grp: TEdit - AnchorSideLeft.Control = Var1 - AnchorSideTop.Control = Var1 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Var2 - AnchorSideRight.Side = asrBottom - Left = 354 - Height = 23 - Top = 139 - Width = 174 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 8 - TabOrder = 3 - Text = 'Grp' - end - object GroupBox1: TGroupBox - AnchorSideLeft.Control = Grp - AnchorSideTop.Control = Grp - AnchorSideTop.Side = asrBottom - Left = 354 - Height = 90 - Top = 170 - Width = 164 - AutoSize = True - BorderSpacing.Top = 8 - ClientHeight = 70 - ClientWidth = 160 - TabOrder = 5 - object Grp1Code: TEdit - AnchorSideTop.Control = GroupBox1 - AnchorSideRight.Control = GroupBox1 - AnchorSideRight.Side = asrBottom - Left = 100 - Height = 23 - Top = 8 - Width = 52 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - Enabled = False - TabOrder = 0 - Text = 'Grp1Code' + object Page2: TPage + object SelVarLabel: TLabel + AnchorSideLeft.Control = Page2 + AnchorSideTop.Control = Page2 + Left = 0 + Height = 15 + Top = 0 + Width = 83 + Caption = 'Select Variables:' + ParentColor = False end - object Grp2Code: TEdit - AnchorSideTop.Control = Grp1Code + object VarList: TListBox + AnchorSideLeft.Control = Page2 + AnchorSideTop.Control = SelVarLabel AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = GroupBox1 + AnchorSideRight.Control = Var1In + AnchorSideBottom.Control = Page2 + AnchorSideBottom.Side = asrBottom + Left = 0 + Height = 318 + Top = 17 + Width = 165 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 2 + BorderSpacing.Right = 6 + ItemHeight = 0 + OnDblClick = VarListDblClick + OnSelectionChange = VarListSelectionChange + TabOrder = 0 + end + object Var1Label: TLabel + AnchorSideLeft.Control = Var1Edit + AnchorSideTop.Side = asrCenter + AnchorSideBottom.Control = Var1Edit + Left = 203 + Height = 15 + Top = 25 + Width = 62 + Alignment = taRightJustify + Anchors = [akLeft, akBottom] + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 2 + Caption = '1st Variable:' + ParentColor = False + end + object Var2Label: TLabel + AnchorSideLeft.Control = Var2Edit + AnchorSideBottom.Control = Var2Edit + Left = 203 + Height = 15 + Top = 101 + Width = 67 + Alignment = taRightJustify + Anchors = [akLeft, akBottom] + BorderSpacing.Right = 8 + Caption = '2nd Variable:' + ParentColor = False + end + object GrpLabel: TLabel + AnchorSideLeft.Control = GrpEdit + AnchorSideTop.Side = asrCenter + AnchorSideBottom.Control = GrpEdit + Left = 203 + Height = 15 + Top = 177 + Width = 67 + Alignment = taRightJustify + Anchors = [akLeft, akBottom] + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 2 + Caption = 'Group Code:' + ParentColor = False + end + object Bevel5: TBevel + Left = 273 + Height = 11 + Top = 92 + Width = 87 + Shape = bsSpacer + end + object Var1Edit: TEdit + AnchorSideLeft.Control = Var1In + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = Page2 AnchorSideRight.Side = asrBottom - Left = 100 + AnchorSideBottom.Control = Var1Out + AnchorSideBottom.Side = asrBottom + Left = 203 Height = 23 - Top = 39 - Width = 52 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 + Top = 42 + Width = 165 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 6 BorderSpacing.Bottom = 8 - Enabled = False + ReadOnly = True + TabOrder = 3 + Text = 'Var1Edit' + end + object Var2Edit: TEdit + AnchorSideLeft.Control = Var1Edit + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Var1Edit + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Var2Out + AnchorSideBottom.Side = asrBottom + Left = 203 + Height = 23 + Top = 118 + Width = 165 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Top = 2 + BorderSpacing.Bottom = 8 + ReadOnly = True + TabOrder = 6 + Text = 'Var2Edit' + end + object GrpEdit: TEdit + AnchorSideLeft.Control = Var1Edit + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Var2Edit + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GrpOut + AnchorSideBottom.Side = asrBottom + Left = 203 + Height = 23 + Top = 194 + Width = 165 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Top = 2 + BorderSpacing.Bottom = 8 + ReadOnly = True + TabOrder = 9 + Text = 'GrpEdit' + end + object GroupCodeGroup: TGroupBox + AnchorSideLeft.Control = GrpIn + AnchorSideTop.Control = GrpOut + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 90 + Top = 245 + Width = 164 + AutoSize = True + BorderSpacing.Top = 20 + ClientHeight = 70 + ClientWidth = 160 + TabOrder = 10 + object Grp1CodeEdit: TEdit + AnchorSideTop.Control = GroupCodeGroup + AnchorSideRight.Control = GroupCodeGroup + AnchorSideRight.Side = asrBottom + Left = 100 + Height = 23 + Top = 8 + Width = 52 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 8 + BorderSpacing.Right = 8 + Enabled = False + TabOrder = 0 + Text = 'Grp1CodeEdit' + end + object Grp2CodeEdit: TEdit + AnchorSideTop.Control = Grp1CodeEdit + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GroupCodeGroup + AnchorSideRight.Side = asrBottom + Left = 100 + Height = 23 + Top = 39 + Width = 52 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Top = 8 + BorderSpacing.Right = 8 + BorderSpacing.Bottom = 8 + Enabled = False + TabOrder = 1 + Text = 'Grp2CodeEdit' + end + object GrpCodeLabel1: TLabel + AnchorSideTop.Control = Grp1CodeEdit + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = Grp1CodeEdit + Left = 16 + Height = 15 + Top = 12 + Width = 76 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Left = 16 + BorderSpacing.Right = 8 + Caption = 'Group 1 Code:' + Enabled = False + ParentColor = False + end + object GrpCodeLabel2: TLabel + AnchorSideTop.Control = Grp2CodeEdit + AnchorSideTop.Side = asrCenter + AnchorSideRight.Control = Grp2CodeEdit + Left = 16 + Height = 15 + Top = 43 + Width = 76 + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.Right = 8 + Caption = 'Group 2 Code:' + Enabled = False + ParentColor = False + end + end + object GroupCodeChk: TCheckBox + AnchorSideLeft.Control = GroupCodeGroup + AnchorSideTop.Control = GroupCodeGroup + Left = 183 + Height = 19 + Top = 245 + Width = 130 + BorderSpacing.Left = 12 + Caption = 'Specify Group Codes' + OnChange = GroupCodeChkChange + TabOrder = 11 + end + object Var1In: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = VarList + Left = 171 + Height = 26 + Top = 17 + Width = 26 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = Var1InClick + Spacing = 0 TabOrder = 1 - Text = 'Grp2Code' end - object GrpCodeLabel1: TLabel - AnchorSideTop.Control = Grp1Code - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = Grp1Code - Left = 16 - Height = 15 - Top = 12 - Width = 76 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Left = 16 - BorderSpacing.Right = 8 - Caption = 'Group 1 Code:' - Enabled = False - ParentColor = False + object Var1Out: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Var1In + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 26 + Top = 47 + Width = 26 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = Var1OutClick + Spacing = 0 + TabOrder = 2 end - object GrpCodeLabel2: TLabel - AnchorSideTop.Control = Grp2Code - AnchorSideTop.Side = asrCenter - AnchorSideRight.Control = Grp2Code - Left = 16 - Height = 15 - Top = 43 - Width = 76 - Alignment = taRightJustify - Anchors = [akTop, akRight] - BorderSpacing.Right = 8 - Caption = 'Group 2 Code:' - Enabled = False - ParentColor = False + object Var2In: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Var1Out + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 26 + Top = 93 + Width = 26 + BorderSpacing.Top = 20 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = Var2InClick + Spacing = 0 + TabOrder = 4 + end + object Var2Out: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Var2In + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 26 + Top = 123 + Width = 26 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = Var2OutClick + Spacing = 0 + TabOrder = 5 + end + object GrpIn: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Var2Out + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 26 + Top = 169 + Width = 26 + BorderSpacing.Top = 20 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = GrpInClick + Spacing = 0 + TabOrder = 7 + end + object GrpOut: TBitBtn + AnchorSideLeft.Control = Page2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = GrpIn + AnchorSideTop.Side = asrBottom + Left = 171 + Height = 26 + Top = 199 + Width = 26 + BorderSpacing.Top = 4 + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = GrpOutClick + Spacing = 0 + TabOrder = 8 end - end - object GroupCodeBtn: TCheckBox - AnchorSideLeft.Control = GroupBox1 - AnchorSideTop.Control = GroupBox1 - Left = 362 - Height = 19 - Top = 170 - Width = 130 - BorderSpacing.Left = 8 - Caption = 'Specify Group Codes' - OnChange = GroupCodeBtnChange - TabOrder = 4 end end + object DataEntryGroup: TRadioGroup[8] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = ParamsPanel + Left = 0 + Height = 72 + Top = 0 + Width = 195 + AutoFill = True + AutoSize = True + Caption = 'Data Entry By:' + ChildSizing.LeftRightSpacing = 12 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.VerticalSpacing = 2 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 52 + ClientWidth = 191 + Items.Strings = ( + 'Values Entered on this Form' + 'Values in the data grid file' + ) + OnClick = DataEntryGroupClick + TabOrder = 0 + end + object DepIndepGroup: TRadioGroup[9] + AnchorSideLeft.Control = DataEntryGroup + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = ParamsPanel + Left = 211 + Height = 72 + Top = 0 + Width = 152 + AutoFill = True + AutoSize = True + BorderSpacing.Left = 16 + Caption = 'Test Assumptions:' + ChildSizing.LeftRightSpacing = 12 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.VerticalSpacing = 2 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 52 + ClientWidth = 148 + Items.Strings = ( + 'Independent Scores' + 'Correlated Scores' + ) + OnClick = DepIndepGroupClick + TabOrder = 1 + end + object Bevel3: TBevel[10] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = CInterval + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + Left = 0 + Height = 8 + Top = 138 + Width = 368 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Bottom = 8 + Shape = bsBottomLine + end + object Label2: TLabel[11] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = TailCombo + AnchorSideTop.Side = asrCenter + Left = 0 + Height = 15 + Top = 84 + Width = 83 + Caption = 'Test Probability:' + ParentColor = False + end + object TailCombo: TComboBox[12] + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = DataEntryGroup + AnchorSideTop.Side = asrBottom + Left = 91 + Height = 23 + Top = 80 + Width = 165 + BorderSpacing.Left = 8 + BorderSpacing.Top = 8 + ItemHeight = 15 + ItemIndex = 0 + Items.Strings = ( + 'Two-tailed (default)' + 'One-tailed' + ) + Style = csDropDownList + TabOrder = 2 + Text = 'Two-tailed (default)' + end end - object Bevel2: TBevel - AnchorSideLeft.Control = Owner - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = CloseBtn - Left = 0 - Height = 8 - Top = 456 - Width = 544 - Anchors = [akLeft, akRight, akBottom] - Shape = bsBottomLine + inherited ParamsSplitter: TSplitter + Left = 380 + Height = 546 end - object Bevel3: TBevel - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = RadioGroup1 - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - Left = 0 - Height = 8 - Top = 80 - Width = 544 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Bottom = 8 - Shape = bsBottomLine - end - object Bevel4: TBevel + object Bevel4: TBevel[2] Left = 5 Height = 11 Top = 382 diff --git a/applications/lazstats/source/forms/analysis/comparisons/ttestunit.pas b/applications/lazstats/source/forms/analysis/comparisons/ttestunit.pas index edcd3a4c8..b943cacfa 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/ttestunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/ttestunit.pas @@ -5,45 +5,44 @@ unit TTestUnit; interface uses - Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - ExtCtrls, StdCtrls, - MainUnit, Globals, OutputUnit, DataProcs; + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, + ExtCtrls, StdCtrls, Buttons, + MainUnit, Globals, BasicStatsReportFormUnit; type - { TTtestFrm } + { TTtestForm } - TTtestFrm = class(TForm) - Bevel1: TBevel; - Bevel2: TBevel; + TTtestForm = class(TBasicStatsReportForm) Bevel3: TBevel; Bevel4: TBevel; Bevel5: TBevel; - GroupBox1: TGroupBox; - GroupCodeBtn: TCheckBox; - Grp1Code: TEdit; - Grp2Code: TEdit; + TailCombo: TComboBox; + GroupCodeGroup: TGroupBox; + GroupCodeChk: TCheckBox; + Grp1CodeEdit: TEdit; + Grp2CodeEdit: TEdit; GrpCodeLabel1: TLabel; GrpCodeLabel2: TLabel; - Memo1: TLabel; - Notebook1: TNotebook; + GrpIn: TBitBtn; + GrpOut: TBitBtn; + Label2: TLabel; + Notebook: TNotebook; Page1: TPage; Page2: TPage; - RadioGroup3: TRadioGroup; - ResetBtn: TButton; - ComputeBtn: TButton; - CloseBtn: TButton; - CorBetweenLabel: TLabel; + Cor12Label: TLabel; Cor12: TEdit; CInterval: TEdit; - Grp: TEdit; + GrpEdit: TEdit; Label1: TLabel; - Var2: TEdit; - Var1: TEdit; - FirstVarLabel: TLabel; + Var1In: TBitBtn; + Var1Out: TBitBtn; + Var2Edit: TEdit; + Var1Edit: TEdit; + Var1Label: TLabel; GrpLabel: TLabel; - SecdVarLabel: TLabel; - ListBox1: TListBox; + Var2Label: TLabel; + VarList: TListBox; SelVarLabel: TLabel; N2: TEdit; N1: TEdit; @@ -57,129 +56,88 @@ type Mean1: TEdit; Mean2Label: TLabel; Mean1Label: TLabel; - Panel2: TPanel; - RadioGroup1: TRadioGroup; - RadioGroup2: TRadioGroup; - procedure ComputeBtnClick(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormShow(Sender: TObject); - procedure GroupCodeBtnChange(Sender: TObject); - procedure ListBox1Click(Sender: TObject); - procedure RadioGroup1Click(Sender: TObject); - procedure RadioGroup2Click(Sender: TObject); - procedure ResetBtnClick(Sender: TObject); + DataEntryGroup: TRadioGroup; + DepIndepGroup: TRadioGroup; + Var2In: TBitBtn; + Var2Out: TBitBtn; + procedure GroupCodeChkChange(Sender: TObject); + procedure DataEntryGroupClick(Sender: TObject); + procedure DepIndepGroupClick(Sender: TObject); + procedure GrpInClick(Sender: TObject); + procedure GrpOutClick(Sender: TObject); + procedure Var1InClick(Sender: TObject); + procedure Var1OutClick(Sender: TObject); + procedure Var2InClick(Sender: TObject); + procedure Var2OutClick(Sender: TObject); + procedure VarListDblClick(Sender: TObject); + procedure VarListSelectionChange(Sender: TObject; User: boolean); + private - { private declarations } - FAutoSized: Boolean; independent: boolean; griddata: boolean; - function Validate(out AMsg: String; out AControl: TWinControl): Boolean; + + protected + procedure AdjustConstraints; override; + procedure Compute; override; + procedure UpdateBtnStates; override; + function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override; public - { public declarations } + constructor Create(AOwner: TComponent); override; + procedure Reset; override; end; var - TtestFrm: TTtestFrm; + TtestForm: TTtestForm; + implementation +{$R *.lfm} + uses - Math, MathUnit; + Math, + MathUnit, GridProcs; -{ TTtestFrm } -procedure TTtestFrm.ResetBtnClick(Sender: TObject); -var - i: integer; +{ TTtestForm } + +constructor TTtestForm.Create(AOwner: TComponent); begin + inherited; CInterval.Text := FormatFloat('0.0', DEFAULT_CONFIDENCE_LEVEL_PERCENT); - RadioGroup1.ItemIndex := 0; - RadioGroup2.ItemIndex := 0; - Notebook1.PageIndex := RadioGroup1.ItemIndex; - ListBox1.Clear; - Var1.Text := ''; - Var2.Text := ''; - Mean1.Text := ''; - Mean2.Text := ''; - SD1.Text := ''; - SD2.Text := ''; - N1.Text := ''; - N2.Text := ''; - Cor12.Text := ''; - independent := true; - griddata := false; - GroupCodeBtn.Checked := false; - Grp.Text := ''; - for i := 1 to NoVariables do - ListBox1.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); - Grp.Text := ''; - Grp1Code.Text := ''; - Grp2Code.Text := ''; end; -procedure TTtestFrm.FormActivate(Sender: TObject); -var - w: Integer; + +procedure TTtestForm.AdjustConstraints; begin - if FAutoSized then - exit; + inherited; - w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]); - ResetBtn.Constraints.MinWidth := w; - ComputeBtn.Constraints.MinWidth := w; - CloseBtn.Constraints.MinWidth := w; - - Constraints.MinWidth := CInterval.Left + CInterval.Width + (Width - ResetBtn.Left) + ResetBtn.BorderSpacing.Left; - - Bevel5.Width := SecdVarLabel.Canvas.TextWidth(SecdVarlabel.Caption); - //ListBox1.Constraints.MinHeight := Grp2Code.Top + Grp2Code.Height - Listbox1.Top - Var2.Height - Var2.BorderSpacing.Top; - - //Constraints.MinHeight := ListBox1.Top + ListBox1.Constraints.MinHeight + Bevel2.Height + CloseBtn.Height + CloseBtn.BorderSpacing.Top*2; - FAutoSized := true; + ParamsPanel.Constraints.MinWidth := Max( + DataEntryGroup.Width + DepIndepGroup.BorderSpacing.Left + DepIndepGroup.Width, + 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left + ); + ParamsPanel.Constraints.MinHeight := DataEntryGroup.Height + + TailCombo.BorderSpacing.Top + TailCombo.Height + + CInterval.BorderSpacing.Top + CInterval.Height + CInterval.BorderSpacing.Bottom + + Bevel3.Height + Bevel3.BorderSpacing.Bottom + + GrpIn.Top + GroupCodeGroup.Height + + ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height; end; -procedure TTtestFrm.FormCreate(Sender: TObject); -begin - Assert(OS3MainFrm <> nil); -end; - -procedure TTtestFrm.FormShow(Sender: TObject); -begin - ResetBtnClick(self); -end; - -procedure TTtestFrm.GroupCodeBtnChange(Sender: TObject); -begin - Grp1Code.Enabled := GroupCodeBtn.Checked; - Grp2Code.Enabled := GroupCodeBtn.Checked; - GrpCodeLabel1.Enabled := GroupCodeBtn.Checked; - GrpCodeLabel2.Enabled := GroupCodeBtn.Checked; -end; - -procedure TTtestFrm.ComputeBtnClick(Sender: TObject); + +procedure TTtestForm.Compute; var M1, M2, Dif, stddev1, stddev2, r12, stderr1, stderr2: double; tequal, tunequal, cov12, lowci, hici, F, Fp, df1, df2: double; tprobability, value1, value2: double; variance1, variance2, pooled, sedif, df, ConfInt, tconfint: double; - i, v1, v2, ncases1, ncases2, NoSelected: integer; + i, nCases1, nCases2: integer; group, min, max: integer; ColNoSelected: IntDyneVec = nil; label1Str, label2Str: string; - msg: String; - C: TWinControl; lReport: TStrings; begin - if not Validate(msg, C) then - begin - C.SetFocus; - MessageDlg(msg, mtError, [mbOK], 0); - ModalResult := mrNone; - exit; - end; - SetLength(ColNoSelected,NoVariables); ncases1 := 0; ncases2 := 0; @@ -189,8 +147,6 @@ begin M2 := 0.0; Dif := 0.0; r12 := 0.0; - v1 := 0; - v2 := 0; stddev1 := 0.0; stddev2 := 0.0; @@ -198,30 +154,17 @@ begin ConfInt := (100.0 - ConfInt) / 100.0; // one tail if independent then - Var2.Text := Grp.Text; + Var2Edit.Text := GrpEdit.Text; // data read from grid if griddata then begin - for i := 1 to NoVariables do - begin - if Var1.Text = OS3MainFrm.DataGrid.Cells[i,0] then - begin - v1 := i; - ColNoSelected[0] := i; - label1Str := Var1.Text; - end; - if Var2.Text = OS3MainFrm.DataGrid.Cells[i,0] then - begin - v2 := i; - ColNoSelected[1] := i; - label2Str := Var2.Text; - end; - end; // next variable + SetLength(ColNoSelected, 2); + ColNoSelected[0] := GetVariableIndex(OS3MainFrm.DataGrid, Var1Edit.Text); + ColNoSelected[1] := GetVariableIndex(OS3MainFrm.DataGrid, Var2Edit.Text); ncases1 := 0; ncases2 := 0; - NoSelected := 2; M1 := 0.0; M2 := 0.0; variance1 := 0.0; @@ -231,10 +174,10 @@ begin begin for i := 1 to NoCases do begin - if not GoodRecord(i,NoSelected,ColNoSelected) then continue; + if not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected) then continue; ncases1 := ncases1 + 1; - value1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v1,i])); - value2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v2,i])); + value1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ColNoSelected[0], i])); + value2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ColNoSelected[1], i])); M1 := M1 + value1; M2 := M2 + value2; variance1 := variance1 + value1 * value1; @@ -260,27 +203,21 @@ begin if independent then begin - if GroupCodeBtn.Checked then + if GroupCodeChk.Checked then begin - min := StrToInt(Grp1Code.Text); - max := StrToInt(Grp2Code.Text); - { - response := InputBox('Group 1','Enter the code for group 1','1'); - min := StrToInt(response); - response := InputBox('Group 2','Enter the code for group 2','2'); - max := StrToInt(response); - } + min := StrToInt(Grp1CodeEdit.Text); + max := StrToInt(Grp2CodeEdit.Text); end else begin - min := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v2,1]))); + min := MaxInt; max := min; end; - for i := 2 to NoCases do + for i := 1 to NoCases do begin - if not GoodRecord(i,NoSelected,ColNoSelected) then continue; - group := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v2,i]))); - if GroupCodeBtn.Checked = false then + if not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected) then continue; + group := round(StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ColNoSelected[1], i]))); + if not GroupCodeChk.Checked then begin if group < min then min := group; if group > max then max := group; @@ -289,9 +226,9 @@ begin for i := 1 to NoCases do begin - if not GoodRecord(i,NoSelected,ColNoSelected) then continue; - value1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v1,i])); - value2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[v2,i])); + if not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected) then continue; + value1 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ColNoSelected[0], i])); + value2 := StrToFloat(Trim(OS3MainFrm.DataGrid.Cells[ColNoSelected[1], i])); group := round(value2); if group = min then begin @@ -340,7 +277,6 @@ begin end; end; - // Initialize output form lReport := TStringList.Create; try @@ -363,8 +299,8 @@ begin sedif := sqrt(pooled); tequal := dif / sedif; df := ncases1 + ncases2 - 2; - tprobability := probt(tequal,df); - if RadioGroup3.ItemIndex = 1 then tprobability := 0.5 * tprobability; + tprobability := ProbT(tequal, df); + if TailCombo.ItemIndex = 1 then tprobability := 0.5 * tprobability; lReport.Add('Assuming equal variances, t = %.3f with probability = %.4f and %.0f degrees of freedom', [ tequal, tprobability, df ]); @@ -374,14 +310,15 @@ begin lowci := dif - tconfint * sedif; hici := dif + tconfint * sedif; lReport.Add('Confidence interval = (%.2f ... %.2f)', [lowci, hici]); + lReport.Add(''); // now for unequal variances sedif := sqrt((variance1 / ncases1) + (variance2 / ncases2)); tunequal := dif / sedif; df := sqr((variance1 / ncases1) + (variance2 / ncases2)); df := df / (sqr(variance1 / ncases1) / (ncases1 - 1) + sqr(variance2 / ncases2) / (ncases2 - 1) ); - tprobability := probt(tequal,df); - if RadioGroup3.ItemIndex = 1 then tprobability := 0.5 * tprobability; + tprobability := ProbT(tequal, df); + if TailCombo.ItemIndex = 1 then tprobability := 0.5 * tprobability; lReport.Add('Assuming unequal variances, t = %.3f with probability = %.4f and %.0f degrees of freedom', [ tunequal, tprobability, df ]); @@ -391,6 +328,7 @@ begin lowci := dif - tconfint * sedif; hici := dif + tconfint * sedif; lReport.Add('Confidence interval = (%.2f ... %.2f)', [lowci, hici]); + lReport.Add(''); df1 := ncases1 - 1; df2 := ncases2 - 1; @@ -437,7 +375,7 @@ begin lReport.Add('t for test of equal variances = %.3f with probability = %.4f', [tequal, tprobability]); end; - DisplayReport(lReport); + FReportFrame.DisplayReport(lReport); finally lReport.Free; @@ -445,96 +383,138 @@ begin end; end; -procedure TTtestFrm.ListBox1Click(Sender: TObject); -VAR index : integer; -begin - index := ListBox1.ItemIndex; - if not independent then - begin - if Var1.Text <> '' then Var2.Text := ListBox1.Items.Strings[index] - else Var1.Text := ListBox1.Items.Strings[index]; - end; - if independent then - begin - if Var1.Text <> '' then Grp.Text := ListBox1.Items.Strings[index] - else Var1.Text := ListBox1.Items.Strings[index]; - end; -end; -procedure TTtestFrm.RadioGroup1Click(Sender: TObject); -VAR - index : integer; -begin - index := RadioGroup1.ItemIndex; - Notebook1.PageIndex := index; - if index = 0 then - begin -// Panel2.Visible := true; -// Panel1.Visible := false; - griddata := false; - end - else - begin -// Panel1.Visible := true; -// Panel2.Visible := false; - griddata := true; - if RadioGroup2.ItemIndex = 1 then - begin - SecdVarLabel.Visible := true; - Var2.Visible := true; - Grp.Visible := false; - GrpLabel.Visible := false; - end - else - begin - SecdVarLabel.Visible := false; - Var2.Visible := false; - Grp.Visible := true; - GrpLabel.Visible := true; - end; - end; -end; - -procedure TTtestFrm.RadioGroup2Click(Sender: TObject); +procedure TTtestForm.DataEntryGroupClick(Sender: TObject); var index: integer; begin - index := RadioGroup2.ItemIndex; - independent := (index = 0); - Grp.Visible := independent; - GrpLabel.Visible := independent; - GroupCodeBtn.Visible := independent; - GroupBox1.Visible := independent; - SecdVarLabel.Visible := not independent; - Var2.Visible := not independent; - { - if index = 0 then - begin - independent := true; - CorBetweenLabel.Visible := false; - Cor12.Visible := false; - Grp.Visible := true; - GrpLabel.Visible := true; - GroupCodeBtn.Visible := true; - Groupbxo1.Visible := true; - SecdVarLabel.Visible := false; - Var2.Visible := false; - end - else - begin - independent := false; - CorBetweenLabel.Visible := true; - Cor12.Visible := true; - GrpLabel.Visible := false; - Grp.Visible := false; - GroupCodeBtn.Visible := false; - SecdVarLabel.Visible := true; - Var2.Visible := true; - end; - } + index := DataEntryGroup.ItemIndex; + Notebook.PageIndex := index; + gridData := (index = 1); + if index = 1 then + begin + if DepIndepGroup.ItemIndex = 1 then + Var2Edit.Visible := true + else + Var2Edit.Visible := false; + end; + + Var2Label.Visible := Var2Edit.Visible; + Var2In.Visible := Var2Edit.Visible; + Var2Out.Visible := Var2Edit.Visible; + + GrpEdit.Visible := not Var2Edit.Visible; + GrpLabel.Visible := GrpEdit.Visible; + GrpIn.Visible := GrpEdit.Visible; + GrpOut.Visible := GrpEdit.Visible; end; -function TTtestFrm.Validate(out AMsg: String; out AControl: TWinControl): Boolean; + +procedure TTtestForm.DepIndepGroupClick(Sender: TObject); +begin + independent := (DepIndepGroup.ItemIndex = 0); + + GrpEdit.Visible := independent; + GrpLabel.Visible := independent; + GrpIn.Visible := independent; + GrpOut.Visible := independent; + + GroupCodeChk.Visible := independent; + GroupCodeGroup.Visible := independent; + + Var2Label.Visible := not independent; + Var2Edit.Visible := not independent; + Var2In.Visible := not independent; + Var2Out.Visible := not independent; + + Cor12.Visible := not independent; + Cor12Label.Visible := not independent; +end; + + +procedure TTtestForm.GroupCodeChkChange(Sender: TObject); +begin + Grp1CodeEdit.Enabled := GroupCodeChk.Checked; + Grp2CodeEdit.Enabled := GroupCodeChk.Checked; + GrpCodeLabel1.Enabled := GroupCodeChk.Checked; + GrpCodeLabel2.Enabled := GroupCodeChk.Checked; +end; + + +procedure TTtestForm.GrpInClick(Sender: TObject); +var + index: Integer; +begin + index := VarList.ItemIndex; + if (index > -1) and (GrpEdit.Text = '') then + begin + GrpEdit.Text := VarList.Items[index]; + VarList.Items.Delete(index); + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.GrpOutClick(Sender: TObject); +begin + if GrpEdit.Text <> '' then + begin + VarList.Items.Add(GrpEdit.Text); + GrpEdit.Text := ''; + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.Reset; +var + i: integer; +begin + inherited; + DataEntryGroup.ItemIndex := 0; + DepIndepGroup.ItemIndex := 0; + Notebook.PageIndex := DataEntryGroup.ItemIndex; + independent := true; + griddata := false; + + VarList.Clear; + for i := 1 to NoVariables do + VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); + Var1Edit.Clear; + Var2Edit.Clear; + Mean1.Clear; + Mean2.Clear; + SD1.Clear; + SD2.Clear; + N1.Clear; + N2.Clear; + Cor12.Clear; + GroupCodeChk.Checked := false; + GrpEdit.Clear; + Grp1CodeEdit.Clear; + Grp2CodeEdit.Clear; + + DepIndepGroupClick(nil); + + UpdateBtnStates; +end; + + +procedure TTtestForm.UpdateBtnStates; +begin + inherited UpdateBtnStates; + + Var1In.Enabled := (Var1Edit.Text = '') and (VarList.ItemIndex > -1); + Var2In.Enabled := (Var2Edit.Text = '') and (VarList.ItemIndex > -1); + GrpIn.Enabled := (GrpEdit.Text = '') and (VarList.ItemIndex > -1); + + Var1Out.Enabled := Var1Edit.Text <> ''; + Var2Out.Enabled := Var2Edit.Text <> ''; + GrpOut.Enabled := GrpEdit.Text <> ''; +end; + + +function TTtestForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean; var n: Integer; x: Double; @@ -542,7 +522,7 @@ begin Result := false; AControl := nil; AMsg := ''; - if Notebook1.PageIndex = 0 then + if Notebook.PageIndex = 0 then begin if (Mean1.Text = '') or not TryStrToFloat(Mean1.Text, x) then begin @@ -581,35 +561,35 @@ begin exit; end; end else - if Notebook1.PageIndex = 1 then + if Notebook.PageIndex = 1 then begin - if (Var1.Text = '') then + if (Var1Edit.Text = '') then begin - AControl := Var1; + AControl := Var1Edit; AMsg := 'Variable 1 not specified.'; exit; end; - if Var2.Visible and (Var2.Text = '') then + if Var2Edit.Visible and (Var2Edit.Text = '') then begin - AControl := Var2; + AControl := Var2Edit; AMsg := 'Variable 2 not specified.'; exit; end; - if Grp.Visible and (Grp.Text = '') then + if GrpEdit.Visible and (GrpEdit.Text = '') then begin - AControl := Grp; + AControl := GrpEdit; AMsg := 'Group variable not specified.'; exit; end; - if Grp1Code.Visible and ((Grp1Code.Text = '') or not TryStrToInt(Grp1Code.Text, n))then + if Grp1CodeEdit.Visible and ((Grp1CodeEdit.Text = '') or not TryStrToInt(Grp1CodeEdit.Text, n))then begin - AControl := Grp1Code; + AControl := Grp1CodeEdit; AMsg := 'Code for group 1 missing.'; exit; end; - if Grp2Code.Visible and ((Grp2Code.Text = '') or not TryStrToInt(Grp2Code.Text, n))then + if Grp2CodeEdit.Visible and ((Grp2CodeEdit.Text = '') or not TryStrToInt(Grp2CodeEdit.Text, n))then begin - AControl := Grp2Code; + AControl := Grp2CodeEdit; AMsg := 'Code for group 2 missing.'; exit; end; @@ -617,8 +597,95 @@ begin Result := true; end; -initialization - {$I ttestunit.lrs} + +procedure TTtestForm.Var1InClick(Sender: TObject); +var + index: Integer; +begin + index := VarList.ItemIndex; + if (index > -1) and (Var1Edit.Text = '') then + begin + Var1Edit.Text := VarList.Items[index]; + VarList.Items.Delete(index); + UpdateBtnStates; + end; +end; + +procedure TTtestForm.Var1OutClick(Sender: TObject); +begin + if Var1Edit.Text <> '' then + begin + VarList.Items.Add(Var1Edit.Text); + Var1Edit.Text := ''; + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.Var2InClick(Sender: TObject); +var + index: Integer; +begin + index := VarList.ItemIndex; + if (index > -1) and (Var2Edit.Text = '') then + begin + Var2Edit.Text := VarList.Items[index]; + VarList.Items.Delete(index); + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.Var2OutClick(Sender: TObject); +begin + if Var2Edit.Text <> '' then + begin + VarList.Items.Add(Var2Edit.Text); + Var2Edit.Text := ''; + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.VarListDblClick(Sender: TObject); +var + index: integer; + s: String; +begin + index := VarList.ItemIndex; + if index > -1 then + begin + s := VarList.Items[index]; + if Var1Edit.Text = '' then + begin + Var1Edit.Text := s; + VarList.Items.Delete(index); + end else + if independent then + begin + if GrpEdit.Text = '' then + begin + GrpEdit.Text := s; + VarList.Items.Delete(index); + end; + end else + begin + if Var2Edit.Text = '' then + begin + Var2Edit.Text := s; + VarList.Items.Delete(index); + end; + end; + UpdateBtnStates; + end; +end; + + +procedure TTtestForm.VarListSelectionChange(Sender: TObject; User: boolean); +begin + UpdateBtnStates; +end; + end. diff --git a/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.lfm b/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.lfm index 6ee448718..4a85fbca2 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.lfm +++ b/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.lfm @@ -133,7 +133,7 @@ inherited TwoCorrsForm: TTwoCorrsForm Height = 292 Top = 80 Width = 392 - PageIndex = 2 + PageIndex = 0 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Top = 8 BorderSpacing.Bottom = 8 diff --git a/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.pas b/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.pas index ade862370..b53668314 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/twocorrsunit.pas @@ -176,6 +176,7 @@ begin GrpIn.Visible := GroupVarEdit.Visible; GrpOut.Visible := GroupVarEdit.Visible; + UpdateBtnStates; end; diff --git a/applications/lazstats/source/forms/analysis/comparisons/twopropunit.pas b/applications/lazstats/source/forms/analysis/comparisons/twopropunit.pas index 70b110f2d..1760735bf 100644 --- a/applications/lazstats/source/forms/analysis/comparisons/twopropunit.pas +++ b/applications/lazstats/source/forms/analysis/comparisons/twopropunit.pas @@ -465,6 +465,8 @@ begin IndSize2.Clear; Notebook.PageIndex := 1; + + UpdateBtnStates; end; diff --git a/applications/lazstats/source/forms/mainunit.pas b/applications/lazstats/source/forms/mainunit.pas index 4ccff0f51..8134a4ddb 100644 --- a/applications/lazstats/source/forms/mainunit.pas +++ b/applications/lazstats/source/forms/mainunit.pas @@ -883,22 +883,6 @@ begin SpBrFrm.ShowModal; end; -// Menu "Analysis" > "Comparisons" > "ABC mnuAnalysisComp_Anova with B Nested in A" -procedure TOS3MainFrm.mnuAnalysisComp_NestedABCClick(Sender: TObject); -begin - if ABCNestedForm = nil then - Application.CreateForm(TABCNestedForm, ABCNestedForm); - ABCNestedForm.ShowModal; -end; - -// Menu "Analysis" > "Comparisons" > "2 or 3 Way mnuAnalysisComp_Anova with One Case Per Cell" -procedure TOS3MainFrm.mnuAnalysisComp_OneCaseAnovaClick(Sender: TObject); -begin - if OneCaseAnovaForm = nil then - Application.CreateForm(TOneCaseAnovaForm, OneCaseAnovaForm); - OneCaseAnovaForm.ShowModal; -end; - // Menu "Analysis" > "One sample tests" procedure TOS3MainFrm.mnuAnalysisOneSampleTestsClick(Sender: TObject); begin @@ -908,30 +892,6 @@ begin end; -// Menu "Analysis" > "Comparisons" > "Difference beween Proportions" -procedure TOS3MainFrm.mnuAnalysisComp_PropDiffClick(Sender: TObject); -begin - if TwoPropForm = nil then - Application.CreateForm(TTwoPropForm, TwoPropForm); - TwoPropForm.Show; -end; - -// Menu "Analysis" > "Comparisons" > "t-tests" -procedure TOS3MainFrm.mnuAnalysisComp_tTestsClick(Sender: TObject); -begin - if TTestFrm = nil then - Application.CreateForm(TTTestFrm, TTestFrm); - TTestFrm.ShowModal; -end; - -// Menu "Analysis" > "Comparisons" > "Within Subjects mnuAnalysisComp_Anova" -procedure TOS3MainFrm.mnuAnalysisComp_WithinAnovaClick(Sender: TObject); -begin - if WithinANOVAFrm = nil then - Application.CreateForm(TWithinANOVAFrm, WithinANOVAFrm); - WithinAnovaFrm.ShowModal; -end; - { @@ -1036,38 +996,6 @@ begin if DataGrid.Cells[PrevCol,PrevRow] <> '' then FormatCell(PrevCol,PrevRow); end; -// Menu "Analysis" > "Comparisons" > "1,2 or 3 Way ANOVAs" -procedure TOS3MainFrm.mnuAnalysisComp_AnovaClick(Sender: TObject); -begin - if BlksAnovaFrm = nil then - Application.CreateForm(TBlksAnovaFrm, BlksAnovaFrm); - BlksAnovaFrm.ShowModal; -end; - -// Menu "Analysis" > "Comparisons" > "A x B x S mnuAnalysisComp_Anova" -procedure TOS3MainFrm.mnuAnalysisComp_ABSAnovaClick(Sender: TObject); -begin - if ABRAnovaForm = nil then - Application.CreateForm(TABRAnovaForm, ABRAnovaForm); - ABRAnovaForm.Show; -end; - -// Menu "Analysis" > "Comparisons" > "mnuAnalysisComp_Ancova by Regression" -procedure TOS3MainFrm.mnuAnalysisComp_AncovaClick(Sender: TObject); -begin - if ANCOVAfrm = nil then - Application.CreateForm(TANCOVAfrm, ANCOVAfrm); - ANCOVAFRM.ShowModal; -end; - -// Menu "Analysis" > "Comparisons" > "A x S mnuAnalysisComp_Anova" -procedure TOS3MainFrm.mnuAnalysisComp_AxSAnovaClick(Sender: TObject); -begin - if AxSAnovaFrm = nil then - Application.CreateForm(TAxSAnovaFrm, AxSAnovaFrm); - AxSAnovaFrm.ShowModal; -end; - // Menu "Analysis" > "Multivariate" > "Bartlett Test of Sphericity" procedure TOS3MainFrm.mnuAnalysisMulti_BartlettClick(Sender: TObject); begin @@ -1076,22 +1004,6 @@ begin BartlettTestForm.ShowModal; end; -// Menu "Analysis" > "Comparisons" > "B Nested in A mnuAnalysisComp_Anova" -procedure TOS3MainFrm.mnuAnalysisComp_BinAClick(Sender: TObject); -begin - if BNestedAForm = nil then - Application.CreateForm(TBNestedAForm, BNestedAForm); - BNestedAForm.ShowModal; -end; - -// Menu "Analysis" > "Comparisons" > "Difference Between Correlations" -procedure TOS3MainFrm.mnuAnalysisComp_CorrDiffClick(Sender: TObject); -begin - if TwoCorrsForm = nil then - Application.CreateForm(TTwoCorrsForm, TwoCorrsForm); - TwoCorrsForm.Show; -end; - // Menu "Analysis" > "Multivariate" > "mnuAnalysisMulti_Correspondence Analysis" procedure TOS3MainFrm.mnuAnalysisMulti_CorrespondenceClick(Sender: TObject); begin @@ -1693,14 +1605,6 @@ begin CompareDistFrm.ShowModal; end; -// Menu "Analysis" > "Comparisons" > "Latin and Greco-Latin Squares" -procedure TOS3MainFrm.mnuAnalysisComp_LatinSquaresClick(Sender: TObject); -begin - if LatinSqrsFrm = nil then - Application.CreateForm(TLatinSqrsFrm, LatinSqrsFrm); - LatinSqrsFrm.ShowModal; -end; - procedure TOS3MainFrm.MatManMnuClick(Sender: TObject); begin if MatManFrm = nil then @@ -1921,6 +1825,105 @@ end; +{ Comparisons commands } + +// Menu "Analysis" > "Comparisons" > "1,2 or 3 Way ANOVAs" +procedure TOS3MainFrm.mnuAnalysisComp_AnovaClick(Sender: TObject); +begin + if BlksAnovaFrm = nil then + Application.CreateForm(TBlksAnovaFrm, BlksAnovaFrm); + BlksAnovaFrm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "A x B x S Anova" +procedure TOS3MainFrm.mnuAnalysisComp_ABSAnovaClick(Sender: TObject); +begin + if ABRAnovaForm = nil then + Application.CreateForm(TABRAnovaForm, ABRAnovaForm); + ABRAnovaForm.Show; +end; + +// Menu "Analysis" > "Comparisons" > "Ancova by Regression" +procedure TOS3MainFrm.mnuAnalysisComp_AncovaClick(Sender: TObject); +begin + if ANCOVAfrm = nil then + Application.CreateForm(TANCOVAfrm, ANCOVAfrm); + ANCOVAFRM.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "A x S Anova" +procedure TOS3MainFrm.mnuAnalysisComp_AxSAnovaClick(Sender: TObject); +begin + if AxSAnovaFrm = nil then + Application.CreateForm(TAxSAnovaFrm, AxSAnovaFrm); + AxSAnovaFrm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "B Nested in A mnuAnalysisComp_Anova" +procedure TOS3MainFrm.mnuAnalysisComp_BinAClick(Sender: TObject); +begin + if BNestedAForm = nil then + Application.CreateForm(TBNestedAForm, BNestedAForm); + BNestedAForm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "Difference Between Correlations" +procedure TOS3MainFrm.mnuAnalysisComp_CorrDiffClick(Sender: TObject); +begin + if TwoCorrsForm = nil then + Application.CreateForm(TTwoCorrsForm, TwoCorrsForm); + TwoCorrsForm.Show; +end; + +// Menu "Analysis" > "Comparisons" > "Latin and Greco-Latin Squares" +procedure TOS3MainFrm.mnuAnalysisComp_LatinSquaresClick(Sender: TObject); +begin + if LatinSqrsFrm = nil then + Application.CreateForm(TLatinSqrsFrm, LatinSqrsFrm); + LatinSqrsFrm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "ABC mnuAnalysisComp_Anova with B Nested in A" +procedure TOS3MainFrm.mnuAnalysisComp_NestedABCClick(Sender: TObject); +begin + if ABCNestedForm = nil then + Application.CreateForm(TABCNestedForm, ABCNestedForm); + ABCNestedForm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "2 or 3 Way mnuAnalysisComp_Anova with One Case Per Cell" +procedure TOS3MainFrm.mnuAnalysisComp_OneCaseAnovaClick(Sender: TObject); +begin + if OneCaseAnovaForm = nil then + Application.CreateForm(TOneCaseAnovaForm, OneCaseAnovaForm); + OneCaseAnovaForm.ShowModal; +end; + +// Menu "Analysis" > "Comparisons" > "Difference beween Proportions" +procedure TOS3MainFrm.mnuAnalysisComp_PropDiffClick(Sender: TObject); +begin + if TwoPropForm = nil then + Application.CreateForm(TTwoPropForm, TwoPropForm); + TwoPropForm.Show; +end; + +// Menu "Analysis" > "Comparisons" > "t-tests" +procedure TOS3MainFrm.mnuAnalysisComp_tTestsClick(Sender: TObject); +begin + if TTestForm = nil then + Application.CreateForm(TTTestForm, TTestForm); + TTestForm.Show; +end; + +// Menu "Analysis" > "Comparisons" > "Within Subjects mnuAnalysisComp_Anova" +procedure TOS3MainFrm.mnuAnalysisComp_WithinAnovaClick(Sender: TObject); +begin + if WithinANOVAFrm = nil then + Application.CreateForm(TWithinANOVAFrm, WithinANOVAFrm); + WithinAnovaFrm.ShowModal; +end; + + { Descriptive statistics commands } // Menu "Analysis" > "Descriptive" > "Box Plot"