[rkward-cvs] SF.net SVN: rkward:[2625] trunk/rkward/tests
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Aug 25 13:41:37 UTC 2009
Revision: 2625
http://rkward.svn.sourceforge.net/rkward/?rev=2625&view=rev
Author: tfry
Date: 2009-08-25 13:41:37 +0000 (Tue, 25 Aug 2009)
Log Message:
-----------
More tests
Modified Paths:
--------------
trunk/rkward/tests/analysis_plugins.R
Added Paths:
-----------
trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkout
trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkcommands.R
trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkout
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,23 @@
+local({
+## Prepare
+## Compute
+result <- var.test (test50z, test50y, alternative = "two.sided", ratio = 1.00000000)
+
+## Print result
+names <- rk.get.description (test50z, test50y)
+
+rk.header (result$method,
+ parameters=list ("Confidence Level", "0.95000000", "Alternative Hypothesis", rk.describe.alternative(result)))
+
+rk.results (list (
+ 'Variables'=names,
+ 'F'=result$statistic["F"],
+ 'Numerator DF'=result$parameter["num df"],
+ 'Denominator DF'=result$parameter["denom df"],
+ 'p-value'=result$p.value,
+ 'Lower CI'=result$conf.int[1],
+ 'Upper CI'=result$conf.int[2],
+ 'ratio of variances'=result$estimate))
+})
+.rk.rerun.plugin.link(plugin="rkward::F_test", settings="alternative.string=two.sided\nconflevel.real=0.95000000\nratio.real=1.00000000\nx.available=test50z\ny.available=test50y", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.F_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,11 @@
+<h1>F test to compare two variances</h1>
+<h2>Parameters</h2>
+<ul><li>Confidence Level: 0.95000000</li>
+<li>Alternative Hypothesis: true ratio of variances is not equal to 1</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variables</td><td>F</td><td>Numerator DF</td><td>Denominator DF</td><td>p-value</td><td>Lower CI</td><td>Upper CI</td><td>ratio of variances</td></tr>
+<tr><td>test50z
+<br/>test50y</td><td>16</td><td>49</td><td>49</td><td>0</td><td>9.0796</td><td>28.195</td><td>16</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,17 @@
+local({
+## Prepare
+## Compute
+result <- bartlett.test (list (warpbreaks[["breaks"]], test50z, test50y, test50x, test10z, test10y, test10x))
+## Print result
+names <- rk.get.description (warpbreaks[["breaks"]], test50z, test50y, test50x, test10z, test10y, test10x)
+
+rk.header (result$method)
+
+rk.results (list (
+ 'Variables'=names,
+ 'Bartlett s K-squared'=result$statistic,
+ 'df'=result$parameter,
+ 'p-value'=result$p.value))
+})
+.rk.rerun.plugin.link(plugin="rkward::bartlett_test", settings="x.available=warpbreaks[[\\\"breaks\\\"]]\\ntest50z\\ntest50y\\ntest50x\\ntest10z\\ntest10y\\ntest10x", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.bartlett_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,12 @@
+<h1>Bartlett test of homogeneity of variances</h1>
+DATE<br>
+<table border="1">
+<tr><td>Variables</td><td>Bartlett s K-squared</td><td>df</td><td>p-value</td></tr>
+<tr><td>breaks
+<br/>test50z
+<br/>test50y
+<br/>test50x
+<br/>test10z
+<br/>test10y
+<br/>test10x</td><td>249.64</td><td>6</td><td>4.9026e-51</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,68 @@
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (rock[["shape"]]), substitute (rock[["perm"]]), substitute (rock[["peri"]]), substitute (rock[["area"]]))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- eval (vars[[i]], envir=globalenv ())
+
+ results[i, 'Length'] <- length (var)
+ results[i, 'NAs'] <- sum (is.na(var))
+
+ var <- na.omit (var) # omit NAs for all further calculations
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- chisq.out.test (var, opposite = FALSE)
+ results[i, 'X-squared'] <- t$statistic
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ results[i, 'Variance'] <- var (var)
+ results[i, 'Mean'] <- mean (var)
+ results[i, 'Standard Deviation'] <- sd (var)
+ results[i, 'Median'] <- median (var)
+ results[i, 'Minimum'] <- min (var)
+ results[i, 'Maximum'] <- max (var)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Chi-squared test for outlier",
+ parameters=list ("Opposite", "FALSE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::chisq_out_test", settings="descriptives.state=1\nlength.state=1\nopposite.state=FALSE\nx.available=rock[[\\\"shape\\\"]]\\nrock[[\\\"perm\\\"]]\\nrock[[\\\"peri\\\"]]\\nrock[[\\\"area\\\"]]", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (rock[["shape"]]), substitute (rock[["perm"]]), substitute (rock[["peri"]]), substitute (rock[["area"]]))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- na.omit (eval (vars[[i]], envir=globalenv ()))
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- chisq.out.test (var, opposite = TRUE)
+ results[i, 'X-squared'] <- t$statistic
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ results[i, 'Variance'] <- var (var)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Chi-squared test for outlier",
+ parameters=list ("Opposite", "TRUE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::chisq_out_test", settings="descriptives.state=0\nlength.state=0\nopposite.state=TRUE\nx.available=rock[[\\\"shape\\\"]]\\nrock[[\\\"perm\\\"]]\\nrock[[\\\"peri\\\"]]\\nrock[[\\\"area\\\"]]", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.chisq_out_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,24 @@
+<h1>Chi-squared test for outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Opposite: FALSE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Length</td><td>NAs</td><td>X-squared</td><td>p-value</td><td>Alternative Hypothesis</td><td>Variance</td><td>Mean</td><td>Standard Deviation</td><td>Median</td><td>Minimum</td><td>Maximum</td></tr>
+<tr><td>shape</td><td>48</td><td>0</td><td>8.6813</td><td>0.0032149</td><td>highest value 0.464125 is an outlier</td><td>0.0069717</td><td>0.21811</td><td>0.083496</td><td>0.19886</td><td>0.09033</td><td>0.46413</td></tr>
+<tr><td>perm</td><td>48</td><td>0</td><td>4.0819</td><td>0.043346</td><td>highest value 1300 is an outlier</td><td>191685</td><td>415.45</td><td>437.82</td><td>130.5</td><td>6.3</td><td>1300</td></tr>
+<tr><td>peri</td><td>48</td><td>0</td><td>2.7487</td><td>0.097335</td><td>lowest value 308.642 is an outlier</td><td>2049654</td><td>2682.2</td><td>1431.7</td><td>2536.2</td><td>308.64</td><td>4864.2</td></tr>
+<tr><td>area</td><td>48</td><td>0</td><td>5.2881</td><td>0.021472</td><td>lowest value 1016 is an outlier</td><td>7203045</td><td>7187.7</td><td>2683.8</td><td>7487</td><td>1016</td><td>12212</td></tr>
+</table>
+<h1>Chi-squared test for outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Opposite: TRUE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>X-squared</td><td>p-value</td><td>Alternative Hypothesis</td><td>Variance</td></tr>
+<tr><td>shape</td><td>2.3420</td><td>0.12592</td><td>lowest value 0.0903296 is an outlier</td><td>0.0069717</td></tr>
+<tr><td>perm</td><td>0.87333</td><td>0.35004</td><td>lowest value 6.3 is an outlier</td><td>191685</td></tr>
+<tr><td>peri</td><td>2.3229</td><td>0.12748</td><td>highest value 4864.22 is an outlier</td><td>2049654</td></tr>
+<tr><td>area</td><td>3.5045</td><td>0.061201</td><td>highest value 12212 is an outlier</td><td>7203045</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,66 @@
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (women[["weight"]]), substitute (women[["height"]]))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- eval (vars[[i]], envir=globalenv ())
+
+ results[i, 'Length'] <- length (var)
+ results[i, 'NAs'] <- sum (is.na(var))
+
+ var <- na.omit (var) # omit NAs for all further calculations
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- dixon.test (var, type = 0, opposite = FALSE, two.sided = TRUE)
+ results[i, 'Dixon Q-statistic'] <- t$statistic["Q"]
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ results[i, 'Mean'] <- mean (var)
+ results[i, 'Standard Deviation'] <- sd (var)
+ results[i, 'Median'] <- median (var)
+ results[i, 'Minimum'] <- min (var)
+ results[i, 'Maximum'] <- max (var)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Dixon test for outlier",
+ parameters=list ("Type", "0", "Opposite", "FALSE", "two-sided", "TRUE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::dixon_test", settings="descriptives.state=1\nlength.state=1\nopposite.state=FALSE\ntwo_sided.state=TRUE\ntype.string=0\nx.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (women[["weight"]]), substitute (women[["height"]]))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- na.omit (eval (vars[[i]], envir=globalenv ()))
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- dixon.test (var, type = 0, opposite = TRUE, two.sided = FALSE)
+ results[i, 'Dixon Q-statistic'] <- t$statistic["Q"]
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Dixon test for outlier",
+ parameters=list ("Type", "0", "Opposite", "TRUE", "two-sided", "FALSE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::dixon_test", settings="descriptives.state=0\nlength.state=0\nopposite.state=TRUE\ntwo_sided.state=FALSE\ntype.string=0\nx.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.dixon_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,24 @@
+<h1>Dixon test for outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Type: 0</li>
+<li>Opposite: FALSE</li>
+<li>two-sided: TRUE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Length</td><td>NAs</td><td>Dixon Q-statistic</td><td>p-value</td><td>Alternative Hypothesis</td><td>Mean</td><td>Standard Deviation</td><td>Median</td><td>Minimum</td><td>Maximum</td></tr>
+<tr><td>weight</td><td>15</td><td>0</td><td>0.22727</td><td>0.76454</td><td>highest value 164 is an outlier</td><td>136.73</td><td>15.499</td><td>135</td><td>115</td><td>164</td></tr>
+<tr><td>height</td><td>15</td><td>0</td><td>0.16667</td><td>0.4514</td><td>highest value 72 is an outlier</td><td>65</td><td>4.4721</td><td>65</td><td>58</td><td>72</td></tr>
+</table>
+<h1>Dixon test for outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Type: 0</li>
+<li>Opposite: TRUE</li>
+<li>two-sided: FALSE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Dixon Q-statistic</td><td>p-value</td><td>Alternative Hypothesis</td></tr>
+<tr><td>weight</td><td>0.12821</td><td>0.86257</td><td>lowest value 115 is an outlier</td></tr>
+<tr><td>height</td><td>0.16667</td><td>0.7743</td><td>lowest value 58 is an outlier</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,17 @@
+local({
+## Prepare
+## Compute
+result <- fligner.test (list (women[["weight"]], women[["height"]], test50z, test50y, test50x, test10z, test10y, test10x))
+## Print result
+names <- rk.get.description (women[["weight"]], women[["height"]], test50z, test50y, test50x, test10z, test10y, test10x)
+
+rk.header (result$method)
+
+rk.results (list (
+ 'Variables'=names,
+ 'Fligner-Killeen:med X^2 test statistic'=result$statistic,
+ 'df'=result$parameter,
+ 'p-value'=result$p.value))
+})
+.rk.rerun.plugin.link(plugin="rkward::fligner_test", settings="x.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]\\ntest50z\\ntest50y\\ntest50x\\ntest10z\\ntest10y\\ntest10x", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.fligner_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,13 @@
+<h1>Fligner-Killeen test of homogeneity of variances</h1>
+DATE<br>
+<table border="1">
+<tr><td>Variables</td><td>Fligner-Killeen:med X^2 test statistic</td><td>df</td><td>p-value</td></tr>
+<tr><td>weight
+<br/>height
+<br/>test50z
+<br/>test50y
+<br/>test50x
+<br/>test10z
+<br/>test10y
+<br/>test10x</td><td>112.87</td><td>7</td><td>2.3321e-21</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,73 @@
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test10z))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- eval (vars[[i]], envir=globalenv ())
+
+ results[i, 'Length'] <- length (var)
+ results[i, 'NAs'] <- sum (is.na(var))
+
+ var <- na.omit (var) # omit NAs for all further calculations
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- grubbs.test (var, type = 10, opposite = FALSE, two.sided = TRUE)
+ results[i, 'G'] <- t$statistic["G"]
+ results[i, 'U'] <- t$statistic["U"]
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Grubbs tests for one or two outliers in data sample",
+ parameters=list ("Type", "10", "Opposite", "FALSE", "two-sided", "TRUE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::grubbs_test", settings="descriptives.state=0\nlength.state=1\nopposite.state=FALSE\ntwo_sided.state=TRUE\ntype.string=10\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest10z", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test10z))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- eval (vars[[i]], envir=globalenv ())
+
+ results[i, 'Length'] <- length (var)
+ results[i, 'NAs'] <- sum (is.na(var))
+
+ var <- na.omit (var) # omit NAs for all further calculations
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- grubbs.test (var, type = 11, opposite = TRUE, two.sided = FALSE)
+ results[i, 'G'] <- t$statistic["G"]
+ results[i, 'U'] <- t$statistic["U"]
+ results[i, 'p-value'] <- t$p.value
+ results[i, 'Alternative Hypothesis']<- rk.describe.alternative (t)
+ results[i, 'Mean'] <- mean (var)
+ results[i, 'Standard Deviation'] <- sd (var)
+ results[i, 'Median'] <- median (var)
+ results[i, 'Minimum'] <- min (var)
+ results[i, 'Maximum'] <- max (var)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Grubbs tests for one or two outliers in data sample",
+ parameters=list ("Type", "11", "Opposite", "TRUE", "two-sided", "FALSE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::grubbs_test", settings="descriptives.state=1\nlength.state=1\nopposite.state=TRUE\ntwo_sided.state=FALSE\ntype.string=11\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest10z", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.grubbs_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,24 @@
+<h1>Grubbs tests for one or two outliers in data sample</h1>
+<h2>Parameters</h2>
+<ul><li>Type: 10</li>
+<li>Opposite: FALSE</li>
+<li>two-sided: TRUE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Length</td><td>NAs</td><td>G</td><td>U</td><td>p-value</td><td>Alternative Hypothesis</td></tr>
+<tr><td>breaks</td><td>54</td><td>0</td><td>3.1709</td><td>0.80671</td><td>0.047523</td><td>highest value 70 is an outlier</td></tr>
+<tr><td>test10z</td><td>11</td><td>1</td><td>1.4863</td><td>0.72727</td><td>0.78497</td><td>highest value 40 is an outlier</td></tr>
+</table>
+<h1>Grubbs tests for one or two outliers in data sample</h1>
+<h2>Parameters</h2>
+<ul><li>Type: 11</li>
+<li>Opposite: TRUE</li>
+<li>two-sided: FALSE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Length</td><td>NAs</td><td>G</td><td>U</td><td>p-value</td><td>Alternative Hypothesis</td><td>Mean</td><td>Standard Deviation</td><td>Median</td><td>Minimum</td><td>Maximum</td></tr>
+<tr><td>breaks</td><td>54</td><td>0</td><td>4.5459</td><td>0.77345</td><td>1</td><td>10 and 70 are outliers</td><td>28.148</td><td>13.199</td><td>26</td><td>10</td><td>70</td></tr>
+<tr><td>test10z</td><td>11</td><td>1</td><td>2.9726</td><td>0.50909</td><td>1</td><td>4 and 40 are outliers</td><td>22</td><td>12.111</td><td>22</td><td>4</td><td>40</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,14 @@
+local({
+## Prepare
+require(car)
+## Compute
+result <- levene.test (warpbreaks[["breaks"]], warpbreaks[["tension"]])
+## Print result
+names <- rk.get.description (warpbreaks[["breaks"]], warpbreaks[["tension"]])
+
+rk.header ("Levene's Test", list ("response variable", names[1], "groups", names[2]))
+
+rk.print (result)
+})
+.rk.rerun.plugin.link(plugin="rkward::levene_test", settings="group.available=warpbreaks[[\\\"tension\\\"]]\ny.available=warpbreaks[[\\\"breaks\\\"]]", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.levene_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,23 @@
+<h1>Levene's Test</h1>
+<h2>Parameters</h2>
+<ul><li>response variable: breaks</li>
+<li>groups: tension</li>
+</ul>
+DATE<br>
+
+<p class='character'><p><b> Levene's Test for Homogeneity of Variance </b></p></p>
+
+<p align= center >
+<table cellspacing=0 border=1><caption align=bottom class=captiondataframe></caption><tr><td>
+ <table border=0 class=dataframe>
+ <tbody> <tr class= firstline > <th></th><th>Df</th><th>F value</th><th>Pr(>F)</th><th></th> </tr>
+ <tr><td class=firstcolumn>group</td><td class=cellinside> 2 </td><td class=cellinside>2.82 </td><td class=cellinside>0.069</td><td class=cellinside>. </td></tr>
+ <tr><td class=firstcolumn> </td><td class=cellinside>51 </td><td class=cellinside> </td><td class=cellinside> </td><td class=cellinside> </td></tr>
+
+ </tbody>
+</table>
+ </td></table>
+ <br>
+<p class='character'>
+<p>--- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</p>
+</p>
\ No newline at end of file
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,17 @@
+local({
+## Prepare
+## Compute
+result <- mood.test (test50z, test50x, alternative = "two.sided")
+## Print result
+names <- rk.get.description (test50z, test50x)
+
+rk.header (result$method,
+ parameters=list ("Alternative Hypothesis", rk.describe.alternative (result)))
+
+rk.results (list (
+ 'Variables'=names,
+ 'Z'=result$statistic,
+ 'p-value'=result$p.value))
+})
+.rk.rerun.plugin.link(plugin="rkward::mood_test", settings="alternative.string=two.sided\nx.available=test50z\ny.available=test50x", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.mood_test.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,10 @@
+<h1>Mood two-sample test of scale</h1>
+<h2>Parameters</h2>
+<ul><li>Alternative Hypothesis: two.sided</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variables</td><td>Z</td><td>p-value</td></tr>
+<tr><td>test50z
+<br/>test50x</td><td>6.3217</td><td>2.5873e-10</td></tr>
+</table>
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkcommands.R (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkcommands.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,62 @@
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test50z))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- eval (vars[[i]], envir=globalenv ())
+
+ results[i, 'Length'] <- length (var)
+ results[i, 'NAs'] <- sum (is.na(var))
+
+ var <- na.omit (var) # omit NAs for all further calculations
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- outlier (var, opposite = FALSE)
+ results[i, 'Outlier'] <- t
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Find potential outlier",
+ parameters=list ("Opposite", "FALSE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::outlier", settings="descriptives.state=0\nlength.state=1\nopposite.state=FALSE\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest50z", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+require(outliers)
+## Compute
+
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test50z))
+results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
+for (i in 1:length(vars)) {
+ results[i, 'Variable Name'] <- rk.get.description (vars[[i]], is.substitute=TRUE)
+ var <- na.omit (eval (vars[[i]], envir=globalenv ()))
+
+ results[i, 'Error'] <- tryCatch ({
+ # This is the core of the calculation
+ t <- outlier (var, opposite = TRUE)
+ results[i, 'Outlier'] <- t
+ results[i, 'Mean'] <- mean (var)
+ results[i, 'Standard Deviation'] <- sd (var)
+ results[i, 'Median'] <- median (var)
+ results[i, 'Minimum'] <- min (var)
+ results[i, 'Maximum'] <- max (var)
+ NA # no error
+ }, error=function (e) e$message) # catch any errors
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Find potential outlier",
+ parameters=list ("Opposite", "TRUE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::outlier", settings="descriptives.state=1\nlength.state=0\nopposite.state=TRUE\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest50z", label="Run again")
+.rk.make.hr()
Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkout (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.outlier.rkout 2009-08-25 13:41:37 UTC (rev 2625)
@@ -0,0 +1,20 @@
+<h1>Find potential outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Opposite: FALSE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Length</td><td>NAs</td><td>Outlier</td></tr>
+<tr><td>breaks</td><td>54</td><td>0</td><td>70</td></tr>
+<tr><td>test50z</td><td>50</td><td>0</td><td>200</td></tr>
+</table>
+<h1>Find potential outlier</h1>
+<h2>Parameters</h2>
+<ul><li>Opposite: TRUE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Outlier</td><td>Mean</td><td>Standard Deviation</td><td>Median</td><td>Minimum</td><td>Maximum</td></tr>
+<tr><td>breaks</td><td>10</td><td>28.148</td><td>13.199</td><td>26</td><td>10</td><td>70</td></tr>
+<tr><td>test50z</td><td>4</td><td>102</td><td>58.31</td><td>102</td><td>4</td><td>200</td></tr>
+</table>
Modified: trunk/rkward/tests/analysis_plugins.R
===================================================================
--- trunk/rkward/tests/analysis_plugins.R 2009-08-24 11:01:26 UTC (rev 2624)
+++ trunk/rkward/tests/analysis_plugins.R 2009-08-25 13:41:37 UTC (rev 2625)
@@ -58,16 +58,6 @@
rk.call.plugin ("rkward::wilcoxon_exact_test", alternative.string="less", confint.state="FALSE", correct.state="TRUE", exact.string="automatic", mu.real="0.00000000", paired.state="TRUE", x.available="test50x", y.available="test50y", submit.mode="submit")
}, libraries=c ("exactRankTests")),
- new ("RKTest", id="ansari_bradley_test", call=function () {
- rk.call.plugin ("rkward::ansari_bradley_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95000000", exact.string="yes", x.available="test50x", y.available="test10y", submit.mode="submit")
-
- rk.call.plugin ("rkward::ansari_bradley_test", alternative.string="less", confint.state="FALSE", exact.string="automatic", x.available="test50x", y.available="test50y", submit.mode="submit")
- }),
- new ("RKTest", id="ansari_bradley_exact_test", call=function () {
- rk.call.plugin ("rkward::ansari_bradley_exact_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95000000", exact.string="yes", x.available="test50x", y.available="test10y", submit.mode="submit")
-
- rk.call.plugin ("rkward::ansari_bradley_exact_test", alternative.string="less", confint.state="FALSE", exact.string="automatic", x.available="test50x", y.available="test50y", submit.mode="submit")
- }, libraries=c ("exactRankTests")),
new ("RKTest", id="moments_moment", call=function () {
rk.call.plugin ("rkward::moment", absolute.state="FALSE", central.state="FALSE", length.state="0", narm.state="TRUE", order.real="1.000000", x.available="test50z\ntest50y\ntest50x\ntest10z\ntest10y\ntest10x", submit.mode="submit")
}, libraries=c ("moments")),
@@ -82,7 +72,52 @@
}, libraries=c ("moments")),
new ("RKTest", id="skewness_kurtosis", call=function () {
rk.call.plugin ("rkward::skewness_kurtosis", geary.state="1", kurtosis.state="1", length.state="1", narm.state="1", skewness.state="1", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]\nwarpbreaks[[\"breaks\"]]", submit.mode="submit")
- }, libraries=c ("moments"))
+ }, libraries=c ("moments")),
+ new ("RKTest", id="F_test", call=function () {
+ rk.call.plugin ("rkward::F_test", alternative.string="two.sided", conflevel.real="0.95000000", ratio.real="1.00000000", x.available="test50z", y.available="test50y", submit.mode="submit")
+ }),
+ new ("RKTest", id="fligner_test", call=function () {
+ rk.call.plugin ("rkward::fligner_test", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]\ntest50z\ntest50y\ntest50x\ntest10z\ntest10y\ntest10x", submit.mode="submit")
+ }),
+ new ("RKTest", id="bartlett_test", call=function () {
+ rk.call.plugin ("rkward::bartlett_test", x.available="warpbreaks[[\"breaks\"]]\ntest50z\ntest50y\ntest50x\ntest10z\ntest10y\ntest10x", submit.mode="submit")
+ }),
+ new ("RKTest", id="levene_test", call=function () {
+ rk.call.plugin ("rkward::levene_test", group.available="warpbreaks[[\"tension\"]]", y.available="warpbreaks[[\"breaks\"]]", submit.mode="submit")
+ }, libraries = c ("car")),
+ new ("RKTest", id="ansari_bradley_test", call=function () {
+ rk.call.plugin ("rkward::ansari_bradley_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95000000", exact.string="yes", x.available="test50x", y.available="test10y", submit.mode="submit")
+
+ rk.call.plugin ("rkward::ansari_bradley_test", alternative.string="less", confint.state="FALSE", exact.string="automatic", x.available="test50x", y.available="test50y", submit.mode="submit")
+ }),
+ new ("RKTest", id="ansari_bradley_exact_test", call=function () {
+ rk.call.plugin ("rkward::ansari_bradley_exact_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95000000", exact.string="yes", x.available="test50x", y.available="test10y", submit.mode="submit")
+
+ rk.call.plugin ("rkward::ansari_bradley_exact_test", alternative.string="less", confint.state="FALSE", exact.string="automatic", x.available="test50x", y.available="test50y", submit.mode="submit")
+ }, libraries=c ("exactRankTests")),
+ new ("RKTest", id="mood_test", call=function () {
+ rk.call.plugin ("rkward::mood_test", alternative.string="two.sided", x.available="test50z", y.available="test50x", submit.mode="submit")
+ }),
+ new ("RKTest", id="chisq_out_test", call=function () {
+ rk.call.plugin ("rkward::chisq_out_test", descriptives.state="1", length.state="1", opposite.state="FALSE", x.available="rock[[\"shape\"]]\nrock[[\"perm\"]]\nrock[[\"peri\"]]\nrock[[\"area\"]]", submit.mode="submit")
+
+ rk.call.plugin ("rkward::chisq_out_test", descriptives.state="0", length.state="0", opposite.state="TRUE", x.available="rock[[\"shape\"]]\nrock[[\"perm\"]]\nrock[[\"peri\"]]\nrock[[\"area\"]]", submit.mode="submit")
+ }, libraries = c ("outliers")),
+ new ("RKTest", id="dixon_test", call=function () {
+ rk.call.plugin ("rkward::dixon_test", descriptives.state="1", length.state="1", opposite.state="FALSE", two_sided.state="TRUE", type.string="0", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]", submit.mode="submit")
+
+ rk.call.plugin ("rkward::dixon_test", descriptives.state="0", length.state="0", opposite.state="TRUE", two_sided.state="FALSE", type.string="0", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]", submit.mode="submit")
+ }, libraries = c ("outliers")),
+ new ("RKTest", id="outlier", call=function () {
+ rk.call.plugin ("rkward::outlier", descriptives.state="0", length.state="1", opposite.state="FALSE", x.available="warpbreaks[[\"breaks\"]]\ntest50z", submit.mode="submit")
+
+ rk.call.plugin ("rkward::outlier", descriptives.state="1", length.state="0", opposite.state="TRUE", x.available="warpbreaks[[\"breaks\"]]\ntest50z", submit.mode="submit")
+ }, libraries = c ("outliers")),
+ new ("RKTest", id="grubbs_test", call=function () {
+ rk.call.plugin ("rkward::grubbs_test", descriptives.state="0", length.state="1", opposite.state="FALSE", two_sided.state="TRUE", type.string="10", x.available="warpbreaks[[\"breaks\"]]\ntest10z", submit.mode="submit")
+
+ rk.call.plugin ("rkward::grubbs_test", descriptives.state="1", length.state="1", opposite.state="TRUE", two_sided.state="FALSE", type.string="11", x.available="warpbreaks[[\"breaks\"]]\ntest10z", submit.mode="submit")
+ }, libraries = c ("outliers"))
), postCalls = list ( # like initCalls: run after all tests to clean up.
function () {
suppressWarnings (rm (list=c ("women", "warpbreaks", "rock", "test50x", "test50y", "test50z", "test10x", "test10y", "test10z"), envir=globalenv()))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list