diff --git a/instat/clsDistribution.vb b/instat/clsDistribution.vb index 0dcd630c5e7..190efbc2e62 100644 --- a/instat/clsDistribution.vb +++ b/instat/clsDistribution.vb @@ -25,6 +25,7 @@ Public Class Distribution Public strDFunctionName As String = "" Public strExactName As String = "" Public strGLMFunctionName As String = "" + Public strAOVFunctionName As String = "" Public bIncluded As Boolean = True Public bNumeric As Boolean = False @@ -77,7 +78,7 @@ Public Class Distribution End Sub Public Function IsDistributionFunction(strFunctionName As String) As Boolean - Dim strNames() As String = {strRFunctionName, strPFunctionName, strQFunctionName, strDFunctionName, strExactName, strGLMFunctionName} + Dim strNames() As String = {strRFunctionName, strPFunctionName, strQFunctionName, strDFunctionName, strExactName, strGLMFunctionName, strAOVFunctionName} Return strNames.Contains(strFunctionName) End Function End Class diff --git a/instat/clsRegressionDefaults.vb b/instat/clsRegressionDefaults.vb index fcc166aeff4..a7b2e4a0964 100644 --- a/instat/clsRegressionDefaults.vb +++ b/instat/clsRegressionDefaults.vb @@ -59,14 +59,20 @@ Public Class clsRegressionDefaults End Property Public Shared ReadOnly Property clsDefaultGlmFunction As RFunction Get - Dim clsDefaultGlmFunc As New RFunction - clsDefaultGlmFunc.SetRCommand("glm") Return clsDefaultGlmFunc End Get End Property + Public Shared ReadOnly Property clsDefaultAovFunction As RFunction + Get + Dim clsDefaultAovFunc As New RFunction + clsDefaultAovFunc.SetRCommand("aov") + Return clsDefaultAovFunc + End Get + End Property + Public Shared ReadOnly Property clsDefaultRGraphicsOperator As ROperator Get diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index e4176b1f531..72f32dd229a 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,12 +60,12 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.ucrChkPercentageProportion = New instat.ucrCheck() Me.lblFactorAsPercentage = New System.Windows.Forms.Label() - Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() + Me.ucrChkPercentageProportion = New instat.ucrCheck() + Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrChkDisplayMargins = New instat.ucrCheck() @@ -91,10 +91,11 @@ Partial Class dlgDescribeTwoVariable Me.rdoThreeVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoThreeVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoThreeVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoThreeVariable.Location = New System.Drawing.Point(288, 8) + Me.rdoThreeVariable.Location = New System.Drawing.Point(432, 12) + Me.rdoThreeVariable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.rdoThreeVariable.Name = "rdoThreeVariable" - Me.rdoThreeVariable.Size = New System.Drawing.Size(100, 28) - Me.rdoThreeVariable.TabIndex = 26 + Me.rdoThreeVariable.Size = New System.Drawing.Size(150, 42) + Me.rdoThreeVariable.TabIndex = 3 Me.rdoThreeVariable.Text = "Three Variables" Me.rdoThreeVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoThreeVariable.UseVisualStyleBackColor = True @@ -102,40 +103,44 @@ Partial Class dlgDescribeTwoVariable 'cmdFormatTable ' Me.cmdFormatTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFormatTable.Location = New System.Drawing.Point(326, 423) + Me.cmdFormatTable.Location = New System.Drawing.Point(489, 634) + Me.cmdFormatTable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cmdFormatTable.Name = "cmdFormatTable" - Me.cmdFormatTable.Size = New System.Drawing.Size(104, 23) - Me.cmdFormatTable.TabIndex = 44 + Me.cmdFormatTable.Size = New System.Drawing.Size(156, 34) + Me.cmdFormatTable.TabIndex = 23 Me.cmdFormatTable.Text = "Format Table..." Me.cmdFormatTable.UseVisualStyleBackColor = True ' 'lblThreeVariableSecondFactor ' Me.lblThreeVariableSecondFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(315, 150) + Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(472, 225) + Me.lblThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThreeVariableSecondFactor.Name = "lblThreeVariableSecondFactor" - Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(100, 15) - Me.lblThreeVariableSecondFactor.TabIndex = 35 + Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(150, 22) + Me.lblThreeVariableSecondFactor.TabIndex = 10 Me.lblThreeVariableSecondFactor.Tag = "" Me.lblThreeVariableSecondFactor.Text = "Second Variable :" ' 'cmdMissingOptions ' Me.cmdMissingOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMissingOptions.Location = New System.Drawing.Point(167, 296) + Me.cmdMissingOptions.Location = New System.Drawing.Point(250, 444) + Me.cmdMissingOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cmdMissingOptions.Name = "cmdMissingOptions" - Me.cmdMissingOptions.Size = New System.Drawing.Size(105, 23) - Me.cmdMissingOptions.TabIndex = 46 + Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) + Me.cmdMissingOptions.TabIndex = 21 Me.cmdMissingOptions.Text = "Missing Options..." Me.cmdMissingOptions.UseVisualStyleBackColor = True ' 'lbSecondVariable ' Me.lbSecondVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lbSecondVariable.Location = New System.Drawing.Point(310, 150) + Me.lbSecondVariable.Location = New System.Drawing.Point(465, 225) + Me.lbSecondVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbSecondVariable.Name = "lbSecondVariable" - Me.lbSecondVariable.Size = New System.Drawing.Size(100, 15) - Me.lbSecondVariable.TabIndex = 27 + Me.lbSecondVariable.Size = New System.Drawing.Size(150, 22) + Me.lbSecondVariable.TabIndex = 9 Me.lbSecondVariable.Tag = "" Me.lbSecondVariable.Text = "Second Variable:" ' @@ -143,10 +148,11 @@ Partial Class dlgDescribeTwoVariable ' Me.lblFirstVariable.AutoSize = True Me.lblFirstVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstVariable.Location = New System.Drawing.Point(310, 49) + Me.lblFirstVariable.Location = New System.Drawing.Point(465, 74) + Me.lblFirstVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstVariable.Name = "lblFirstVariable" - Me.lblFirstVariable.Size = New System.Drawing.Size(75, 13) - Me.lblFirstVariable.TabIndex = 31 + Me.lblFirstVariable.Size = New System.Drawing.Size(114, 20) + Me.lblFirstVariable.TabIndex = 5 Me.lblFirstVariable.Tag = "" Me.lblFirstVariable.Text = "First Variables:" ' @@ -159,86 +165,96 @@ Partial Class dlgDescribeTwoVariable Me.grpSummaries.Controls.Add(Me.lblSummary) Me.grpSummaries.Controls.Add(Me.lblBy) Me.grpSummaries.Controls.Add(Me.lblSecondType) - Me.grpSummaries.Location = New System.Drawing.Point(11, 219) + Me.grpSummaries.Location = New System.Drawing.Point(16, 328) + Me.grpSummaries.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpSummaries.Name = "grpSummaries" - Me.grpSummaries.Size = New System.Drawing.Size(210, 72) - Me.grpSummaries.TabIndex = 39 + Me.grpSummaries.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpSummaries.Size = New System.Drawing.Size(315, 108) + Me.grpSummaries.TabIndex = 17 Me.grpSummaries.TabStop = False ' 'lblFirstType ' Me.lblFirstType.AutoSize = True Me.lblFirstType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstType.Location = New System.Drawing.Point(12, 18) + Me.lblFirstType.Location = New System.Drawing.Point(18, 27) + Me.lblFirstType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstType.Name = "lblFirstType" - Me.lblFirstType.Size = New System.Drawing.Size(0, 13) + Me.lblFirstType.Size = New System.Drawing.Size(0, 20) Me.lblFirstType.TabIndex = 0 ' 'lblSecondBy ' Me.lblSecondBy.AutoSize = True Me.lblSecondBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondBy.Location = New System.Drawing.Point(180, 16) + Me.lblSecondBy.Location = New System.Drawing.Point(270, 24) + Me.lblSecondBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondBy.Name = "lblSecondBy" - Me.lblSecondBy.Size = New System.Drawing.Size(18, 13) - Me.lblSecondBy.TabIndex = 1 + Me.lblSecondBy.Size = New System.Drawing.Size(25, 20) + Me.lblSecondBy.TabIndex = 6 Me.lblSecondBy.Text = "by" ' 'lblThreeVariableCategorical ' Me.lblThreeVariableCategorical.AutoSize = True Me.lblThreeVariableCategorical.ForeColor = System.Drawing.SystemColors.Highlight - Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(12, 33) + Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(18, 50) + Me.lblThreeVariableCategorical.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThreeVariableCategorical.Name = "lblThreeVariableCategorical" - Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(59, 13) - Me.lblThreeVariableCategorical.TabIndex = 3 + Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(86, 20) + Me.lblThreeVariableCategorical.TabIndex = 1 Me.lblThreeVariableCategorical.Text = "categorical" ' 'lblSummaryName ' Me.lblSummaryName.AutoSize = True Me.lblSummaryName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummaryName.Location = New System.Drawing.Point(70, 51) + Me.lblSummaryName.Location = New System.Drawing.Point(105, 76) + Me.lblSummaryName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSummaryName.Name = "lblSummaryName" - Me.lblSummaryName.Size = New System.Drawing.Size(0, 13) - Me.lblSummaryName.TabIndex = 5 + Me.lblSummaryName.Size = New System.Drawing.Size(0, 20) + Me.lblSummaryName.TabIndex = 3 ' 'lblSummary ' Me.lblSummary.AutoSize = True Me.lblSummary.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummary.Location = New System.Drawing.Point(12, 51) + Me.lblSummary.Location = New System.Drawing.Point(18, 76) + Me.lblSummary.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSummary.Name = "lblSummary" - Me.lblSummary.Size = New System.Drawing.Size(53, 13) - Me.lblSummary.TabIndex = 4 + Me.lblSummary.Size = New System.Drawing.Size(80, 20) + Me.lblSummary.TabIndex = 2 Me.lblSummary.Text = "Summary:" ' 'lblBy ' Me.lblBy.AutoSize = True Me.lblBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblBy.Location = New System.Drawing.Point(82, 16) + Me.lblBy.Location = New System.Drawing.Point(123, 24) + Me.lblBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblBy.Name = "lblBy" - Me.lblBy.Size = New System.Drawing.Size(18, 13) - Me.lblBy.TabIndex = 6 + Me.lblBy.Size = New System.Drawing.Size(25, 20) + Me.lblBy.TabIndex = 4 Me.lblBy.Text = "by" ' 'lblSecondType ' Me.lblSecondType.AutoSize = True Me.lblSecondType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondType.Location = New System.Drawing.Point(106, 18) + Me.lblSecondType.Location = New System.Drawing.Point(159, 27) + Me.lblSecondType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondType.Name = "lblSecondType" - Me.lblSecondType.Size = New System.Drawing.Size(0, 13) - Me.lblSecondType.TabIndex = 0 + Me.lblSecondType.Size = New System.Drawing.Size(0, 20) + Me.lblSecondType.TabIndex = 5 ' 'lblFirstGroupByFactor ' Me.lblFirstGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(315, 149) + Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(472, 224) + Me.lblFirstGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstGroupByFactor.Name = "lblFirstGroupByFactor" - Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(100, 15) - Me.lblFirstGroupByFactor.TabIndex = 29 + Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(150, 22) + Me.lblFirstGroupByFactor.TabIndex = 7 Me.lblFirstGroupByFactor.Tag = "" Me.lblFirstGroupByFactor.Text = "Factor (Optional) :" ' @@ -250,10 +266,11 @@ Partial Class dlgDescribeTwoVariable Me.rdoSkim.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSkim.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSkim.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSkim.Location = New System.Drawing.Point(95, 8) + Me.rdoSkim.Location = New System.Drawing.Point(142, 12) + Me.rdoSkim.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.rdoSkim.Name = "rdoSkim" - Me.rdoSkim.Size = New System.Drawing.Size(100, 28) - Me.rdoSkim.TabIndex = 23 + Me.rdoSkim.Size = New System.Drawing.Size(150, 42) + Me.rdoSkim.TabIndex = 1 Me.rdoSkim.Text = "Skim" Me.rdoSkim.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSkim.UseVisualStyleBackColor = True @@ -261,19 +278,21 @@ Partial Class dlgDescribeTwoVariable 'lblThirdVariable ' Me.lblThirdVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThirdVariable.Location = New System.Drawing.Point(310, 191) + Me.lblThirdVariable.Location = New System.Drawing.Point(465, 286) + Me.lblThirdVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThirdVariable.Name = "lblThirdVariable" - Me.lblThirdVariable.Size = New System.Drawing.Size(154, 15) - Me.lblThirdVariable.TabIndex = 37 + Me.lblThirdVariable.Size = New System.Drawing.Size(231, 22) + Me.lblThirdVariable.TabIndex = 13 Me.lblThirdVariable.Tag = "" Me.lblThirdVariable.Text = "Third Variable :" ' 'lblSecondGroupByFactor ' Me.lblSecondGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(315, 191) + Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(472, 286) + Me.lblSecondGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondGroupByFactor.Name = "lblSecondGroupByFactor" - Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(137, 15) + Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(206, 22) Me.lblSecondGroupByFactor.TabIndex = 33 Me.lblSecondGroupByFactor.Tag = "" Me.lblSecondGroupByFactor.Text = "Second Factor (Optional) :" @@ -286,10 +305,11 @@ Partial Class dlgDescribeTwoVariable Me.rdoTwoVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoTwoVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoTwoVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoTwoVariable.Location = New System.Drawing.Point(191, 8) + Me.rdoTwoVariable.Location = New System.Drawing.Point(286, 12) + Me.rdoTwoVariable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.rdoTwoVariable.Name = "rdoTwoVariable" - Me.rdoTwoVariable.Size = New System.Drawing.Size(100, 28) - Me.rdoTwoVariable.TabIndex = 24 + Me.rdoTwoVariable.Size = New System.Drawing.Size(150, 42) + Me.rdoTwoVariable.TabIndex = 2 Me.rdoTwoVariable.Text = "Two Variables" Me.rdoTwoVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoTwoVariable.UseVisualStyleBackColor = True @@ -297,9 +317,10 @@ Partial Class dlgDescribeTwoVariable 'cmdSummaries ' Me.cmdSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSummaries.Location = New System.Drawing.Point(310, 229) + Me.cmdSummaries.Location = New System.Drawing.Point(465, 344) + Me.cmdSummaries.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cmdSummaries.Name = "cmdSummaries" - Me.cmdSummaries.Size = New System.Drawing.Size(120, 23) + Me.cmdSummaries.Size = New System.Drawing.Size(180, 34) Me.cmdSummaries.TabIndex = 1 Me.cmdSummaries.Tag = "Summaries" Me.cmdSummaries.Text = "Choose Summaries..." @@ -308,10 +329,11 @@ Partial Class dlgDescribeTwoVariable 'lblMarginName ' Me.lblMarginName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMarginName.Location = New System.Drawing.Point(15, 320) + Me.lblMarginName.Location = New System.Drawing.Point(22, 480) + Me.lblMarginName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMarginName.Name = "lblMarginName" - Me.lblMarginName.Size = New System.Drawing.Size(93, 15) - Me.lblMarginName.TabIndex = 54 + Me.lblMarginName.Size = New System.Drawing.Size(140, 22) + Me.lblMarginName.TabIndex = 19 Me.lblMarginName.Tag = "" Me.lblMarginName.Text = "Margin Name:" ' @@ -321,77 +343,80 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.Controls.Add(Me.lblFactorAsPercentage) Me.grpDisplay.Controls.Add(Me.ucrReceiverPercentages) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) - Me.grpDisplay.Location = New System.Drawing.Point(275, 205) + Me.grpDisplay.Location = New System.Drawing.Point(412, 308) + Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpDisplay.Name = "grpDisplay" - Me.grpDisplay.Size = New System.Drawing.Size(194, 115) - Me.grpDisplay.TabIndex = 56 + Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpDisplay.Size = New System.Drawing.Size(291, 172) + Me.grpDisplay.TabIndex = 15 Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(143, 34) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorAsPercentage.Location = New System.Drawing.Point(9, 42) + Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 63) + Me.lblFactorAsPercentage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFactorAsPercentage.Name = "lblFactorAsPercentage" - Me.lblFactorAsPercentage.Size = New System.Drawing.Size(154, 15) - Me.lblFactorAsPercentage.TabIndex = 56 + Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) + Me.lblFactorAsPercentage.TabIndex = 2 Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" ' - 'ucrReceiverPercentages - ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(143, 20) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 55 - Me.ucrReceiverPercentages.ucrSelector = Nothing - ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 17) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(143, 34) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' 'ucrReceiverFirstVars ' Me.ucrReceiverFirstVars.AutoSize = True Me.ucrReceiverFirstVars.frmParent = Me - Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(310, 64) + Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(465, 96) Me.ucrReceiverFirstVars.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFirstVars.Name = "ucrReceiverFirstVars" Me.ucrReceiverFirstVars.Selector = Nothing - Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(120, 79) + Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(180, 118) Me.ucrReceiverFirstVars.strNcFilePath = "" - Me.ucrReceiverFirstVars.TabIndex = 58 + Me.ucrReceiverFirstVars.TabIndex = 6 Me.ucrReceiverFirstVars.ucrSelector = Nothing ' 'ucrSaveTable ' Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(15, 451) - Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveTable.Location = New System.Drawing.Point(22, 676) + Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(399, 24) - Me.ucrSaveTable.TabIndex = 57 + Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) + Me.ucrSaveTable.TabIndex = 24 + ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(18, 126) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(214, 51) + Me.ucrChkPercentageProportion.TabIndex = 0 + ' + 'ucrReceiverPercentages + ' + Me.ucrReceiverPercentages.AutoSize = True + Me.ucrReceiverPercentages.frmParent = Nothing + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(18, 86) + Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" + Me.ucrReceiverPercentages.Selector = Nothing + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(214, 30) + Me.ucrReceiverPercentages.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 3 + Me.ucrReceiverPercentages.ucrSelector = Nothing + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(18, 26) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(214, 51) + Me.ucrChkDisplayAsPercentage.TabIndex = 1 ' 'ucrInputMarginName ' @@ -399,19 +424,19 @@ Partial Class dlgDescribeTwoVariable Me.ucrInputMarginName.AutoSize = True Me.ucrInputMarginName.IsMultiline = False Me.ucrInputMarginName.IsReadOnly = False - Me.ucrInputMarginName.Location = New System.Drawing.Point(114, 318) - Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputMarginName.Location = New System.Drawing.Point(171, 477) + Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputMarginName.Name = "ucrInputMarginName" - Me.ucrInputMarginName.Size = New System.Drawing.Size(137, 21) - Me.ucrInputMarginName.TabIndex = 55 + Me.ucrInputMarginName.Size = New System.Drawing.Size(206, 32) + Me.ucrInputMarginName.TabIndex = 22 ' 'ucrReorderSummary ' - Me.ucrReorderSummary.Location = New System.Drawing.Point(275, 258) - Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(6) + Me.ucrReorderSummary.Location = New System.Drawing.Point(412, 387) + Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(9) Me.ucrReorderSummary.Name = "ucrReorderSummary" - Me.ucrReorderSummary.Size = New System.Drawing.Size(194, 156) - Me.ucrReorderSummary.TabIndex = 52 + Me.ucrReorderSummary.Size = New System.Drawing.Size(291, 234) + Me.ucrReorderSummary.TabIndex = 16 Me.ucrReorderSummary.ucrDataFrameList = Nothing Me.ucrReorderSummary.ucrReceiver = Nothing ' @@ -419,44 +444,44 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkDisplayMargins.AutoSize = True Me.ucrChkDisplayMargins.Checked = False - Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(17, 296) - Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) + Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" - Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(143, 23) - Me.ucrChkDisplayMargins.TabIndex = 53 + Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) + Me.ucrChkDisplayMargins.TabIndex = 18 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(15, 489) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(4) + Me.ucrBase.Location = New System.Drawing.Point(22, 734) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 43 + Me.ucrBase.Size = New System.Drawing.Size(611, 77) + Me.ucrBase.TabIndex = 25 ' 'ucrReceiverThreeVariableThirdVariable ' Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me - Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(310, 204) + Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(465, 306) Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing - Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" - Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 38 + Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing ' 'ucrReceiverSecondSkimrGroupByFactor ' Me.ucrReceiverSecondSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSecondSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(310, 204) + Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(465, 306) Me.ucrReceiverSecondSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSecondSkimrGroupByFactor.Name = "ucrReceiverSecondSkimrGroupByFactor" Me.ucrReceiverSecondSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSecondSkimrGroupByFactor.strNcFilePath = "" Me.ucrReceiverSecondSkimrGroupByFactor.TabIndex = 34 Me.ucrReceiverSecondSkimrGroupByFactor.ucrSelector = Nothing @@ -465,13 +490,13 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverSecondTwoVariableFactor.AutoSize = True Me.ucrReceiverSecondTwoVariableFactor.frmParent = Me - Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(310, 164) + Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(465, 246) Me.ucrReceiverSecondTwoVariableFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSecondTwoVariableFactor.Name = "ucrReceiverSecondTwoVariableFactor" Me.ucrReceiverSecondTwoVariableFactor.Selector = Nothing - Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSecondTwoVariableFactor.strNcFilePath = "" - Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 25 + Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 11 Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing ' 'ucrSelectorDescribeTwoVar @@ -480,30 +505,30 @@ Partial Class dlgDescribeTwoVariable Me.ucrSelectorDescribeTwoVar.bDropUnusedFilterLevels = False Me.ucrSelectorDescribeTwoVar.bShowHiddenColumns = False Me.ucrSelectorDescribeTwoVar.bUseCurrentFilter = True - Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(11, 36) + Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(16, 54) Me.ucrSelectorDescribeTwoVar.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorDescribeTwoVar.Name = "ucrSelectorDescribeTwoVar" - Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorDescribeTwoVar.TabIndex = 28 + Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorDescribeTwoVar.TabIndex = 4 ' 'ucrPnlDescribe ' Me.ucrPnlDescribe.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDescribe.Location = New System.Drawing.Point(92, 3) - Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlDescribe.Location = New System.Drawing.Point(138, 4) + Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(9) Me.ucrPnlDescribe.Name = "ucrPnlDescribe" - Me.ucrPnlDescribe.Size = New System.Drawing.Size(317, 34) - Me.ucrPnlDescribe.TabIndex = 22 + Me.ucrPnlDescribe.Size = New System.Drawing.Size(476, 51) + Me.ucrPnlDescribe.TabIndex = 0 ' 'ucrReceiverThreeVariableSecondFactor ' Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True Me.ucrReceiverThreeVariableSecondFactor.frmParent = Me - Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(310, 164) + Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(465, 246) Me.ucrReceiverThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverThreeVariableSecondFactor.Name = "ucrReceiverThreeVariableSecondFactor" Me.ucrReceiverThreeVariableSecondFactor.Selector = Nothing - Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverThreeVariableSecondFactor.strNcFilePath = "" Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 36 Me.ucrReceiverThreeVariableSecondFactor.ucrSelector = Nothing @@ -512,11 +537,11 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(310, 164) + Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(465, 246) Me.ucrReceiverSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSkimrGroupByFactor.Name = "ucrReceiverSkimrGroupByFactor" Me.ucrReceiverSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSkimrGroupByFactor.strNcFilePath = "" Me.ucrReceiverSkimrGroupByFactor.TabIndex = 32 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing @@ -525,27 +550,28 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkOmitMissing.AutoSize = True Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(17, 296) - Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) + Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" - Me.ucrChkOmitMissing.Size = New System.Drawing.Size(143, 23) + Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) Me.ucrChkOmitMissing.TabIndex = 0 ' 'ucrChkSummariesRowCol ' Me.ucrChkSummariesRowCol.AutoSize = True Me.ucrChkSummariesRowCol.Checked = False - Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(15, 337) + Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) + Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" - Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(180, 23) - Me.ucrChkSummariesRowCol.TabIndex = 59 + Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) + Me.ucrChkSummariesRowCol.TabIndex = 20 ' 'dlgDescribeTwoVariable ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ClientSize = New System.Drawing.Size(482, 499) + Me.ClientSize = New System.Drawing.Size(723, 748) Me.Controls.Add(Me.ucrReceiverFirstVars) Me.Controls.Add(Me.ucrSaveTable) Me.Controls.Add(Me.grpDisplay) @@ -577,6 +603,7 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.ucrChkSummariesRowCol) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgDescribeTwoVariable" diff --git a/instat/dlgFitModel.vb b/instat/dlgFitModel.vb index 70b4aab911c..647967813f2 100644 --- a/instat/dlgFitModel.vb +++ b/instat/dlgFitModel.vb @@ -28,7 +28,7 @@ Public Class dlgFitModel Public clsRestpvalFunction, clsFamilyFunction, clsRCIFunction, clsRConvert, clsAutoPlot, clsVisReg As New RFunction Public bResetModelOptions As Boolean = False Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsAnovaIIFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsGLMNB, clsGLMPolr, clsGLMMultinom, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsLMOrGLM, clsGLMFunctionNB, clsAOVFunction, clsGLMFunctionPolr, clsGLMFunctionMultinom, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -95,10 +95,10 @@ Public Class dlgFitModel clsAutoPlot = New RFunction clsFormulaFunction = New RFunction clsLM = New RFunction - clsGLM = New RFunction - clsGLMNB = New RFunction - clsGLMPolr = New RFunction - clsGLMMultinom = New RFunction + clsGLMFunction = New RFunction + clsGLMFunctionNB = New RFunction + clsGLMFunctionPolr = New RFunction + clsGLMFunctionMultinom = New RFunction clsConfint = New RFunction clsAnovaFunction = New RFunction clsVisReg = New RFunction @@ -108,6 +108,7 @@ Public Class dlgFitModel clsHatvaluesFunction = New RFunction clsResidualFunction = New RFunction clsFittedValuesFunction = New RFunction + clsAOVFunction = New RFunction ucrSelectorByDataFrameAddRemoveForFitModel.Reset() ucrModelName.Reset() @@ -135,45 +136,55 @@ Public Class dlgFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - 'todo. where is clsGLM used? - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, + strObjectName:="last_model") + + 'todo. where is clsGLMFunction used? + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) clsFamilyFunction = ucrFamily.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.bExcludeAssignedFunctionOutput = False - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMNB = clsRegressionDefaults.clsDefaultGLmNBFunction.Clone - clsGLMNB.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMNB.bExcludeAssignedFunctionOutput = False - clsGLMNB.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionNB = clsRegressionDefaults.clsDefaultGLmNBFunction.Clone + clsGLMFunctionNB.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionNB.bExcludeAssignedFunctionOutput = False + clsGLMFunctionNB.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMPolr = clsRegressionDefaults.clsDefaultGLmPolrFunction.Clone - clsGLMPolr.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMPolr.bExcludeAssignedFunctionOutput = False - clsGLMPolr.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionPolr = clsRegressionDefaults.clsDefaultGLmPolrFunction.Clone + clsGLMFunctionPolr.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionPolr.bExcludeAssignedFunctionOutput = False + clsGLMFunctionPolr.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMMultinom = clsRegressionDefaults.clsDefaultGLmMultinomFunction.Clone - clsGLMMultinom.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMMultinom.bExcludeAssignedFunctionOutput = False - clsGLMMultinom.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionMultinom = clsRegressionDefaults.clsDefaultGLmMultinomFunction.Clone + clsGLMFunctionMultinom.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionMultinom.bExcludeAssignedFunctionOutput = False + clsGLMFunctionMultinom.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, @@ -318,14 +329,17 @@ Public Class dlgFitModel Private Sub SetRCodeForControls(bReset As Boolean) bRCodeSet = False - ucrModelName.AddAdditionalRCode(clsGLMMultinom, bReset) - ucrModelName.AddAdditionalRCode(clsGLMPolr, bReset) - ucrModelName.AddAdditionalRCode(clsGLMNB, bReset) - ucrModelName.AddAdditionalRCode(clsGLM, bReset) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMNB, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 2) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMPolr, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 3) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMMultinom, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 4) + ucrModelName.AddAdditionalRCode(clsGLMFunctionMultinom, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunctionPolr, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunctionNB, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunction, bReset) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionNB, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 2) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionPolr, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 3) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionMultinom, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 4) + + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) + ucrModelName.AddAdditionalRCode(clsAOVFunction, bReset) ucrChkConvertToVariate.SetRCode(clsFormulaOperator, bReset) ucrReceiverResponseVar.SetRCode(clsRConvert, bReset) @@ -333,6 +347,7 @@ Public Class dlgFitModel ucrSelectorByDataFrameAddRemoveForFitModel.SetRCode(clsLM, bReset) ucrModelName.SetRCode(clsLM, bReset) ucrFamily.SetRCode(clsFamilyFunction, bReset) + bRCodeSet = True ResponseConvert() End Sub @@ -442,7 +457,7 @@ Public Class dlgFitModel End Sub Private Sub UpdatePreview() - If Not ucrReceiverResponseVar.IsEmpty AndAlso Not ucrReceiverExpressionFitModel.IsEmpty Then + If Not ucrReceiverResponseVar.IsEmpty Then ucrInputModelPreview.SetName(clsFormulaOperator.ToScript()) Else ucrInputModelPreview.SetName("") @@ -498,13 +513,15 @@ Public Class dlgFitModel If (ucrFamily.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Negative_Binomial_GLM") Then - clsLMOrGLM = clsGLMNB + clsLMOrGLM = clsGLMFunctionNB ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Ordered_Logistic") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then - clsLMOrGLM = clsGLMPolr + clsLMOrGLM = clsGLMFunctionPolr ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Multinomial") Then - clsLMOrGLM = clsGLMMultinom + clsLMOrGLM = clsGLMFunctionMultinom + ElseIf ucrFamily.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) @@ -534,7 +551,7 @@ Public Class dlgFitModel Private Sub ucrReceiverExpressionFitModel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlValueChanged ChooseRFunction() - ResponseConvert() + 'ResponseConvert() ChooseAnovaFunction() End Sub @@ -550,7 +567,7 @@ Public Class dlgFitModel ResponseVariableType() End Sub - Private Sub ucrReceiverExpressionFitModel_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlContentsChanged, ucrReceiverResponseVar.ControlContentsChanged + Private Sub ucrReceiverExpressionFitModel_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlContentsChanged UpdatePreview() TestOKEnabled() End Sub diff --git a/instat/dlgFourVariableModelling.Designer.vb b/instat/dlgFourVariableModelling.Designer.vb index ce87ae0c426..c2ea5402ad9 100644 --- a/instat/dlgFourVariableModelling.Designer.vb +++ b/instat/dlgFourVariableModelling.Designer.vb @@ -62,7 +62,6 @@ Partial Class dlgFourVariableModelling Me.cmdFirstExplanatoryFunction = New System.Windows.Forms.Button() Me.cmdSecondExplanatoryFunction = New System.Windows.Forms.Button() Me.cmdThirdExplanatoryFunction = New System.Windows.Forms.Button() - Me.UcrDialogDisabled1 = New instat.ucrDialogDisabled() Me.SuspendLayout() ' 'cmdModelOptions @@ -270,7 +269,7 @@ Partial Class dlgFourVariableModelling Me.ucrBaseFourVariableModelling.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrBaseFourVariableModelling.Location = New System.Drawing.Point(10, 406) Me.ucrBaseFourVariableModelling.Name = "ucrBaseFourVariableModelling" - Me.ucrBaseFourVariableModelling.Size = New System.Drawing.Size(405, 52) + Me.ucrBaseFourVariableModelling.Size = New System.Drawing.Size(408, 52) Me.ucrBaseFourVariableModelling.TabIndex = 23 ' 'ucrSaveModel @@ -318,22 +317,12 @@ Partial Class dlgFourVariableModelling Me.cmdThirdExplanatoryFunction.Text = "Function..." Me.cmdThirdExplanatoryFunction.UseVisualStyleBackColor = True ' - 'UcrDialogDisabled1 - ' - Me.UcrDialogDisabled1.AutoSize = True - Me.UcrDialogDisabled1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.UcrDialogDisabled1.Location = New System.Drawing.Point(125, 143) - Me.UcrDialogDisabled1.Name = "UcrDialogDisabled1" - Me.UcrDialogDisabled1.Size = New System.Drawing.Size(218, 117) - Me.UcrDialogDisabled1.TabIndex = 24 - ' 'dlgFourVariableModelling ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(546, 460) - Me.Controls.Add(Me.UcrDialogDisabled1) Me.Controls.Add(Me.cmdThirdExplanatoryFunction) Me.Controls.Add(Me.cmdSecondExplanatoryFunction) Me.Controls.Add(Me.cmdFirstExplanatoryFunction) @@ -394,5 +383,4 @@ Partial Class dlgFourVariableModelling Friend WithEvents cmdFirstExplanatoryFunction As Button Friend WithEvents cmdThirdExplanatoryFunction As Button Friend WithEvents cmdSecondExplanatoryFunction As Button - Friend WithEvents UcrDialogDisabled1 As ucrDialogDisabled End Class diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index 256923b4fc0..319eff77da8 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -17,25 +17,29 @@ Imports instat.Translations Public Class dlgFourVariableModelling Public bFirstLoad As Boolean = True - Public bReset As Boolean = True - Public bRCodeSet As Boolean = False + Private bReset As Boolean = True Public bResetModelOptions As Boolean = False + Public bResetThirdFunction As Boolean = False Public bResetDisplayOptions As Boolean = False Public bResetFirstFunction As Boolean = False Public bResetSecondFunction As Boolean = False - Public bResetThirdFunction As Boolean = False + Public bRCodeSet As Boolean = False Public clsRCIFunction, clsRConvert, clsFamilyFunction, clsVisReg As New RFunction - Public clsRSingleModelFunction, clsRNumeric, clsGLM, clsLM, clsFormulaFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsFormulaOperator As ROperator - Private clsFirstPowerOperator, clsSecondPowerOperator, clsThirdPowerOperator As ROperator - Public clsSecoandndThirdExplanatoryOpertor, clsOverallExplanatoryOperator As New ROperator - Private clsAnovaFunction, clsLMOrGLM, clsLmer, clsGlmer As RFunction - Private clsFirstTransformFunction, clsSecondTransformFunction, clsThirdTransformFunction As New RFunction - Private dctPlotFunctions As New Dictionary(Of String, RFunction) + Public clsRSingleModelFunction, clsThirdTransformFunction, clsLmer, clsGLMFunctioner, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction + Public clsFormulaOperator As New ROperator + Public clsGLMFunction, clsAOVFunction, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction + Private clsExplanatoryOperator As New ROperator + Private clsFirstTransformFunction As New RFunction + Private clsFirstPowerOperator, clsThirdPowerOperator, clsSecoandndThirdExplanatoryOpertor, clsOverallExplanatoryOperator As New ROperator + Private clsSecondTransformFunction As New RFunction + Private clsSecondPowerOperator As New ROperator + + Private dctPlotFunctions As New Dictionary(Of String, RFunction) + Private Sub dlgFourVariableModelling_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() @@ -51,29 +55,33 @@ Public Class dlgFourVariableModelling End Sub Private Sub InitialiseDialog() - ucrBaseFourVariableModelling.iHelpTopicID = 385 + ucrBaseFourVariableModelling.clsRsyntax.iCallType = 2 + ucrBaseFourVariableModelling.iHelpTopicID = 385 ucrBaseFourVariableModelling.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrSelectorFourVariableModelling.SetParameter(New RParameter("data", 0)) ucrSelectorFourVariableModelling.SetParameterIsrfunction() - ucrReceiverResponse.SetParameter(New RParameter("x", 1)) + 'The main parameter will be in the as.numeric() function since it's always present there + ucrReceiverResponse.SetParameter(New RParameter("x", 0)) ucrReceiverResponse.SetParameterIsString() ucrReceiverResponse.bWithQuotes = False ucrReceiverResponse.Selector = ucrSelectorFourVariableModelling - ucrReceiverFirstExplanatory.SetParameter(New RParameter("x", 2)) + 'The main parameter will be in the transformation function since it's always present there + ucrReceiverFirstExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverFirstExplanatory.SetParameterIsString() ucrReceiverFirstExplanatory.bWithQuotes = False ucrReceiverFirstExplanatory.Selector = ucrSelectorFourVariableModelling - ucrReceiverSecondExplanatory.SetParameter(New RParameter("x", 3)) + 'The main parameter will be in the transformation function since it's always present there + ucrReceiverSecondExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverSecondExplanatory.SetParameterIsString() ucrReceiverSecondExplanatory.bWithQuotes = False ucrReceiverSecondExplanatory.Selector = ucrSelectorFourVariableModelling - ucrReceiverThirdExplanatory.SetParameter(New RParameter("x", 4)) + ucrReceiverThirdExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverThirdExplanatory.SetParameterIsString() ucrReceiverThirdExplanatory.bWithQuotes = False ucrReceiverThirdExplanatory.Selector = ucrSelectorFourVariableModelling @@ -92,6 +100,10 @@ Public Class dlgFourVariableModelling ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") + ucrChkConvertToNumeric.SetText("Convert to Variate") + ucrChkConvertToNumeric.AddParameterIsRFunctionCondition(True, "y", True) + ucrChkConvertToNumeric.AddParameterIsRFunctionCondition(False, "y", False) + ucrInputModelOperators1.SetItems({"+", "*", ":", "/", "|"}) ucrInputModelOperators1.SetDropDownStyleAsNonEditable() @@ -99,29 +111,41 @@ Public Class dlgFourVariableModelling ucrInputModelOperators2.SetDropDownStyleAsNonEditable() ucrModelPreview.IsReadOnly = True + + 'temp hidden until working + 'cmdResponseFunction.Visible = False End Sub Private Sub SetDefaults() clsFamilyFunction = New RFunction - clsRNumeric = New RFunction + clsAsNumeric = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsAOVFunction = New RFunction + clsGLMFunction = New RFunction + clsFirstTransformFunction = New RFunction + clsSecondTransformFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction - clsFirstTransformFunction = New RFunction - clsSecondTransformFunction = New RFunction clsThirdTransformFunction = New RFunction clsLmer = New RFunction clsLMOrGLM = New RFunction - clsGlmer = New RFunction + clsGLMFunctioner = New RFunction clsRstandardFunction = New RFunction clsHatvaluesFunction = New RFunction clsResidualFunction = New RFunction clsFittedValuesFunction = New RFunction + clsFirstTransformFunction = New RFunction + clsFirstPowerOperator = New ROperator + clsSecondTransformFunction = New RFunction + clsSecondPowerOperator = New ROperator + + clsFormulaOperator = New ROperator + clsExplanatoryOperator = New ROperator + clsFirstPowerOperator = New ROperator clsSecondPowerOperator = New ROperator clsThirdPowerOperator = New ROperator @@ -129,18 +153,25 @@ Public Class dlgFourVariableModelling clsSecoandndThirdExplanatoryOpertor = New ROperator clsOverallExplanatoryOperator = New ROperator + clsRstandardFunction = New RFunction + clsHatvaluesFunction = New RFunction + clsResidualFunction = New RFunction + clsFittedValuesFunction = New RFunction + ucrSelectorFourVariableModelling.Reset() ucrReceiverResponse.SetMeAsReceiver() + ucrChkConvertToNumeric.Visible = False + ucrBaseFourVariableModelling.clsRsyntax.ClearCodes() - clsSecoandndThirdExplanatoryOpertor.SetOperation("*") + clsSecoandndThirdExplanatoryOpertor.SetOperation("+") clsSecoandndThirdExplanatoryOpertor.bBrackets = False ucrDistributionChoice.SetDataType("numeric") ucrSaveModel.Reset() ucrModelPreview.Reset() - clsRNumeric.SetRCommand("as.numeric") + clsAsNumeric.SetRCommand("as.numeric") clsFormulaOperator = clsRegressionDefaults.clsDefaultFormulaOperator.Clone clsFormulaOperator.AddParameter("operator", clsROperatorParameter:=clsOverallExplanatoryOperator, iPosition:=1) @@ -150,50 +181,84 @@ Public Class dlgFourVariableModelling clsOverallExplanatoryOperator.AddParameter("operator2&3", clsROperatorParameter:=clsSecoandndThirdExplanatoryOpertor, iPosition:=1) clsOverallExplanatoryOperator.bBrackets = False + clsLM = clsRegressionDefaults.clsDefaultLmFunction.Clone() clsLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsLM.AddParameter("na.action", "na.exclude", iPosition:=4) + clsLM.bExcludeAssignedFunctionOutput = False + clsLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") + clsLmer.SetPackageName("lme4") clsLmer.SetRCommand("lmer") clsLmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunctioner.SetPackageName("lme4") + clsGLMFunctioner.SetRCommand("glmer") + clsGLMFunctioner.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunctioner.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + + + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") + + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") - clsGlmer.SetPackageName("lme4") - clsGlmer.SetRCommand("glmer") - clsGlmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGlmer.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsFirstPowerOperator.SetOperation("^") + clsFirstPowerOperator.AddParameter("power", 2, iPosition:=1) + clsFirstPowerOperator.bBrackets = False - clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsSecondPowerOperator.SetOperation("^") + clsSecondPowerOperator.AddParameter("power", 2, iPosition:=1) + clsSecondPowerOperator.bBrackets = False 'Residual Plots dctPlotFunctions = New Dictionary(Of String, RFunction)(clsRegressionDefaults.dctModelPlotFunctions) 'Model clsFormulaFunction = clsRegressionDefaults.clsDefaultFormulaFunction.Clone - clsFormulaFunction.iCallType = 2 + clsFormulaFunction.bExcludeAssignedFunctionOutput = False 'Summary clsSummaryFunction = clsRegressionDefaults.clsDefaultSummary.Clone - clsSummaryFunction.iCallType = 2 + clsSummaryFunction.bExcludeAssignedFunctionOutput = False 'ANOVA clsAnovaFunction = clsRegressionDefaults.clsDefaultAnovaFunction.Clone - clsAnovaFunction.iCallType = 2 + clsAnovaFunction.bExcludeAssignedFunctionOutput = False 'Confidence Interval clsConfint = clsRegressionDefaults.clsDefaultConfint.Clone - clsConfint.iCallType = 2 + clsConfint.bExcludeAssignedFunctionOutput = False 'FitModel clsVisReg.SetPackageName("visreg") clsVisReg.SetRCommand("visreg") clsVisReg.AddParameter("type", Chr(34) & "conditional" & Chr(34)) + 'changed gg parameter to FALSE since when TRUE no plot is given (not compatible with ggplot2 package) clsVisReg.AddParameter("gg", "FALSE") - clsVisReg.iCallType = 3 clsVisReg.bExcludeAssignedFunctionOutput = False clsFirstPowerOperator.SetOperation("^") @@ -207,22 +272,15 @@ Public Class dlgFourVariableModelling clsThirdPowerOperator.SetOperation("^") clsThirdPowerOperator.AddParameter("power", 2, iPosition:=1) clsThirdPowerOperator.bBrackets = False - - clsLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsLmer.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGlmer.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsResidualFunction.SetRCommand("residuals") clsFittedValuesFunction.SetRCommand("fitted.values") clsRstandardFunction.SetRCommand("rstandard") clsHatvaluesFunction.SetRCommand("hatvalues") + clsLMOrGLM = clsLmer ucrBaseFourVariableModelling.clsRsyntax.SetBaseRFunction(clsLmer) - ucrBaseFourVariableModelling.clsRsyntax.AddToAfterCodes(clsAnovaFunction, 1) ucrBaseFourVariableModelling.clsRsyntax.AddToAfterCodes(clsSummaryFunction, 2) - clsLMOrGLM = clsLmer bResetModelOptions = True bResetDisplayOptions = True @@ -233,25 +291,96 @@ Public Class dlgFourVariableModelling TestOKEnabled() End Sub + Private Sub assignToControlsChanged(ucrChangedControl As ucrCore) Handles ucrSaveModel.ControlValueChanged + + '--------------------------------------------------------------------- + 'model summaries outputs + + 'stats output formula for the model + clsFormulaFunction.AddParameter("x", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsFormulaFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + 'anova output summary for the model + clsAnovaFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsAnovaFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + 'estimates output for the model + clsSummaryFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsSummaryFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + + 'confidence output limits for the model + clsConfint.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsConfint.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + '--------------------------------------------------------------------- + 'column outputs + 'note set assign has not been set here because it's done at the sub dialog level + 'through individual save controls linked to this dialog data frame selector + + clsResidualFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsFittedValuesFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsRstandardFunction.AddParameter("model", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsHatvaluesFunction.AddParameter("model", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + + '--------------------------------------------------------------------- + 'graphical outputs + + 'model plot output + clsVisReg.AddParameter("fit", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsVisReg.SetAssignToOutputObject(strRObjectToAssignTo:="last_graph", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Graph, + strRObjectFormatToAssignTo:=RObjectFormat.Image, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_graph") + + 'residual plots outputs + For Each kvp As KeyValuePair(Of String, RFunction) In dctPlotFunctions + kvp.Value.AddParameter("x", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + kvp.Value.SetAssignToOutputObject(strRObjectToAssignTo:="last_graph", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Graph, + strRObjectFormatToAssignTo:=RObjectFormat.Image, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_graph") + Next + + End Sub + Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False - - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSaveModel.AddAdditionalRCode(clsGlmer, 2) + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSaveModel.AddAdditionalRCode(clsGLMFunctioner, 2) ucrSaveModel.AddAdditionalRCode(clsLmer, 3) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, 4) - ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFourVariableModelling.GetParameter(), 1) - ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGlmer, ucrSelectorFourVariableModelling.GetParameter(), 2) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorFourVariableModelling.GetParameter(), 1) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunctioner, ucrSelectorFourVariableModelling.GetParameter(), 2) ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsLmer, ucrSelectorFourVariableModelling.GetParameter(), 3) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorFourVariableModelling.GetParameter(), 4) ucrInputModelOperators1.SetName(clsOverallExplanatoryOperator.strOperation) ucrInputModelOperators2.SetName(clsSecoandndThirdExplanatoryOpertor.strOperation) - ucrChkConvertToNumeric.SetRCode(clsFormulaOperator, bReset) ucrSelectorFourVariableModelling.SetRCode(clsLM, bReset) ucrSaveModel.SetRCode(clsLM, bReset) ucrDistributionChoice.SetRCode(clsFamilyFunction, bReset) - ucrReceiverResponse.SetRCode(clsRNumeric, bReset) + ucrReceiverResponse.SetRCode(clsAsNumeric, bReset) ucrReceiverFirstExplanatory.SetRCode(clsFirstTransformFunction, bReset) ucrReceiverSecondExplanatory.SetRCode(clsSecondTransformFunction, bReset) ucrReceiverThirdExplanatory.SetRCode(clsThirdTransformFunction, bReset) @@ -261,16 +390,13 @@ Public Class dlgFourVariableModelling SecondExplanatoryFunctionEnabled() ThirdExplanatoryFunctionEnabled() TestOKEnabled() - End Sub Public Sub TestOKEnabled() - ucrBaseFourVariableModelling.OKEnabled(False) ' temp. disabled - If (Not ucrReceiverResponse.IsEmpty()) AndAlso (Not ucrReceiverFirstExplanatory.IsEmpty()) AndAlso (Not ucrReceiverSecondExplanatory.IsEmpty()) AndAlso (Not ucrReceiverThirdExplanatory.IsEmpty()) AndAlso (ucrInputModelOperators1.GetText <> "") AndAlso (ucrInputModelOperators2.GetText <> "") Then - ' ucrBaseFourVariableModelling.OKEnabled(True) - UpdatePreview() - ' Else - ' ucrBaseFourVariableModelling.OKEnabled(False) + If Not ucrReceiverResponse.IsEmpty AndAlso Not ucrReceiverFirstExplanatory.IsEmpty AndAlso Not ucrReceiverSecondExplanatory.IsEmpty AndAlso Not ucrInputModelOperators1.IsEmpty AndAlso Not ucrInputModelOperators2.IsEmpty AndAlso Not ucrDistributionChoice.ucrInputDistributions.IsEmpty Then + ucrBaseFourVariableModelling.OKEnabled(True) + Else + ucrBaseFourVariableModelling.OKEnabled(False) End If End Sub @@ -286,15 +412,18 @@ Public Class dlgFourVariableModelling If bRCodeSet Then If Not ucrReceiverResponse.IsEmpty Then ucrDistributionChoice.RecieverDatatype(ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, ucrReceiverResponse.GetVariableNames(bWithQuotes:=False)) - If ucrReceiverResponse.strCurrDataType = "numeric" Then ucrChkConvertToNumeric.Checked = False ucrChkConvertToNumeric.Visible = False + 'temp disabled + 'cmdResponseFunction.Visible = True Else ucrChkConvertToNumeric.Visible = True + 'temp disabled + 'cmdResponseFunction.Visible = False End If If ucrChkConvertToNumeric.Checked Then - clsFormulaOperator.AddParameter("y", clsRFunctionParameter:=clsRNumeric, iPosition:=0) + clsFormulaOperator.AddParameter("y", clsRFunctionParameter:=clsAsNumeric, iPosition:=0) ucrDistributionChoice.RecieverDatatype("numeric") Else clsFormulaOperator.AddParameter("y", ucrReceiverResponse.GetVariableNames(False), iPosition:=0) @@ -303,9 +432,10 @@ Public Class dlgFourVariableModelling End If Else ucrChkConvertToNumeric.Visible = False + 'temp disabled + 'cmdResponseFunction.Visible = False End If - - If ucrDistributionChoice.lstCurrentDistributions.Count = 0 Or ucrReceiverResponse.IsEmpty() Then + If ucrDistributionChoice.lstCurrentDistributions.Count = 0 OrElse ucrReceiverResponse.IsEmpty() Then ucrDistributionChoice.Enabled = False ucrDistributionChoice.ucrInputDistributions.SetName("") cmdModelOptions.Enabled = False @@ -313,29 +443,25 @@ Public Class dlgFourVariableModelling ucrDistributionChoice.Enabled = True cmdModelOptions.Enabled = True End If - ' UpdatePreview() + UpdatePreview() TestOKEnabled() End If End Sub - Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then - cmdFirstExplanatoryFunction.Enabled = True - Else - cmdFirstExplanatoryFunction.Enabled = False - End If + Private Sub ResponseControls_ControlValueChanged() Handles ucrReceiverResponse.ControlValueChanged, ucrChkConvertToNumeric.ControlValueChanged + SetBaseFunction() + ResponseConvert() + UpdatePreview() End Sub - Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then - cmdSecondExplanatoryFunction.Enabled = True - Else - cmdSecondExplanatoryFunction.Enabled = False - End If + Private Sub ucrBaseFourVariableModellingThreeVariableModelling_ClickReset(sender As Object, e As EventArgs) Handles ucrBaseFourVariableModelling.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() End Sub Private Sub ThirdExplanatoryFunctionEnabled() - If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then + If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then cmdThirdExplanatoryFunction.Enabled = True Else cmdThirdExplanatoryFunction.Enabled = False @@ -348,46 +474,20 @@ Public Class dlgFourVariableModelling TestOKEnabled() End Sub - Public Sub SetBaseFunction() + Private Sub SetBaseFunction() If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso Not ucrReceiverSecondExplanatory.IsEmpty AndAlso Not ucrReceiverResponse.IsEmpty Then - 'TODO: Include multinomial as an option And the appropriate function + If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal" And ucrInputModelOperators2.GetText <> "|") Then - 'sdgSimpleRegOptions.chkDisplayCLimits.Enabled = True - 'sdgSimpleRegOptions.lblConfLevel.Enabled = True - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = True clsLMOrGLM = clsLM ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal" And ucrInputModelOperators2.GetText = "|") Then - ' sdgSimpleRegOptions.chkDisplayCLimits.Checked = False - ' sdgSimpleRegOptions.chkDisplayCLimits.Enabled = False - ' sdgSimpleRegOptions.lblConfLevel.Enabled = False - ' sdgSimpleRegOptions.nudDisplayCLevel.Enabled = False clsLMOrGLM = clsLmer ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag <> "Normal" And ucrInputModelOperators2.GetText = "|") Then - 'sdgSimpleRegOptions.chkDisplayCLimits.Checked = False - 'sdgSimpleRegOptions.chkDisplayCLimits.Enabled = False - ' sdgSimpleRegOptions.lblConfLevel.Enabled = False - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = False - clsLMOrGLM = clsGlmer + clsLMOrGLM = clsGLMFunctioner + ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOVFunction Else - ' sdgSimpleRegOptions.chkDisplayCLimits.Enabled = True - ' sdgSimpleRegOptions.lblConfLevel.Enabled = True - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = True - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If - clsFormulaFunction.AddParameter("x", clsRFunctionParameter:=clsLMOrGLM) - clsAnovaFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsSummaryFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsConfint.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsVisReg.AddParameter("fit", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - - For Each kvp As KeyValuePair(Of String, RFunction) In dctPlotFunctions - kvp.Value.AddParameter("x", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - Next - - clsResidualFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsFittedValuesFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsRstandardFunction.AddParameter("model", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsHatvaluesFunction.AddParameter("model", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) ucrBaseFourVariableModelling.clsRsyntax.SetBaseRFunction(clsLMOrGLM) End If End Sub @@ -399,6 +499,11 @@ Public Class dlgFourVariableModelling bResetDisplayOptions = False End Sub + Public Sub ucrFamily_cboDistributionsIndexChanged() Handles ucrDistributionChoice.DistributionsIndexChanged + SetBaseFunction() + clsFamilyFunction.RemoveParameterByName("link") + End Sub + Private Sub cmdModelOptions_Click(sender As Object, e As EventArgs) Handles cmdModelOptions.Click Dim clsTempParam As RParameter = Nothing @@ -415,20 +520,24 @@ Public Class dlgFourVariableModelling SetBaseFunction() End Sub - Private Sub cmdFirstFunction_Click(sender As Object, e As EventArgs) Handles cmdFirstExplanatoryFunction.Click + Private Sub cmdFirstExplanatoryFunction_Click(sender As Object, e As EventArgs) Handles cmdFirstExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsOverallExplanatoryOperator, clsNewTransformParameter:=clsOverallExplanatoryOperator.GetParameter("var2"), clsNewTransformFunction:=clsFirstTransformFunction, clsNewPowerOperator:=clsFirstPowerOperator, strVariableName:=ucrReceiverFirstExplanatory.GetVariableNames(False), bReset:=bResetFirstFunction) sdgVariableTransformations.ShowDialog() bResetFirstFunction = False UpdatePreview() End Sub - Private Sub cmdSecondFunction_Click(sender As Object, e As EventArgs) Handles cmdSecondExplanatoryFunction.Click + Private Sub cmdSecondExplanatoryFunction_Click(sender As Object, e As EventArgs) Handles cmdSecondExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsSecoandndThirdExplanatoryOpertor, clsNewTransformParameter:=clsSecoandndThirdExplanatoryOpertor.GetParameter("var3"), clsNewTransformFunction:=clsSecondTransformFunction, clsNewPowerOperator:=clsSecondPowerOperator, strVariableName:=ucrReceiverSecondExplanatory.GetVariableNames(False), bReset:=bResetSecondFunction) sdgVariableTransformations.ShowDialog() bResetSecondFunction = False UpdatePreview() End Sub + Private Sub ucrReceiverFirstExplanatory_contents() Handles ucrReceiverResponse.ControlContentsChanged, ucrReceiverFirstExplanatory.ControlContentsChanged, ucrReceiverSecondExplanatory.ControlContentsChanged, ucrInputModelOperators1.ControlContentsChanged, ucrInputModelOperators2.ControlContentsChanged, ucrReceiverThirdExplanatory.ControlContentsChanged + TestOKEnabled() + End Sub + Private Sub cmdThirdFunction_Click(sender As Object, e As EventArgs) Handles cmdThirdExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsSecoandndThirdExplanatoryOpertor, clsNewTransformParameter:=clsSecoandndThirdExplanatoryOpertor.GetParameter("var4"), clsNewTransformFunction:=clsThirdTransformFunction, clsNewPowerOperator:=clsThirdPowerOperator, strVariableName:=ucrReceiverThirdExplanatory.GetVariableNames(False), bReset:=bResetThirdFunction) sdgVariableTransformations.ShowDialog() @@ -485,9 +594,10 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() FirstExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub + Private Sub ucrReceiverSecondExplanatory_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSecondExplanatory.ControlValueChanged If bRCodeSet Then If Not ucrReceiverSecondExplanatory.IsEmpty Then @@ -498,7 +608,7 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() SecondExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub Private Sub ucrReceiverThirdExplanatory_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThirdExplanatory.ControlValueChanged @@ -511,13 +621,26 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() ThirdExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub - Private Sub ucrReceiverFirstExplanatory_contents() Handles ucrReceiverResponse.ControlContentsChanged, ucrReceiverFirstExplanatory.ControlContentsChanged, ucrReceiverSecondExplanatory.ControlContentsChanged, ucrInputModelOperators1.ControlContentsChanged, ucrInputModelOperators2.ControlContentsChanged, ucrReceiverThirdExplanatory.ControlContentsChanged - TestOKEnabled() + Private Sub FirstExplanatoryFunctionEnabled() + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + cmdFirstExplanatoryFunction.Enabled = True + Else + cmdFirstExplanatoryFunction.Enabled = False + End If End Sub + Private Sub SecondExplanatoryFunctionEnabled() + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + cmdSecondExplanatoryFunction.Enabled = True + Else + cmdSecondExplanatoryFunction.Enabled = False + End If + End Sub + + Private Sub ucrInputModelOperators1_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputModelOperators1.ControlValueChanged SetBaseFunction() SetOverallExplanatoryOperator() @@ -529,4 +652,6 @@ Public Class dlgFourVariableModelling SetSecondandThirdExplanatoryOperator() UpdatePreview() End Sub + + End Class \ No newline at end of file diff --git a/instat/dlgIDFCurves.Designer.vb b/instat/dlgIDFCurves.Designer.vb new file mode 100644 index 00000000000..f9af1238740 --- /dev/null +++ b/instat/dlgIDFCurves.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgIDFCurves + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'dlgIDFCurves + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(487, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgIDFCurves" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "IDF Curves" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgIDFCurves.resx b/instat/dlgIDFCurves.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgIDFCurves.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/dlgIDFCurves.vb b/instat/dlgIDFCurves.vb new file mode 100644 index 00000000000..e146ccf6d86 --- /dev/null +++ b/instat/dlgIDFCurves.vb @@ -0,0 +1,3 @@ +Public Class dlgIDFCurves + +End Class \ No newline at end of file diff --git a/instat/dlgOptionsByContextFItModel.vb b/instat/dlgOptionsByContextFItModel.vb index 424447c7f5b..774413160bc 100644 --- a/instat/dlgOptionsByContextFItModel.vb +++ b/instat/dlgOptionsByContextFItModel.vb @@ -29,7 +29,7 @@ Public Class dlgOptionsByContextFitModel Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsLMOrGLM, clsAOVFunction, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -145,11 +145,12 @@ Public Class dlgOptionsByContextFitModel clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction + clsAOVFunction = New RFunction clsModelFormula = New ROperator clsOverallInteractions = New ROperator @@ -198,11 +199,21 @@ Public Class dlgOptionsByContextFitModel clsLM = clsRegressionDefaults.clsDefaultLmFunction.Clone() clsLM.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFitModel.strCurrentDataFrame, + strObjectName:="last_model") 'Residual Plots dctPlotFunctions = New Dictionary(Of String, RFunction)(clsRegressionDefaults.dctModelPlotFunctions) @@ -238,7 +249,7 @@ Public Class dlgOptionsByContextFitModel clsHatvaluesFunction.SetRCommand("hatvalues") clsLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) + clsGLMFunction.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) ucrBase.clsRsyntax.SetBaseRFunction(clsLM) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True @@ -257,9 +268,10 @@ Public Class dlgOptionsByContextFitModel Private Sub SetRCodeForControls(bResetControls As Boolean) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFitModel.GetParameter(), 1) - + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorFitModel.GetParameter(), 1) + ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorFitModel.GetParameter(), 1) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, bReset) ucrReceiverContext1.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext2.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext3.SetRCode(clsContextsInteractions, bResetControls) @@ -359,8 +371,10 @@ Public Class dlgOptionsByContextFitModel If Not ucrReceiverResponse.IsEmpty Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If 'Update display functions to contain correct model diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb new file mode 100644 index 00000000000..32effdb64af --- /dev/null +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgSeasonalGraph + Inherits System.Windows.Forms.Form + + 'Form remplace la méthode Dispose pour nettoyer la liste des composants. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requise par le Concepteur Windows Form + Private components As System.ComponentModel.IContainer + + 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form + 'Elle peut être modifiée à l'aide du Concepteur Windows Form. + 'Ne la modifiez pas à l'aide de l'éditeur de code. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'dlgSeasonalGraph + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(600, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgSeasonalGraph" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Seasonal Graph" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgSeasonalGraph.resx b/instat/dlgSeasonalGraph.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgSeasonalGraph.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb new file mode 100644 index 00000000000..57ef68e0d9f --- /dev/null +++ b/instat/dlgSeasonalGraph.vb @@ -0,0 +1,3 @@ +Public Class dlgSeasonalGraph + +End Class \ No newline at end of file diff --git a/instat/dlgThreeVariablesModelling.vb b/instat/dlgThreeVariablesModelling.vb index 9594ed22d51..80a2882f804 100644 --- a/instat/dlgThreeVariablesModelling.vb +++ b/instat/dlgThreeVariablesModelling.vb @@ -27,7 +27,7 @@ Public Class dlgThreeVariableModelling Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction Public clsFormulaOperator As New ROperator - Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsAOVFunction, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -107,11 +107,12 @@ Public Class dlgThreeVariableModelling clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction + clsAOVFunction = New RFunction clsFirstTransformFunction = New RFunction @@ -155,12 +156,21 @@ Public Class dlgThreeVariableModelling strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, strObjectName:="last_model") + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.bExcludeAssignedFunctionOutput = False - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, @@ -168,7 +178,7 @@ Public Class dlgThreeVariableModelling clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) clsFirstPowerOperator.SetOperation("^") clsFirstPowerOperator.AddParameter("power", 2, iPosition:=1) @@ -295,10 +305,12 @@ Public Class dlgThreeVariableModelling Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorThreeVariableModelling.GetParameter(), 1) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, 1) + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrReceiverFirstExplanatory.AddAdditionalCodeParameterPair(clsFirstPowerOperator, New RParameter("x", 0), 1) ucrReceiverSecondExplanatory.AddAdditionalCodeParameterPair(clsSecondPowerOperator, New RParameter("x", 0), 1) + ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrInputModelOperator.SetName(clsExplanatoryOperator.strOperation) ucrChkConvertToNumeric.SetRCode(clsFormulaOperator, bReset) @@ -396,8 +408,10 @@ Public Class dlgThreeVariableModelling If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) End If @@ -474,7 +488,7 @@ Public Class dlgThreeVariableModelling End Sub Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then cmdFirstExplanatoryFunction.Enabled = True Else cmdFirstExplanatoryFunction.Enabled = False @@ -482,7 +496,7 @@ Public Class dlgThreeVariableModelling End Sub Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then cmdSecondExplanatoryFunction.Enabled = True Else cmdSecondExplanatoryFunction.Enabled = False diff --git a/instat/dlgTwoVariableFitModel.vb b/instat/dlgTwoVariableFitModel.vb index 029f31c2e1d..da56404685a 100644 --- a/instat/dlgTwoVariableFitModel.vb +++ b/instat/dlgTwoVariableFitModel.vb @@ -25,7 +25,7 @@ Public Class dlgTwoVariableFitModel Private clsVisReg, clsFamilyFunction As New RFunction Private clsTransformFunction As New RFunction Private clsBrokenStickFirstOperator, clsBrokenStickSecondOperator, clsBrokenStickThirdOperator, clsBrokenStickGeneralOperator As New ROperator - Private clsBrokenStickSecondOperFunction, clsBrokenStickIFunc As New RFunction + Private clsBrokenStickSecondOperFunction, clsAOVFunction, clsBrokenStickIFunc As New RFunction Private clsSplineFunc As New RFunction 'Tests @@ -44,7 +44,7 @@ Public Class dlgTwoVariableFitModel 'General case codes Private clsFormulaOperator As New ROperator - Private clsGLM, clsLM, clsLMOrGLM, clsAsNumeric, clsPolynomialFunc As New RFunction + Private clsGLMFunction, clsLM, clsLMOrGLM, clsAsNumeric, clsPolynomialFunc As New RFunction Private clsMonthFunc, clsYearFunc, clsAsFactorFunc As New RFunction Private clsAttach As New RFunction Private clsDetach As New RFunction @@ -170,7 +170,7 @@ Public Class dlgTwoVariableFitModel clsFormulaOperator = New ROperator clsPolynomialFunc = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsAsNumeric = New RFunction clsFamilyFunction = New RFunction clsFormulaFunction = New RFunction @@ -225,6 +225,7 @@ Public Class dlgTwoVariableFitModel clsWilcoxTestOperator = New ROperator clsVarTestOperator = New ROperator clsPropTestOperator = New ROperator + clsAOVFunction = New RFunction ucrBase.clsRsyntax.ClearCodes() @@ -245,10 +246,20 @@ Public Class dlgTwoVariableFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, strObjectName:="last_model") - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, + strObjectName:="last_model") + + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, @@ -283,7 +294,7 @@ Public Class dlgTwoVariableFitModel clsAsNumeric.SetRCommand("as.numeric") clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) clsLMOrGLM = clsLM @@ -556,7 +567,7 @@ Public Class dlgTwoVariableFitModel ucrSaveModels.AddAdditionalRCode(clsPropTestFunction, iAdditionalPairNo:=11) ucrSaveModels.AddAdditionalRCode(clsTtestFunction, iAdditionalPairNo:=12) ucrSaveModels.AddAdditionalRCode(clsMcnemarTestFunction, iAdditionalPairNo:=13) - ucrSaveModels.AddAdditionalRCode(clsGLM, iAdditionalPairNo:=14) + ucrSaveModels.AddAdditionalRCode(clsGLMFunction, iAdditionalPairNo:=14) ucrSaveModels.AddAdditionalRCode(clsOnewayTestFunction, iAdditionalPairNo:=15) ucrSaveModels.AddAdditionalRCode(clsNumericTtestFunction, iAdditionalPairNo:=16) ucrSaveModels.AddAdditionalRCode(clsNumericVarTestFunction, iAdditionalPairNo:=17) @@ -583,7 +594,9 @@ Public Class dlgTwoVariableFitModel ucrInputNullHypothesis.AddAdditionalCodeParameterPair(clsWilcoxTestFunction, New RParameter("mu", iNewPosition:=4), iAdditionalPairNo:=1) ucrInputNullHypothesis.SetRCode(clsTtestFunction, bReset) 'General case controls - ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorSimpleReg.GetParameter(), 1) + ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorSimpleReg.GetParameter(), 1) + ucrSaveModels.AddAdditionalRCode(clsAOVFunction, 1) + ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorSimpleReg.GetParameter(), 1) ucrReceiverResponse.SetRCode(clsAsNumeric, bReset) ucrReceiverExplanatory.SetRCode(clsTransformFunction, bReset) ucrPnlModelType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) @@ -591,6 +604,7 @@ Public Class dlgTwoVariableFitModel ucrChkConvertToVariate.SetRCode(clsFormulaOperator) ucrSaveModels.SetRCode(clsLM, bReset) ucrDistributionChoice.SetRCode(clsFamilyFunction, bReset) + bRCodeSet = True End Sub @@ -646,12 +660,15 @@ Public Class dlgTwoVariableFitModel If rdoGeneralCase.Checked Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") Then clsLMOrGLM = clsLM + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.AddToAfterCodes(clsAnovaFunction, 1) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, 2) ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) + ElseIf rdoTest.Checked Then ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAnovaFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 55609bdfb37..8b97727f1a8 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -261,10 +261,12 @@ Partial Class frmMain Me.mnuClimaticDescribeSummarise23Variables = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeGraph23Variables = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator31 = New System.Windows.Forms.ToolStripSeparator() - Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeSPISPEI = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeClimograph = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuClimaticDescribeTrendGraph = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuClimaticDescribeSeasonalGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeIDF = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeWindRose = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeWindPollutionRose = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeOtherRosePlots = New System.Windows.Forms.ToolStripMenuItem() @@ -278,7 +280,6 @@ Partial Class frmMain Me.mnuClimaticPICSA = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSARainfallGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSATemperatureGraph = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuClimaticPICSAGeneralGraph = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator73 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticPICSACumExeedenceGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSACrops = New System.Windows.Forms.ToolStripMenuItem() @@ -2139,7 +2140,7 @@ Partial Class frmMain ' 'mnuClimaticDescribe ' - Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) + Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeTrendGraph, Me.mnuClimaticDescribeSeasonalGraph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) Me.mnuClimaticDescribe.Name = "mnuClimaticDescribe" Me.mnuClimaticDescribe.Size = New System.Drawing.Size(212, 22) Me.mnuClimaticDescribe.Text = "Describe" @@ -2161,11 +2162,6 @@ Partial Class frmMain Me.ToolStripSeparator31.Name = "ToolStripSeparator31" Me.ToolStripSeparator31.Size = New System.Drawing.Size(208, 6) ' - 'ToolStripSeparator17 - ' - Me.ToolStripSeparator17.Name = "ToolStripSeparator17" - Me.ToolStripSeparator17.Size = New System.Drawing.Size(208, 6) - ' 'mnuClimaticDescribeSPISPEI ' Me.mnuClimaticDescribeSPISPEI.Name = "mnuClimaticDescribeSPISPEI" @@ -2179,6 +2175,19 @@ Partial Class frmMain Me.mnuClimaticDescribeClimograph.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeClimograph.Text = "Climograph..." ' + 'mnuClimaticDescribeTrendGraph + ' + Me.mnuClimaticDescribeTrendGraph.Name = "mnuClimaticDescribeTrendGraph" + Me.mnuClimaticDescribeTrendGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeTrendGraph.Text = "Trend Graph..." + ' + 'mnuClimaticDescribeSeasonalGraph + ' + Me.mnuClimaticDescribeSeasonalGraph.Enabled = False + Me.mnuClimaticDescribeSeasonalGraph.Name = "mnuClimaticDescribeSeasonalGraph" + Me.mnuClimaticDescribeSeasonalGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeSeasonalGraph.Text = "Seasonal Graph..." + ' 'mnuClimaticDescribeIDF ' Me.mnuClimaticDescribeIDF.Enabled = False @@ -2186,6 +2195,11 @@ Partial Class frmMain Me.mnuClimaticDescribeIDF.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeIDF.Text = "IDF..." ' + 'ToolStripSeparator17 + ' + Me.ToolStripSeparator17.Name = "ToolStripSeparator17" + Me.ToolStripSeparator17.Size = New System.Drawing.Size(208, 6) + ' 'mnuClimaticDescribeWindRose ' Me.mnuClimaticDescribeWindRose.Name = "mnuClimaticDescribeWindRose" @@ -2249,7 +2263,7 @@ Partial Class frmMain ' 'mnuClimaticPICSA ' - Me.mnuClimaticPICSA.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticPICSARainfallGraph, Me.mnuClimaticPICSATemperatureGraph, Me.mnuClimaticPICSAGeneralGraph, Me.ToolStripSeparator73, Me.mnuClimaticPICSACumExeedenceGraph, Me.mnuClimaticPICSACrops}) + Me.mnuClimaticPICSA.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticPICSARainfallGraph, Me.mnuClimaticPICSATemperatureGraph, Me.ToolStripSeparator73, Me.mnuClimaticPICSACumExeedenceGraph, Me.mnuClimaticPICSACrops}) Me.mnuClimaticPICSA.Name = "mnuClimaticPICSA" Me.mnuClimaticPICSA.Size = New System.Drawing.Size(212, 22) Me.mnuClimaticPICSA.Text = "PICSA" @@ -2266,12 +2280,6 @@ Partial Class frmMain Me.mnuClimaticPICSATemperatureGraph.Size = New System.Drawing.Size(246, 22) Me.mnuClimaticPICSATemperatureGraph.Text = "Temperature Graph..." ' - 'mnuClimaticPICSAGeneralGraph - ' - Me.mnuClimaticPICSAGeneralGraph.Name = "mnuClimaticPICSAGeneralGraph" - Me.mnuClimaticPICSAGeneralGraph.Size = New System.Drawing.Size(246, 22) - Me.mnuClimaticPICSAGeneralGraph.Text = "General Graph..." - ' 'ToolStripSeparator73 ' Me.ToolStripSeparator73.Name = "ToolStripSeparator73" @@ -5698,8 +5706,6 @@ Partial Class frmMain Friend WithEvents mnuPrepareDataReshapeRandomSplit As ToolStripMenuItem - - Friend WithEvents mnuClimaticPICSAGeneralGraph As ToolStripMenuItem Friend WithEvents ToolStripSeparator73 As ToolStripSeparator Friend WithEvents mnuOptionsByContextCropModel As ToolStripMenuItem Friend WithEvents mnuOptionsByContextCropModelApsimxExamples As ToolStripMenuItem @@ -5766,4 +5772,6 @@ Partial Class frmMain Friend WithEvents mnuClimaticDescribeWindRose As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeWindPollutionRose As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeOtherRosePlots As ToolStripMenuItem + Friend WithEvents mnuClimaticDescribeTrendGraph As ToolStripMenuItem + Friend WithEvents mnuClimaticDescribeSeasonalGraph As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index d57cdd8e5c4..3d47b2e8971 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2501,11 +2501,6 @@ Public Class frmMain dlgRandomSplit.ShowDialog() End Sub - Private Sub mnuClimaticPICSAGeneralGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticPICSAGeneralGraph.Click - dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General - dlgPICSARainfall.ShowDialog() - End Sub - 'Private Sub mnuOptionsByContextCropModel_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModel.Click ' dlgApsimx.ShowDialog() 'End Sub @@ -2632,4 +2627,17 @@ Public Class frmMain Private Sub mnuClimaticDescribeOtherRosePlots_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeOtherRosePlots.Click dlgOtherRosePlots.ShowDialog() End Sub + + Private Sub mnuClimaticDescribeTrendGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeTrendGraph.Click + dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General + dlgPICSARainfall.ShowDialog() + End Sub + + Private Sub mnuClimaticDescribeSeasonalGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeSeasonalGraph.Click + dlgSeasonalGraph.ShowDialog() + End Sub + + Private Sub mnuClimaticDescribeIDF_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeIDF.Click + dlgIDFCurves.ShowDialog() + End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 4c289e05e77..eb03c008b07 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -245,6 +245,12 @@ Form + + dlgIDFCurves.vb + + + Form + dlgImportFromPostgres.vb @@ -263,6 +269,12 @@ Form + + dlgSeasonalGraph.vb + + + Form + dlgSurvey.vb @@ -3038,6 +3050,9 @@ dlgHomogenization.vb + + dlgIDFCurves.vb + dlgImportERA5Data.vb @@ -3071,6 +3086,9 @@ dlgSearch.vb + + dlgSeasonalGraph.vb + dlgSeasonalPlot.vb diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 146319c740f..82e0f26e6ea 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -2827,7 +2827,7 @@ Public Class sdgPlots Private Function GetAesParameterArgValue(strAes As String) As String Dim strVariable As String = "" - If clsGlobalAesFunction.ContainsParameter(strAes) Then + If clsGlobalAesFunction IsNot Nothing AndAlso clsGlobalAesFunction.ContainsParameter(strAes) Then strVariable = clsGlobalAesFunction.GetParameter(strAes).strArgumentValue End If @@ -2839,7 +2839,7 @@ Public Class sdgPlots strAes = If(bIsX, "x", "y") Dim bIsFactor As Boolean = False - If clsGlobalAesFunction.ContainsParameter(strAes) Then + If clsGlobalAesFunction IsNot Nothing AndAlso clsGlobalAesFunction.ContainsParameter(strAes) Then Dim strCurrDataType As String = "" Dim clsGetDataType As New RFunction diff --git a/instat/ucrDistributions.vb b/instat/ucrDistributions.vb index c5421a64138..6991056259b 100644 --- a/instat/ucrDistributions.vb +++ b/instat/ucrDistributions.vb @@ -126,6 +126,11 @@ Public Class ucrDistributions End Sub + Public Sub SetAOVDistributions() + strDistributionType = "AOVFunctions" + SetDistributions() + End Sub + Public Sub SetExactDistributions() ' this addition is temporary strDistributionType = "ExactSolution" SetDistributions() @@ -187,6 +192,39 @@ Public Class ucrDistributions End If End Select End If + Case "AOVFunctions" + If (Dist.strAOVFunctionName <> "") Then + Select Case strDataType + Case "logical" + If Dist.bTwoLevelFactor Then + bUse = True + End If + Case "numeric", "integer" + If Dist.bNumeric Then + bUse = True + End If + Case "positive integer" + If Dist.bPositiveInt Or Dist.bNumeric Then + bUse = True + End If + Case "two level numeric" + If Dist.bNumeric Or Dist.bTwoLevelFactor Then + bUse = True + End If + Case "two level factor" + If Dist.bTwoLevelFactor Then + bUse = True + End If + Case "factor" + If Dist.bFactor Then + bUse = True + End If + Case "ordered,factor" + If Dist.bFactor Then + bUse = True + End If + End Select + End If Case Else If Dist.strRName <> "" Then bUse = True @@ -239,6 +277,7 @@ Public Class ucrDistributions Dim clsGlmNegativeBinomialDist As New Distribution Dim clsPolarDist As New Distribution Dim clsMultinomDist As New Distribution + Dim clsNormalAovDist As New Distribution ' Normal distribution clsNormalDist.strNameTag = "Normal" @@ -257,6 +296,15 @@ Public Class ucrDistributions clsNormalDist.AddParameter("sd", "Standard_deviation", 1) lstAllDistributions.Add(clsNormalDist) + ' AOV distribution + clsNormalAovDist.strNameTag = "Normal_aov" + clsNormalAovDist.strRName = "aov" + clsNormalAovDist.strGLMFunctionName = "aov" + clsNormalAovDist.strAOVFunctionName = "aov" + clsNormalAovDist.bNumeric = True + clsNormalAovDist.bIsContinuous = True + lstAllDistributions.Add(clsNormalAovDist) + ' Exponential Distribution clsExponentialDist.strNameTag = "Exponential" clsExponentialDist.strRName = "exp" @@ -662,6 +710,8 @@ Public Class ucrDistributions clsCurrRFunction.SetRCommand(clsCurrDistribution.strQFunctionName) Case "GLMFunctions" clsCurrRFunction.SetRCommand(clsCurrDistribution.strGLMFunctionName) + Case "AOVFunctions" + clsCurrRFunction.SetRCommand(clsCurrDistribution.strAOVFunctionName) Case "ExactSolution" clsCurrRFunction.SetRCommand(clsCurrDistribution.strExactName) End Select diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index eadd554619a..8786d75b9b1 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -63,6 +63,15 @@ Public Class ucrSelector 'always load selector contents on load event because contents may have been changed at R level 'and the control needs to refresh the data frame names. LoadList() + 'always return the focus to the first Receiver when re-opening the dialogue. + If lstOrderedReceivers.Count > 0 Then + Dim lstVisibleReceivers As List(Of ucrReceiver) + lstVisibleReceivers = lstOrderedReceivers.Where(Function(ctrl) ctrl.Visible).ToList() + lstVisibleReceivers = lstVisibleReceivers.OrderBy(Function(ucr) ucr.TabIndex).ToList() + If lstVisibleReceivers.Count > 0 Then + SetCurrentReceiver(lstVisibleReceivers(0)) 'set the focus to the first Receiver in the dialogue. + End If + End If End Sub Protected Sub OnResetAll()