Skip to content

Commit

Permalink
Merge pull request #43 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from master copy
  • Loading branch information
lilyclements authored Oct 25, 2016
2 parents b652df3 + a2ce1be commit 34cfabe
Show file tree
Hide file tree
Showing 8 changed files with 896 additions and 338 deletions.
50 changes: 25 additions & 25 deletions instat/dlgCorrelation.designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions instat/dlgCorrelation.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ Public Class dlgCorrelation
End Sub

Private Sub InitialiseDialog()
ucrReceiverFirstColumn.Selector = ucrSelectorDataFrameVarAddRemove
ucrReceiverSecondColumn.Selector = ucrSelectorDataFrameVarAddRemove
ucrReceiverMultipleColumns.Selector = ucrSelectorDataFrameVarAddRemove
ucrReceiverFirstColumn.Selector = ucrSelectorCorrelation
ucrReceiverSecondColumn.Selector = ucrSelectorCorrelation
ucrReceiverMultipleColumns.Selector = ucrSelectorCorrelation
ucrReceiverFirstColumn.SetDataType("numeric")
ucrReceiverSecondColumn.SetDataType("numeric")
ucrSelectorDataFrameVarAddRemove.Reset()
ucrSelectorDataFrameVarAddRemove.Focus()
ucrSelectorCorrelation.Reset()
ucrSelectorCorrelation.Focus()
ucrReceiverMultipleColumns.SetSingleTypeStatus(True)
ucrReceiverMultipleColumns.SetDataType("numeric")
nudConfidenceInterval.Minimum = 0
nudConfidenceInterval.Maximum = 1
nudConfidenceInterval.Increment = 0.05
ucrBase.iHelpTopicID = 186
End Sub

Expand All @@ -49,8 +52,12 @@ Public Class dlgCorrelation

Private Sub SetDefaults()
rdoPearson.Checked = True
rdoCompleteRowsOnly.Checked = True
rdoMultipleColumns.Checked = True
ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False
nudConfidenceInterval.Value = 0.95
sdgCorrPlot.SetDefaults()
ucrSelectorCorrelation.Reset()
ucrReceiverMultipleColumns.SetMeAsReceiver()
TestOKEnabled()
End Sub
Expand Down
20 changes: 10 additions & 10 deletions instat/dlgPrincipalComponentAnalysis.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 39 additions & 13 deletions instat/dlgPrincipalComponentAnalysis.vb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ Public Class dlgPrincipalComponentAnalysis
ucrBasePCA.clsRsyntax.SetFunction("PCA")
ucrBasePCA.clsRsyntax.iCallType = 0
ucrReceiverMultiplePCA.Selector = ucrSelectorPCA
ucrReceiverMultiplePCA.SetDataType("numeric")
ucrReceiverMultiplePCA.SetDataType("numeric") ' this isn't working
ucrResultName.SetDefaultTypeAsModel()

ucrResultName.SetItemsTypeAsModels()
ucrResultName.SetValidationTypeAsRVariable()
ucrBasePCA.clsRsyntax.bExcludeAssignedFunctionOutput = False
ucrBasePCA.iHelpTopicID = 187
End Sub

Expand All @@ -55,16 +57,22 @@ Public Class dlgPrincipalComponentAnalysis
ucrBasePCA.clsRsyntax.AddParameter("graph", "FALSE")
ucrResultName.SetName("PCA")
sdgPrincipalComponentAnalysis.SetDefaults()
ComponentsMinimum()
TestOKEnabled()
End Sub

Private Sub TestOKEnabled()
'If (Not ucrReceiverMultiplePCA.IsEmpty()) And ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count > 1 Then
If (Not ucrReceiverMultiplePCA.IsEmpty()) Then
ucrBasePCA.OKEnabled(True)
AssignName()
Else
ucrBasePCA.OKEnabled(False)
'If Not ucrReceiverMultiplePCA.IsEmpty() AndAlso ((chkSaveResult.Checked AndAlso ucrResultName.GetText() <> "") OrElse Not chkSaveResult.Checked) Then
'ucrBasePCA.OKEnabled(True)
'Else
' ucrBasePCA.OKEnabled(False)
'End If

If (chkSaveResult.Checked AndAlso Not ucrResultName.IsEmpty() OrElse Not chkSaveResult.Checked) AndAlso Not ucrReceiverMultiplePCA.IsEmpty() Then
ucrBasePCA.OKEnabled(True)
Else
ucrBasePCA.OKEnabled(False)
End If
End Sub

Expand All @@ -77,18 +85,19 @@ Public Class dlgPrincipalComponentAnalysis
End Sub

Public Sub ucrReceiverMultiplePCA_SelectionChanged() Handles ucrReceiverMultiplePCA.SelectionChanged
TestOKEnabled()
If ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count > 5 Then
nudComponents.Value = 5
Else
nudComponents.Value = ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count
If ucrReceiverMultiplePCA.IsEmpty Then
AssignName()
End If
ucrBasePCA.clsRsyntax.AddParameter("X", clsRFunctionParameter:=ucrReceiverMultiplePCA.GetVariables())
ucrBasePCA.clsRsyntax.AddParameter("ncp", nudComponents.Value)
sdgPrincipalComponentAnalysis.Dimensions()
TestOKEnabled()
ComponentsMinimum()
End Sub

Private Sub nudComponents_TextChanged(sender As Object, e As EventArgs) Handles nudComponents.TextChanged
ucrBasePCA.clsRsyntax.AddParameter("ncp", nudComponents.Value)
sdgPrincipalComponentAnalysis.Dimensions()
End Sub

Private Sub chkScaleData_CheckedChanged(sender As Object, e As EventArgs) Handles chkScaleData.CheckedChanged
Expand All @@ -103,7 +112,7 @@ Public Class dlgPrincipalComponentAnalysis
sdgPrincipalComponentAnalysis.ShowDialog()
End Sub

Private Sub ucrResultName_NameChanged()
Private Sub ucrResultName_NameChanged() Handles ucrResultName.NameChanged
AssignName()
End Sub

Expand All @@ -127,9 +136,26 @@ Public Class dlgPrincipalComponentAnalysis
ucrBasePCA.clsRsyntax.bExcludeAssignedFunctionOutput = False
strModelName = "last_PCA"
End If
TestOKEnabled()
End Sub

Private Sub ucrBasePCA_clickok(sender As Object, e As EventArgs) Handles ucrBasePCA.ClickOk
sdgPrincipalComponentAnalysis.PCAOptions()
End Sub

Private Sub ComponentsMinimum()
If ucrReceiverMultiplePCA.IsEmpty Then
nudComponents.Minimum = 0
nudComponents.Value = 0
ElseIf ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count = 1 Then
nudComponents.Minimum = 2
ElseIf ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count > 1 Then
nudComponents.Minimum = 2
If ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count > 5 Then
nudComponents.Value = 5
Else
nudComponents.Value = ucrReceiverMultiplePCA.lstSelectedVariables.Items.Count
End If
End If
End Sub
End Class
Loading

0 comments on commit 34cfabe

Please sign in to comment.