Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #153

Merged
merged 33 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6c9a15c
Merge pull request #52 from lilyclements/two_variable_repo
derekagorhom Nov 10, 2023
fcb01b1
Set the focus to return to the first receiver always when re-opening …
N-thony Nov 11, 2023
b999d3e
code improvement and fixed tab orders in dlgDescribeTwoVariables
N-thony Nov 15, 2023
2b2cf21
Merge pull request #463 from africanmathsinitiative/master
conlooptechnologies Nov 16, 2023
07b7d18
Merge pull request #465 from africanmathsinitiative/master
conlooptechnologies Nov 17, 2023
395b21b
Tidying up the Four variable model
derekagorhom Nov 20, 2023
14ffb31
null checking in sdgplots
conlooptechnologies Nov 23, 2023
12d23ff
more null checks
conlooptechnologies Nov 23, 2023
828115c
Added AOV and tidy 4-variable modelling
derekagorhom Nov 24, 2023
6d46606
Code changes
derekagorhom Nov 27, 2023
16fc892
Added AOV function into Two and Three Variable Modelling
derekagorhom Nov 28, 2023
83cfc02
Added the AOV function to the General model and fit mode dialogues
derekagorhom Nov 28, 2023
bcb05d2
Fixed odd bug in the fit Model
derekagorhom Nov 29, 2023
5481a0a
Code changes
derekagorhom Dec 4, 2023
66ec183
minor code adjustement
N-thony Dec 6, 2023
c8f7a2d
minor Change
MeSophie Dec 6, 2023
13b8b5f
minor change
MeSophie Dec 6, 2023
003c3a0
minor change
MeSophie Dec 6, 2023
72d5f5b
minor change
MeSophie Dec 6, 2023
0a49f9d
Added an empty dialog
MeSophie Dec 6, 2023
9f7a553
Merge pull request #8679 from MeSophie/NewItemsIssue8676
N-thony Dec 6, 2023
4506227
Merge pull request #8661 from Patowhiz/PlotNullBug
N-thony Dec 7, 2023
0f75416
Merge pull request #8665 from derekagorhom/four_variable_Modelling
N-thony Dec 7, 2023
4c05087
added a check to avoid crashing
N-thony Dec 7, 2023
d2883e0
Merge pull request #102 from africanmathsinitiative/master
N-thony Dec 7, 2023
c2a80c9
Added back version number
N-thony Dec 7, 2023
1ab6816
Merge pull request #8680 from N-thony/version_number
conlooptechnologies Dec 7, 2023
5439433
Merge pull request #8649 from N-thony/returnFocus
conlooptechnologies Dec 7, 2023
ede4f38
Merge pull request #196 from africanmathsinitiative/master
Vitalis95 Dec 11, 2023
5fc6723
Changes to the code
Vitalis95 Dec 11, 2023
cf2dcea
changes to dialog
Vitalis95 Dec 11, 2023
0e74a35
changes to the code
Vitalis95 Dec 11, 2023
1fa3bf8
Merge pull request #8682 from Vitalis95/IDFcurvedlg
N-thony Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion instat/clsDistribution.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions instat/clsRegressionDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
331 changes: 179 additions & 152 deletions instat/dlgDescribeTwoVariable.Designer.vb

Large diffs are not rendered by default.

95 changes: 56 additions & 39 deletions instat/dlgFitModel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -108,6 +108,7 @@ Public Class dlgFitModel
clsHatvaluesFunction = New RFunction
clsResidualFunction = New RFunction
clsFittedValuesFunction = New RFunction
clsAOVFunction = New RFunction

ucrSelectorByDataFrameAddRemoveForFitModel.Reset()
ucrModelName.Reset()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -318,21 +329,25 @@ 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)
ucrReceiverExpressionFitModel.SetRCode(clsFormulaOperator, bReset)
ucrSelectorByDataFrameAddRemoveForFitModel.SetRCode(clsLM, bReset)
ucrModelName.SetRCode(clsLM, bReset)
ucrFamily.SetRCode(clsFamilyFunction, bReset)

bRCodeSet = True
ResponseConvert()
End Sub
Expand Down Expand Up @@ -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("")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -534,7 +551,7 @@ Public Class dlgFitModel

Private Sub ucrReceiverExpressionFitModel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlValueChanged
ChooseRFunction()
ResponseConvert()
'ResponseConvert()
ChooseAnovaFunction()
End Sub

Expand All @@ -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
Expand Down
14 changes: 1 addition & 13 deletions instat/dlgFourVariableModelling.Designer.vb

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

Loading
Loading