Removed old test subroutines.

This commit is contained in:
依瑪貓 2016-09-08 22:05:08 +08:00
parent c81698e63a
commit 02cb21fa44
6 changed files with 0 additions and 153 deletions

View File

@ -61,32 +61,6 @@ Sub subRunCorrelation As Object
ThisComponent.getCurrentController.setActiveSheet (oSheet)
End Sub
' subTestCorrelation: Tests the Pearsons correlation coefficient report
Sub subTestCorrelation
Dim oDoc As Object, oSheets As Object, sSheetName As String
Dim oSheet As Object, oXRange As Object, oYRange As Object
oDoc = fnFindStatsTestDocument
If IsNull (oDoc) Then
MsgBox "Cannot find statstest.ods in the opened documents."
Exit Sub
End If
sSheetName = "correl"
oSheets = oDoc.getSheets
If Not oSheets.hasByName (sSheetName) Then
MsgBox "Data sheet """ & sSheetName & """ not found"
Exit Sub
End If
If oSheets.hasByName (sSheetName & "_correl") Then
oSheets.removeByName (sSheetName & "_correl")
End If
oSheet = oSheets.getByName (sSheetName)
oXRange = oSheet.getCellRangeByName ("B3:B13")
oYRange = oSheet.getCellRangeByName ("C3:C13")
subReportCorrelation (oDoc, oXRange, oYRange)
End Sub
' subReportCorrelation: Reports the Pearsons correlation coefficient
Sub subReportCorrelation (oDoc As Object, oDataXRange As Object, oDataYRange As Object)
Dim oSheets As Object, sSheetName As String

View File

@ -61,32 +61,6 @@ Sub subRunPairedTTest As Object
ThisComponent.getCurrentController.setActiveSheet (oSheet)
End Sub
' subTestPairedTTest: Tests the paired T-test report
Sub subTestPairedTTest
Dim oDoc As Object, oSheets As Object, sSheetName As String
Dim oSheet As Object, oXRange As Object, oYRange As Object
oDoc = fnFindStatsTestDocument
If IsNull (oDoc) Then
MsgBox "Cannot find statstest.ods in the opened documents."
Exit Sub
End If
sSheetName = "pttest"
oSheets = oDoc.getSheets
If Not oSheets.hasByName (sSheetName) Then
MsgBox "Data sheet """ & sSheetName & """ not found"
Exit Sub
End If
If oSheets.hasByName (sSheetName & "_ttest") Then
oSheets.removeByName (sSheetName & "_ttest")
End If
oSheet = oSheets.getByName (sSheetName)
oXRange = oSheet.getCellRangeByName ("B3:B15")
oYRange = oSheet.getCellRangeByName ("C3:C15")
subReportPairedTTest (oDoc, oXRange, oYRange)
End Sub
' subReportPairedTTest: Reports the paired T-test
Sub subReportPairedTTest (oDoc As Object, oDataXRange As Object, oDataYRange As Object)
Dim oSheets As Object, sSheetName As String

View File

@ -78,35 +78,6 @@ Sub subRunIndependentTTest As Object
ThisComponent.getCurrentController.setActiveSheet (oSheet)
End Sub
' subTestIndependentTTest: Tests the independent T-test report.
Sub subTestIndependentTTest
Dim oDoc As Object, oSheets As Object, sSheetName As String
Dim oSheet As Object, oLabelColumn As Object, oScoreColumn As Object
oDoc = fnFindStatsTestDocument
If IsNull (oDoc) Then
MsgBox "Cannot find statstest.ods in the opened documents."
Exit Sub
End If
sSheetName = "ittest"
oSheets = oDoc.getSheets
If Not oSheets.hasByName (sSheetName) Then
MsgBox "Data sheet """ & sSheetName & """ not found"
Exit Sub
End If
If oSheets.hasByName (sSheetName & "_ttest") Then
oSheets.removeByName (sSheetName & "_ttest")
End If
If oSheets.hasByName (sSheetName & "_ttesttmp") Then
oSheets.removeByName (sSheetName & "_ttesttmp")
End If
oSheet = oSheets.getByName (sSheetName)
oLabelColumn = oSheet.getCellRangeByName ("A15:A34")
oScoreColumn = oSheet.getCellRangeByName ("B15:B34")
subReportIndependentTTest (oDoc, oLabelColumn, oScoreColumn)
End Sub
' subReportIndependentTTest: Reports the independent T-test
Sub subReportIndependentTTest (oDoc As Object, oLabelColumn As Object, oScoreColumn As Object)
Dim oSheets As Object, sSheetName As String

View File

@ -78,35 +78,6 @@ Sub subRunANOVA As Object
ThisComponent.getCurrentController.setActiveSheet (oSheet)
End Sub
' subTestANOVA: Tests the ANOVA (Analyze of Variances) report
Sub subTestANOVA
Dim oDoc As Object, oSheets As Object, sSheetName As String
Dim oSheet As Object, oLabelColumn As Object, oScoreColumn As Object
oDoc = fnFindStatsTestDocument
If IsNull (oDoc) Then
MsgBox "Cannot find statstest.ods in the opened documents."
Exit Sub
End If
sSheetName = "anova"
oSheets = oDoc.getSheets
If Not oSheets.hasByName (sSheetName) Then
MsgBox "Data sheet """ & sSheetName & """ not found"
Exit Sub
End If
If oSheets.hasByName (sSheetName & "_anova") Then
oSheets.removeByName (sSheetName & "_anova")
End If
If oSheets.hasByName (sSheetName & "_anovatmp") Then
oSheets.removeByName (sSheetName & "_anovatmp")
End If
oSheet = oSheets.getByName (sSheetName)
oLabelColumn = oSheet.getCellRangeByName ("A13:A35")
oScoreColumn = oSheet.getCellRangeByName ("B13:B35")
subReportANOVA (oDoc, oLabelColumn, oScoreColumn)
End Sub
' subReportANOVA: Reports the ANOVA (Analyze of Variances)
Sub subReportANOVA (oDoc As Object, oLabelColumn As Object, oScoreColumn As Object)
Dim oSheets As Object, sSheetName As String

View File

@ -61,32 +61,6 @@ Sub subRunChi2GoodnessOfFit As Object
ThisComponent.getCurrentController.setActiveSheet (oSheet)
End Sub
' subTestChi2GoodnessOfFit: Tests the chi-square goodness of fit report
Sub subTestChi2GoodnessOfFit
Dim oDoc As Object, oSheets As Object, sSheetName As String
Dim oSheet As Object, oColumnColumn As Object, oRowColumn As Object
oDoc = fnFindStatsTestDocument
If IsNull (oDoc) Then
MsgBox "Cannot find statstest.ods in the opened documents."
Exit Sub
End If
sSheetName = "chi2"
oSheets = oDoc.getSheets
If Not oSheets.hasByName (sSheetName) Then
MsgBox "Data sheet """ & sSheetName & """ not found"
Exit Sub
End If
If oSheets.hasByName (sSheetName & "_chi2") Then
oSheets.removeByName (sSheetName & "_chi2")
End If
oSheet = oSheets.getByName (sSheetName)
oColumnColumn = oSheet.getCellRangeByName ("A7:A192")
oRowColumn = oSheet.getCellRangeByName ("B7:B192")
subReportChi2GoodnessOfFit (oDoc, oColumnColumn, oRowColumn)
End Sub
' subReportChi2GoodnessOfFit: Reports the chi-square goodness of fit
Sub subReportChi2GoodnessOfFit (oDoc As Object, oColumnColumn As Object, oRowColumn As Object)
Dim oSheets As Object, sSheetName As String

View File

@ -80,23 +80,6 @@ Function fnGetLocalRangeName (oRange As Object) As String
fnGetLocalRangeName = sName
End Function
' fnFindStatsTestDocument: Finds the statistics test document.
Function fnFindStatsTestDocument As Object
Dim oEnum As Object, oDoc As Object, sFile As String
sFile = "/statstest.ods"
oEnum = StarDesktop.getComponents.createEnumeration
Do While oEnum.hasMoreElements
oDoc = oEnum.nextElement
If oDoc.supportsService ("com.sun.star.document.OfficeDocument") Then
If Right (oDoc.getLocation, Len (sFile)) = sFile Then
fnFindStatsTestDocument = oDoc
Exit Function
End If
End If
Loop
End Function
' fnSpecifyData: Specifies the data
Function fnSpecifyData (oRange As Object, sPrompt1 As String, sPrompt2 As String) As Object
Dim mLabels (oRange.getColumns.getCount - 1) As String