From b56c1da867bf57c6b0b58e03e59a9bb1fab62fe2 Mon Sep 17 00:00:00 2001 From: Marthafuraha Massawe Date: Mon, 30 Nov 2015 14:59:18 +0300 Subject: [PATCH] Adding the fit for Gamma distriution dialog to the project --- instat/MultilingualResources/instat.fr-FR.xlf | 133 ++++++++- instat/MultilingualResources/instat.sw-KE.xlf | 133 ++++++++- instat/My Project/Resources.fr-FR.resx | 3 - instat/dlgGammaDistr.designer.vb | 282 ++++++++++++++++++ instat/dlgGammaDistr.fr-FR.resx | 15 + instat/dlgGammaDistr.resx | 120 ++++++++ instat/dlgGammaDistr.sw-KE.resx | 15 + instat/dlgGammaDistr.vb | 85 ++++++ instat/frmMain.vb | 4 + 9 files changed, 775 insertions(+), 15 deletions(-) create mode 100644 instat/dlgGammaDistr.designer.vb create mode 100644 instat/dlgGammaDistr.fr-FR.resx create mode 100644 instat/dlgGammaDistr.resx create mode 100644 instat/dlgGammaDistr.sw-KE.resx create mode 100644 instat/dlgGammaDistr.vb diff --git a/instat/MultilingualResources/instat.fr-FR.xlf b/instat/MultilingualResources/instat.fr-FR.xlf index 5ca34ef3ac4..2212e9ab92c 100644 --- a/instat/MultilingualResources/instat.fr-FR.xlf +++ b/instat/MultilingualResources/instat.fr-FR.xlf @@ -594,10 +594,6 @@ Available Variables Variables disponibles - - Box Plot - Diagramme à surfaces - Cancel Annuler @@ -1182,6 +1178,46 @@ Two Two + + Continuity Correction + Continuity Correction + + + Layout of data + Layout of data + + + Make Result as a factor + Make Result as a factor + + + New Value + New Value + + + Range End + Range End + + + Range Start + Range Start + + + Save values + Save values + + + New + New + + + With a Label + With a Label + + + Write back to the data + Write back to the data + @@ -2088,12 +2124,97 @@ - + +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + + True + True + + + True + True + + + True + True + + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+
- +
\ No newline at end of file diff --git a/instat/MultilingualResources/instat.sw-KE.xlf b/instat/MultilingualResources/instat.sw-KE.xlf index 8a0785e7bfa..8cf80812207 100644 --- a/instat/MultilingualResources/instat.sw-KE.xlf +++ b/instat/MultilingualResources/instat.sw-KE.xlf @@ -98,10 +98,6 @@ Available Variables Available Variables - - Box Plot - Box Plot - Cancel Katisha @@ -687,6 +683,46 @@ Two Two + + Continuity Correction + Continuity Correction + + + Layout of data + Layout of data + + + Make Result as a factor + Make Result as a factor + + + New Value + New Value + + + Range End + Range End + + + Range Start + Range Start + + + Save values + Save values + + + New + New + + + With a Label + With a Label + + + Write back to the data + Write back to the data +
@@ -2089,12 +2125,97 @@ - + +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + + True + True + + + True + True + + + True + True + + + +
+ +
+ +
+ + + +
+ +
+ +
+ + + +
+
- +
\ No newline at end of file diff --git a/instat/My Project/Resources.fr-FR.resx b/instat/My Project/Resources.fr-FR.resx index 77e80f30158..6a764a4f24d 100644 --- a/instat/My Project/Resources.fr-FR.resx +++ b/instat/My Project/Resources.fr-FR.resx @@ -33,9 +33,6 @@ Variables disponibles - - Diagramme à surfaces - Annuler diff --git a/instat/dlgGammaDistr.designer.vb b/instat/dlgGammaDistr.designer.vb new file mode 100644 index 00000000000..4fe8292599b --- /dev/null +++ b/instat/dlgGammaDistr.designer.vb @@ -0,0 +1,282 @@ + _ +Partial Class dlgGammaDistr + 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.ucrBase = New instat.ucrButtons() + Me.ucrAddRemove = New instat.ucrSelectorAddRemove() + Me.grpColumns = New System.Windows.Forms.GroupBox() + Me.rdoMultipleColumns = New System.Windows.Forms.RadioButton() + Me.rdoSingleColumn = New System.Windows.Forms.RadioButton() + Me.ucrReceiverColumn = New instat.ucrReceiverSingle() + Me.lblSelectedColumn = New System.Windows.Forms.Label() + Me.grpEstimationMethods = New System.Windows.Forms.GroupBox() + Me.cboMethodofMoments = New System.Windows.Forms.ComboBox() + Me.cboMaximumLikelihood = New System.Windows.Forms.ComboBox() + Me.lblSaveEstimates = New System.Windows.Forms.Label() + Me.chkMethodofMoments = New System.Windows.Forms.CheckBox() + Me.chkMaximumLikelihood = New System.Windows.Forms.CheckBox() + Me.chkRestrictValues = New System.Windows.Forms.CheckBox() + Me.lblBetween = New System.Windows.Forms.Label() + Me.lblAnd = New System.Windows.Forms.Label() + Me.txtBetween = New System.Windows.Forms.TextBox() + Me.txtAnd = New System.Windows.Forms.TextBox() + Me.chkProbabilityPlot = New System.Windows.Forms.CheckBox() + Me.grpColumns.SuspendLayout() + Me.grpEstimationMethods.SuspendLayout() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(12, 283) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 32) + Me.ucrBase.TabIndex = 0 + ' + 'ucrAddRemove + ' + Me.ucrAddRemove.Location = New System.Drawing.Point(12, 44) + Me.ucrAddRemove.Name = "ucrAddRemove" + Me.ucrAddRemove.Size = New System.Drawing.Size(203, 127) + Me.ucrAddRemove.TabIndex = 1 + ' + 'grpColumns + ' + Me.grpColumns.Controls.Add(Me.rdoMultipleColumns) + Me.grpColumns.Controls.Add(Me.rdoSingleColumn) + Me.grpColumns.Location = New System.Drawing.Point(12, -1) + Me.grpColumns.Name = "grpColumns" + Me.grpColumns.Size = New System.Drawing.Size(392, 39) + Me.grpColumns.TabIndex = 2 + Me.grpColumns.TabStop = False + ' + 'rdoMultipleColumns + ' + Me.rdoMultipleColumns.AutoSize = True + Me.rdoMultipleColumns.Location = New System.Drawing.Point(209, 13) + Me.rdoMultipleColumns.Name = "rdoMultipleColumns" + Me.rdoMultipleColumns.Size = New System.Drawing.Size(103, 17) + Me.rdoMultipleColumns.TabIndex = 1 + Me.rdoMultipleColumns.TabStop = True + Me.rdoMultipleColumns.Tag = "Multiple_columns" + Me.rdoMultipleColumns.Text = "Multiple columns" + Me.rdoMultipleColumns.UseVisualStyleBackColor = True + ' + 'rdoSingleColumn + ' + Me.rdoSingleColumn.AutoSize = True + Me.rdoSingleColumn.Location = New System.Drawing.Point(6, 13) + Me.rdoSingleColumn.Name = "rdoSingleColumn" + Me.rdoSingleColumn.Size = New System.Drawing.Size(91, 17) + Me.rdoSingleColumn.TabIndex = 0 + Me.rdoSingleColumn.TabStop = True + Me.rdoSingleColumn.Tag = "Single_column" + Me.rdoSingleColumn.Text = "Single column" + Me.rdoSingleColumn.UseVisualStyleBackColor = True + ' + 'ucrReceiverColumn + ' + Me.ucrReceiverColumn.Location = New System.Drawing.Point(221, 60) + Me.ucrReceiverColumn.Name = "ucrReceiverColumn" + Me.ucrReceiverColumn.Size = New System.Drawing.Size(106, 26) + Me.ucrReceiverColumn.TabIndex = 3 + ' + 'lblSelectedColumn + ' + Me.lblSelectedColumn.AutoSize = True + Me.lblSelectedColumn.Location = New System.Drawing.Point(221, 44) + Me.lblSelectedColumn.Name = "lblSelectedColumn" + Me.lblSelectedColumn.Size = New System.Drawing.Size(86, 13) + Me.lblSelectedColumn.TabIndex = 4 + Me.lblSelectedColumn.Tag = "Selected_column" + Me.lblSelectedColumn.Text = "Selected column" + ' + 'grpEstimationMethods + ' + Me.grpEstimationMethods.Controls.Add(Me.cboMethodofMoments) + Me.grpEstimationMethods.Controls.Add(Me.cboMaximumLikelihood) + Me.grpEstimationMethods.Controls.Add(Me.lblSaveEstimates) + Me.grpEstimationMethods.Controls.Add(Me.chkMethodofMoments) + Me.grpEstimationMethods.Controls.Add(Me.chkMaximumLikelihood) + Me.grpEstimationMethods.Location = New System.Drawing.Point(18, 177) + Me.grpEstimationMethods.Name = "grpEstimationMethods" + Me.grpEstimationMethods.Size = New System.Drawing.Size(241, 91) + Me.grpEstimationMethods.TabIndex = 5 + Me.grpEstimationMethods.TabStop = False + Me.grpEstimationMethods.Tag = "Estimation_methods" + Me.grpEstimationMethods.Text = "Estimation methods" + ' + 'cboMethodofMoments + ' + Me.cboMethodofMoments.FormattingEnabled = True + Me.cboMethodofMoments.Location = New System.Drawing.Point(147, 65) + Me.cboMethodofMoments.Name = "cboMethodofMoments" + Me.cboMethodofMoments.Size = New System.Drawing.Size(84, 21) + Me.cboMethodofMoments.TabIndex = 4 + ' + 'cboMaximumLikelihood + ' + Me.cboMaximumLikelihood.FormattingEnabled = True + Me.cboMaximumLikelihood.Location = New System.Drawing.Point(147, 32) + Me.cboMaximumLikelihood.Name = "cboMaximumLikelihood" + Me.cboMaximumLikelihood.Size = New System.Drawing.Size(84, 21) + Me.cboMaximumLikelihood.TabIndex = 3 + ' + 'lblSaveEstimates + ' + Me.lblSaveEstimates.AutoSize = True + Me.lblSaveEstimates.Location = New System.Drawing.Point(144, 16) + Me.lblSaveEstimates.Name = "lblSaveEstimates" + Me.lblSaveEstimates.Size = New System.Drawing.Size(90, 13) + Me.lblSaveEstimates.TabIndex = 2 + Me.lblSaveEstimates.Tag = "Save_estimates_in" + Me.lblSaveEstimates.Text = "Save estimates in" + ' + 'chkMethodofMoments + ' + Me.chkMethodofMoments.AutoSize = True + Me.chkMethodofMoments.Location = New System.Drawing.Point(6, 65) + Me.chkMethodofMoments.Name = "chkMethodofMoments" + Me.chkMethodofMoments.Size = New System.Drawing.Size(119, 17) + Me.chkMethodofMoments.TabIndex = 1 + Me.chkMethodofMoments.Tag = "Method_of_moments" + Me.chkMethodofMoments.Text = "Method of moments" + Me.chkMethodofMoments.UseVisualStyleBackColor = True + ' + 'chkMaximumLikelihood + ' + Me.chkMaximumLikelihood.AutoSize = True + Me.chkMaximumLikelihood.Location = New System.Drawing.Point(6, 32) + Me.chkMaximumLikelihood.Name = "chkMaximumLikelihood" + Me.chkMaximumLikelihood.Size = New System.Drawing.Size(117, 17) + Me.chkMaximumLikelihood.TabIndex = 0 + Me.chkMaximumLikelihood.Tag = "Maximum_likelihood_" + Me.chkMaximumLikelihood.Text = "Maximum likelihood" + Me.chkMaximumLikelihood.UseVisualStyleBackColor = True + ' + 'chkRestrictValues + ' + Me.chkRestrictValues.AutoSize = True + Me.chkRestrictValues.Location = New System.Drawing.Point(249, 104) + Me.chkRestrictValues.Name = "chkRestrictValues" + Me.chkRestrictValues.Size = New System.Drawing.Size(120, 17) + Me.chkRestrictValues.TabIndex = 6 + Me.chkRestrictValues.Tag = "Restrict_data_values" + Me.chkRestrictValues.Text = "Restrict data values" + Me.chkRestrictValues.UseVisualStyleBackColor = True + ' + 'lblBetween + ' + Me.lblBetween.AutoSize = True + Me.lblBetween.Location = New System.Drawing.Point(259, 132) + Me.lblBetween.Name = "lblBetween" + Me.lblBetween.Size = New System.Drawing.Size(48, 13) + Me.lblBetween.TabIndex = 7 + Me.lblBetween.Tag = "between" + Me.lblBetween.Text = "between" + ' + 'lblAnd + ' + Me.lblAnd.AutoSize = True + Me.lblAnd.Location = New System.Drawing.Point(352, 132) + Me.lblAnd.Name = "lblAnd" + Me.lblAnd.Size = New System.Drawing.Size(25, 13) + Me.lblAnd.TabIndex = 8 + Me.lblAnd.Tag = "and" + Me.lblAnd.Text = "and" + ' + 'txtBetween + ' + Me.txtBetween.Location = New System.Drawing.Point(313, 129) + Me.txtBetween.Name = "txtBetween" + Me.txtBetween.Size = New System.Drawing.Size(33, 20) + Me.txtBetween.TabIndex = 9 + ' + 'txtAnd + ' + Me.txtAnd.Location = New System.Drawing.Point(383, 128) + Me.txtAnd.Name = "txtAnd" + Me.txtAnd.Size = New System.Drawing.Size(35, 20) + Me.txtAnd.TabIndex = 10 + ' + 'chkProbabilityPlot + ' + Me.chkProbabilityPlot.AutoSize = True + Me.chkProbabilityPlot.Location = New System.Drawing.Point(279, 193) + Me.chkProbabilityPlot.Name = "chkProbabilityPlot" + Me.chkProbabilityPlot.Size = New System.Drawing.Size(94, 17) + Me.chkProbabilityPlot.TabIndex = 11 + Me.chkProbabilityPlot.Tag = "Probability_plot" + Me.chkProbabilityPlot.Text = "Probability plot" + Me.chkProbabilityPlot.UseVisualStyleBackColor = True + ' + 'dlgGammaDistr + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(430, 327) + Me.Controls.Add(Me.chkProbabilityPlot) + Me.Controls.Add(Me.txtAnd) + Me.Controls.Add(Me.txtBetween) + Me.Controls.Add(Me.lblAnd) + Me.Controls.Add(Me.lblBetween) + Me.Controls.Add(Me.chkRestrictValues) + Me.Controls.Add(Me.grpEstimationMethods) + Me.Controls.Add(Me.lblSelectedColumn) + Me.Controls.Add(Me.ucrReceiverColumn) + Me.Controls.Add(Me.grpColumns) + Me.Controls.Add(Me.ucrAddRemove) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "dlgGammaDistr" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Tag = "Fit_a_Gamma_distribution" + Me.Text = "Fit a Gamma Distribution" + Me.grpColumns.ResumeLayout(False) + Me.grpColumns.PerformLayout() + Me.grpEstimationMethods.ResumeLayout(False) + Me.grpEstimationMethods.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrAddRemove As ucrSelectorAddRemove + Friend WithEvents grpColumns As GroupBox + Friend WithEvents ucrReceiverColumn As ucrReceiverSingle + Friend WithEvents lblSelectedColumn As Label + Friend WithEvents rdoMultipleColumns As RadioButton + Friend WithEvents rdoSingleColumn As RadioButton + Friend WithEvents grpEstimationMethods As GroupBox + Friend WithEvents lblSaveEstimates As Label + Friend WithEvents chkMethodofMoments As CheckBox + Friend WithEvents chkMaximumLikelihood As CheckBox + Friend WithEvents cboMethodofMoments As ComboBox + Friend WithEvents cboMaximumLikelihood As ComboBox + Friend WithEvents chkRestrictValues As CheckBox + Friend WithEvents lblBetween As Label + Friend WithEvents lblAnd As Label + Friend WithEvents txtBetween As TextBox + Friend WithEvents txtAnd As TextBox + Friend WithEvents chkProbabilityPlot As CheckBox +End Class diff --git a/instat/dlgGammaDistr.fr-FR.resx b/instat/dlgGammaDistr.fr-FR.resx new file mode 100644 index 00000000000..a3df4f013d3 --- /dev/null +++ b/instat/dlgGammaDistr.fr-FR.resx @@ -0,0 +1,15 @@ + + + + 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/dlgGammaDistr.resx b/instat/dlgGammaDistr.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgGammaDistr.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/dlgGammaDistr.sw-KE.resx b/instat/dlgGammaDistr.sw-KE.resx new file mode 100644 index 00000000000..a3df4f013d3 --- /dev/null +++ b/instat/dlgGammaDistr.sw-KE.resx @@ -0,0 +1,15 @@ + + + + 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/dlgGammaDistr.vb b/instat/dlgGammaDistr.vb new file mode 100644 index 00000000000..11a73624660 --- /dev/null +++ b/instat/dlgGammaDistr.vb @@ -0,0 +1,85 @@ +' Instat-R +' Copyright (C) 2015 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License k +' along with this program. If not, see . +Imports instat.Translations + +Public Class dlgGammaDistr + Private Sub dlgGammaDistr_Load(sender As Object, e As EventArgs) Handles MyBase.Load + chkRestrictValues.Checked = False + lblBetween.Visible = False + txtBetween.Visible = False + lblAnd.Visible = False + txtAnd.Visible = False + chkMaximumLikelihood.Checked = False + chkMethodofMoments.Checked = False + cboMaximumLikelihood.Visible = True + cboMethodofMoments.Visible = False + chkProbabilityPlot.Checked = False + + ucrBase.clsRsyntax.SetFunction("gamma") + ucrBase.clsRsyntax.iCallType = 1 + autoTranslate(Me) + ucrReceiverColumn.Selector = ucrAddRemove + ucrReceiverColumn.SetMeAsReceiver() + End Sub + + Private Sub chkRestrictValues_CheckedChanged(sender As Object, e As EventArgs) Handles chkRestrictValues.CheckedChanged + If chkRestrictValues.Checked = True Then + lblBetween.Visible = True + txtBetween.Visible = True + lblAnd.Visible = True + txtAnd.Visible = True + Else + lblBetween.Visible = False + txtBetween.Visible = False + lblAnd.Visible = False + txtAnd.Visible = False + End If + End Sub + + Private Sub chkMaximumLikelihood_CheckedChanged(sender As Object, e As EventArgs) Handles chkMaximumLikelihood.CheckedChanged + If chkMaximumLikelihood.Checked = True Then + cboMaximumLikelihood.Visible = True + Else + cboMaximumLikelihood.Visible = False + End If + End Sub + + Private Sub chkMethodofMoments_CheckedChanged(sender As Object, e As EventArgs) Handles chkMethodofMoments.CheckedChanged + If chkMethodofMoments.Checked = True Then + cboMethodofMoments.Visible = True + Else + cboMethodofMoments.Visible = False + End If + End Sub + + Private Sub ucrReceiverColumn_leave(sender As Object, e As EventArgs) Handles ucrReceiverColumn.Leave + ucrBase.clsRsyntax.AddParameter("x", ucrReceiverColumn.GetVariables()) + End Sub + + Private Sub ucrReceiverColumn_Load(sender As Object, e As EventArgs) + + End Sub + + 'Private Sub chkProbabilityPlot_CheckedChanged(sender As Object, e As EventArgs) Handles chkProbabilityPlot.CheckedChanged + ' If chkProbabilityPlot.Checked = True Then + ' ucrBase.clsRsyntax.SetFunction("plot(gamma)") + ' ucrBase.clsRsyntax.iCallType = 0 + ' Else + ' ucrBase.clsRsyntax.SetFunction("gamma") + ' ucrBase.clsRsyntax.iCallType = 1 + ' End If + 'End Sub +End Class \ No newline at end of file diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 4461237bcb3..156213d2397 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -409,4 +409,8 @@ Public Class frmMain Private Sub SummaryToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SummaryToolStripMenuItem1.Click dlgSummaryTables.ShowDialog() End Sub + + Private Sub GammaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GammaToolStripMenuItem.Click + dlgGammaDistr.ShowDialog() + End Sub End Class \ No newline at end of file