From 02cb21fa444e91e530aa0cc1628f398c4be99a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 8 Sep 2016 22:05:08 +0800 Subject: [PATCH] Removed old test subroutines. --- 1CorRel.vb | 26 -------------------------- 2PTTest.vb | 26 -------------------------- 3ITTest.vb | 29 ----------------------------- 4ANOVA.vb | 29 ----------------------------- 5Chi2GoF.vb | 26 -------------------------- 9Utils.vb | 17 ----------------- 6 files changed, 153 deletions(-) diff --git a/1CorRel.vb b/1CorRel.vb index f845799..6138e9f 100644 --- a/1CorRel.vb +++ b/1CorRel.vb @@ -61,32 +61,6 @@ Sub subRunCorrelation As Object ThisComponent.getCurrentController.setActiveSheet (oSheet) End Sub -' subTestCorrelation: Tests the Pearson’s 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 Pearson’s correlation coefficient Sub subReportCorrelation (oDoc As Object, oDataXRange As Object, oDataYRange As Object) Dim oSheets As Object, sSheetName As String diff --git a/2PTTest.vb b/2PTTest.vb index fd58f44..b1a0ac4 100644 --- a/2PTTest.vb +++ b/2PTTest.vb @@ -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 diff --git a/3ITTest.vb b/3ITTest.vb index ff2f446..b51a726 100644 --- a/3ITTest.vb +++ b/3ITTest.vb @@ -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 diff --git a/4ANOVA.vb b/4ANOVA.vb index 7ac92c3..7c3b744 100644 --- a/4ANOVA.vb +++ b/4ANOVA.vb @@ -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 diff --git a/5Chi2GoF.vb b/5Chi2GoF.vb index 2ed4418..9004a6f 100644 --- a/5Chi2GoF.vb +++ b/5Chi2GoF.vb @@ -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 diff --git a/9Utils.vb b/9Utils.vb index 7680add..b9b466c 100644 --- a/9Utils.vb +++ b/9Utils.vb @@ -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