[rkward-cvs] SF.net SVN: rkward:[2624] trunk/rkward/tests

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Aug 24 11:01:26 UTC 2009


Revision: 2624
          http://rkward.svn.sourceforge.net/rkward/?rev=2624&view=rev
Author:   tfry
Date:     2009-08-24 11:01:26 +0000 (Mon, 24 Aug 2009)

Log Message:
-----------
Add the next bunch of tests

Modified Paths:
--------------
    trunk/rkward/tests/analysis_plugins.R

Added Paths:
-----------
    trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkout
    trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkout

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,31 @@
+local({
+## Prepare
+require(moments)
+## Compute
+
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test50z), substitute (test10x))
+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, 'Error'] <- tryCatch ({
+		# This is the core of the calculation
+		t <- agostino.test (var, alternative = "two.sided")
+		results[i, 'skewness estimator (skew)'] <- t$statistic["skew"]
+		results[i, 'transformation (z)'] <- t$statistic["z"]
+		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
+	results[i, 'Length'] <- length (var)
+	results[i, 'NAs'] <- sum (is.na(var))
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("D'Agostino test of skewness",
+	parameters=list ("Alternative Hypothesis", "two.sided"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::agostino_test", settings="alternative.string=two.sided\nlength.state=1\nshow_alternative.state=1\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest50z\\ntest10x", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.agostino_test.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,11 @@
+<h1>D'Agostino test of skewness</h1>
+<h2>Parameters</h2>
+<ul><li>Alternative Hypothesis: two.sided</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>skewness estimator (skew)</td><td>transformation (z)</td><td>p-value</td><td>Alternative Hypothesis</td><td>Length</td><td>NAs</td></tr>
+<tr><td>breaks</td><td>1.2720</td><td>2.3145</td><td>0.020643</td><td>data have a skewness</td><td>54</td><td>0</td></tr>
+<tr><td>test50z</td><td>0</td><td>0</td><td>1</td><td>data have a skewness</td><td>50</td><td>0</td></tr>
+<tr><td>test10x</td><td>0</td><td>0</td><td>1</td><td>data have a skewness</td><td>11</td><td>1</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,48 @@
+local({
+## Prepare
+require(exactRankTests)
+
+names <- rk.get.description (test50x, test10y)
+## Compute
+result <- ansari.exact (test50x, test10y, alternative = "two.sided", exact=TRUE, conf.int = TRUE)
+
+## Print result
+rk.header (result$method,
+	parameters=list ("Comparing", paste (names[1], "against", names[2]),
+	'H1', rk.describe.alternative (result),
+	"Compute exact p-value", "yes",
+	"Confidence Level", "0.95000000" ))
+
+rk.results (list (
+	'Variable Names'=names,
+	'statistic'=result$statistic,
+	'null.value'=result$null.value,
+	p=result$p.value,
+	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+	'confidence interval of difference'=result$conf.int,
+	'estimate of the ratio of scales'=result$estimate))
+})
+.rk.rerun.plugin.link(plugin="rkward::ansari_bradley_exact_test", settings="alternative.string=two.sided\nconfint.state=TRUE\nconflevel.real=0.95000000\nexact.string=yes\nx.available=test50x\ny.available=test10y", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+require(exactRankTests)
+
+names <- rk.get.description (test50x, test50y)
+## Compute
+result <- ansari.exact (test50x, test50y, alternative = "less", conf.int = FALSE)
+
+## Print result
+rk.header (result$method,
+	parameters=list ("Comparing", paste (names[1], "against", names[2]),
+	'H1', rk.describe.alternative (result),
+	"Compute exact p-value", "automatic"))
+
+rk.results (list (
+	'Variable Names'=names,
+	'statistic'=result$statistic,
+	'null.value'=result$null.value,
+	p=result$p.value))
+})
+.rk.rerun.plugin.link(plugin="rkward::ansari_bradley_exact_test", settings="alternative.string=less\nconfint.state=FALSE\nexact.string=automatic\nx.available=test50x\ny.available=test50y", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_exact_test.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,26 @@
+<h1>Ansari-Bradley test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test50x against test10y</li>
+<li>H1: true ratio of scales is not equal to 1</li>
+<li>Compute exact p-value: yes</li>
+<li>Confidence Level: 0.95000000</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Names</td><td>statistic</td><td>null.value</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td><td>estimate of the ratio of scales</td></tr>
+<tr><td>test50x
+<br/>test10y</td><td>875</td><td>1</td><td>1.3814e-05</td><td>95</td><td>0.56158
+<br/>0.70792</td><td>0.58206</td></tr>
+</table>
+<h1>Ansari-Bradley test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test50x against test50y</li>
+<li>H1: true ratio of scales is less than 1</li>
+<li>Compute exact p-value: automatic</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Names</td><td>statistic</td><td>null.value</td><td>p</td></tr>
+<tr><td>test50x
+<br/>test50y</td><td>1275</td><td>1</td><td>0.5</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,46 @@
+local({
+## Prepare
+names <- rk.get.description (test50x, test10y)
+## Compute
+result <- ansari.test (test50x, test10y, alternative = "two.sided", exact=TRUE, conf.int = TRUE)
+
+## Print result
+rk.header (result$method,
+	parameters=list (
+		"Comparing", paste (names[1], "against", names[2]),
+		"Alternative Hypothesis", rk.describe.alternative(result),
+		"Compute exact p-value", "yes",
+		 "Confidence Level", "0.95000000" ))
+
+rk.results (list (
+	'Variable Names'=names,
+	'statistic'=result$statistic,
+	'null.value'=result$null.value,
+	p=result$p.value,
+	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+	'confidence interval of difference'=result$conf.int,
+	'estimate of the ratio of scales'=result$estimate))
+})
+.rk.rerun.plugin.link(plugin="rkward::ansari_bradley_test", settings="alternative.string=two.sided\nconfint.state=TRUE\nconflevel.real=0.95000000\nexact.string=yes\nx.available=test50x\ny.available=test10y", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+names <- rk.get.description (test50x, test50y)
+## Compute
+result <- ansari.test (test50x, test50y, alternative = "less", conf.int = FALSE)
+
+## Print result
+rk.header (result$method,
+	parameters=list (
+		"Comparing", paste (names[1], "against", names[2]),
+		"Alternative Hypothesis", rk.describe.alternative(result),
+		"Compute exact p-value", "automatic"))
+
+rk.results (list (
+	'Variable Names'=names,
+	'statistic'=result$statistic,
+	'null.value'=result$null.value,
+	p=result$p.value))
+})
+.rk.rerun.plugin.link(plugin="rkward::ansari_bradley_test", settings="alternative.string=less\nconfint.state=FALSE\nexact.string=automatic\nx.available=test50x\ny.available=test50y", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.ansari_bradley_test.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,26 @@
+<h1>Ansari-Bradley test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test50x against test10y</li>
+<li>Alternative Hypothesis: true ratio of scales is not equal to 1</li>
+<li>Compute exact p-value: yes</li>
+<li>Confidence Level: 0.95000000</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Names</td><td>statistic</td><td>null.value</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td><td>estimate of the ratio of scales</td></tr>
+<tr><td>test50x
+<br/>test10y</td><td>875</td><td>1</td><td>1.3814e-05</td><td>95</td><td>0.56158
+<br/>0.70792</td><td>0.58206</td></tr>
+</table>
+<h1>Ansari-Bradley test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test50x against test50y</li>
+<li>Alternative Hypothesis: true ratio of scales is less than 1</li>
+<li>Compute exact p-value: automatic</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Names</td><td>statistic</td><td>null.value</td><td>p</td></tr>
+<tr><td>test50x
+<br/>test50y</td><td>1275</td><td>1</td><td>0.5</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,29 @@
+local({
+## Prepare
+require(moments)
+## Compute
+vars <- list (substitute (warpbreaks[["breaks"]]), substitute (test50z), substitute (test10y))
+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, 'Error'] <- tryCatch ({
+		t <- anscombe.test (var, alternative = "two.sided")
+		results[i, 'Kurtosis estimator (tau)'] <- t$statistic["kurt"]
+		results[i, 'Transformation (z)'] <- t$statistic["z"]
+		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
+	results[i, 'Length'] <- length (var)
+	results[i, 'NAs'] <- sum (is.na(var))
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Anscombe-Glynn test of kurtosis",
+	parameters=list ("Alternative Hypothesis", "two.sided"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::anscombe_test", settings="alternative.string=two.sided\nlength.state=1\nshow_alternative.state=1\nx.available=warpbreaks[[\\\"breaks\\\"]]\\ntest50z\\ntest10y", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.anscombe_test.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,11 @@
+<h1>Anscombe-Glynn test of kurtosis</h1>
+<h2>Parameters</h2>
+<ul><li>Alternative Hypothesis: two.sided</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Kurtosis estimator (tau)</td><td>Transformation (z)</td><td>p-value</td><td>Alternative Hypothesis</td><td>Length</td><td>NAs</td></tr>
+<tr><td>breaks</td><td>4.499</td><td>2.0997</td><td>0.035759</td><td>kurtosis is not equal to 3</td><td>54</td><td>0</td></tr>
+<tr><td>test50z</td><td>1.7990</td><td>-3.2904</td><td>0.0010006</td><td>kurtosis is not equal to 3</td><td>50</td><td>0</td></tr>
+<tr><td>test10y</td><td>1.7758</td><td>-0.98164</td><td>0.32628</td><td>kurtosis is not equal to 3</td><td>11</td><td>1</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,30 @@
+local({
+## Prepare
+require(moments)
+## Compute
+
+vars <- list (substitute (test50z), substitute (test50y), substitute (test50x), substitute (test10z), substitute (test10y), substitute (test10x))
+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, 'Error'] <- tryCatch ({
+		t <- bonett.test (var, alternative = "two.sided")
+		results[i, 'Kurtosis estimator (tau)'] <- t$statistic["tau"]
+		results[i, 'Transformation (z)'] <- t$statistic["z"]
+		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
+	results[i, 'Length'] <- length (var)
+	results[i, 'NAs'] <- length (which(is.na(var)))
+}
+if (all (is.na (results$'Error'))) results$'Error' <- NULL
+## Print result
+rk.header ("Bonett-Seier test of Geary's kurtosis",
+	parameters=list ("Alternative Hypothesis", "two.sided"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::bonett_test", settings="alternative.string=two.sided\nlength.state=1\nshow_alternative.state=1\nx.available=test50z\\ntest50y\\ntest50x\\ntest10z\\ntest10y\\ntest10x", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.bonett_test.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,14 @@
+<h1>Bonett-Seier test of Geary's kurtosis</h1>
+<h2>Parameters</h2>
+<ul><li>Alternative Hypothesis: two.sided</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Kurtosis estimator (tau)</td><td>Transformation (z)</td><td>p-value</td><td>Alternative Hypothesis</td><td>Length</td><td>NAs</td></tr>
+<tr><td>test50z</td><td>50</td><td>-2.2224</td><td>0.026254</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>50</td><td>0</td></tr>
+<tr><td>test50y</td><td>12.5</td><td>-2.2224</td><td>0.026254</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>50</td><td>0</td></tr>
+<tr><td>test50x</td><td>12.5</td><td>-2.2224</td><td>0.026254</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>50</td><td>0</td></tr>
+<tr><td>test10z</td><td>10</td><td>-1.1304</td><td>0.25832</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>11</td><td>1</td></tr>
+<tr><td>test10y</td><td>2.5</td><td>-1.1304</td><td>0.25832</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>11</td><td>1</td></tr>
+<tr><td>test10x</td><td>2.5</td><td>-1.1304</td><td>0.25832</td><td>kurtosis is not equal to sqrt(2/pi)</td><td>11</td><td>1</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,20 @@
+local({
+## Prepare
+require(moments)
+## Compute
+
+objects <- list (substitute (test50z), substitute (test50y), substitute (test50x), substitute (test10z), substitute (test10y), substitute (test10x))
+results <- data.frame ('Variable Name'=rep (NA, length (objects)), check.names=FALSE)
+for (i in 1:length (objects)) {
+	var <- eval (objects[[i]], envir=globalenv ())
+	results[i, 'Variable Name'] <- rk.get.description (objects[[i]], is.substitute=TRUE)
+
+	try (results[i, 'Moment'] <- moment (var, order = 1, central = FALSE, absolute = FALSE, na.rm = TRUE))
+}
+## Print result
+rk.header ("Statistical Moment",
+	parameters=list ("Order", "1", "Compute central moments", "FALSE", "Compute absolute moments", "FALSE", "Remove missing values", "TRUE"))
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::moment", settings="absolute.state=FALSE\ncentral.state=FALSE\nlength.state=0\nnarm.state=TRUE\norder.real=1.000000\nx.available=test50z\\ntest50y\\ntest50x\\ntest10z\\ntest10y\\ntest10x", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.moments_moment.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,17 @@
+<h1>Statistical Moment</h1>
+<h2>Parameters</h2>
+<ul><li>Order: 1</li>
+<li>Compute central moments: FALSE</li>
+<li>Compute absolute moments: FALSE</li>
+<li>Remove missing values: TRUE</li>
+</ul>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Moment</td></tr>
+<tr><td>test50z</td><td>102</td></tr>
+<tr><td>test50y</td><td>225.5</td></tr>
+<tr><td>test50x</td><td>125.5</td></tr>
+<tr><td>test10z</td><td>22</td></tr>
+<tr><td>test10y</td><td>205.5</td></tr>
+<tr><td>test10x</td><td>105.5</td></tr>
+</table>

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkcommands.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,26 @@
+local({
+## Prepare
+require(moments)
+## Compute
+objects <- list (substitute (women[["weight"]]), substitute (women[["height"]]), substitute (warpbreaks[["breaks"]]))
+results <- data.frame ('Variable Name'=rep (NA, length (objects)), check.names=FALSE)
+for (i in 1:length (objects)) {
+	var <- eval (objects[[i]], envir=globalenv ())
+	results[i, 'Variable Name'] <- rk.get.description (objects[[i]], is.substitute=TRUE)
+
+	try ({
+		results[i, 'Skewness'] <- skewness (var, na.rm=TRUE)
+		results[i, 'Kurtosis'] <- kurtosis (var, na.rm=TRUE)
+		results[i, 'Excess Kurtosis'] <- results[i, 'Kurtosis'] - 3
+		results[i, 'Geary Kurtosis'] <- geary (var, na.rm=TRUE)
+	})
+
+	results[i, 'Length'] <- length (var)
+	results[i, 'NAs'] <- sum (is.na(var))
+}
+## Print result
+rk.header ("Skewness and Kurtosis")
+rk.results (results)
+})
+.rk.rerun.plugin.link(plugin="rkward::skewness_kurtosis", settings="geary.state=1\nkurtosis.state=1\nlength.state=1\nnarm.state=1\nskewness.state=1\nx.available=women[[\\\"weight\\\"]]\\nwomen[[\\\"height\\\"]]\\nwarpbreaks[[\\\"breaks\\\"]]", label="Run again")
+.rk.make.hr()

Added: trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.skewness_kurtosis.rkout	2009-08-24 11:01:26 UTC (rev 2624)
@@ -0,0 +1,8 @@
+<h1>Skewness and Kurtosis</h1>
+DATE<br>
+<table border="1">
+<tr><td>Variable Name</td><td>Skewness</td><td>Kurtosis</td><td>Excess Kurtosis</td><td>Geary Kurtosis</td><td>Length</td><td>NAs</td></tr>
+<tr><td>weight</td><td>0.25247</td><td>1.9002</td><td>-1.0998</td><td>0.86258</td><td>15</td><td>0</td></tr>
+<tr><td>height</td><td>0</td><td>1.7893</td><td>-1.2107</td><td>0.8641</td><td>15</td><td>0</td></tr>
+<tr><td>breaks</td><td>1.2720</td><td>4.499</td><td>1.4990</td><td>0.75029</td><td>54</td><td>0</td></tr>
+</table>

Modified: trunk/rkward/tests/analysis_plugins.R
===================================================================
--- trunk/rkward/tests/analysis_plugins.R	2009-08-24 09:56:04 UTC (rev 2623)
+++ trunk/rkward/tests/analysis_plugins.R	2009-08-24 11:01:26 UTC (rev 2624)
@@ -57,7 +57,32 @@
 			rk.call.plugin ("rkward::wilcoxon_exact_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95000000", correct.state="FALSE", exact.string="yes", mu.real="0.00000000", x.available="test50x", y.available="", submit.mode="submit")
 
 			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"))
+		}, 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")),
+		new ("RKTest", id="bonett_test", call=function () {
+			rk.call.plugin ("rkward::bonett_test", alternative.string="two.sided", length.state="1", show_alternative.state="1", x.available="test50z\ntest50y\ntest50x\ntest10z\ntest10y\ntest10x", submit.mode="submit")
+		}, libraries=c ("moments")),
+		new ("RKTest", id="agostino_test", call=function () {
+			rk.call.plugin ("rkward::agostino_test", alternative.string="two.sided", length.state="1", show_alternative.state="1", x.available="warpbreaks[[\"breaks\"]]\ntest50z\ntest10x", submit.mode="submit")
+		}, libraries=c ("moments")),
+		new ("RKTest", id="anscombe_test", call=function () {
+			rk.call.plugin ("rkward::anscombe_test", alternative.string="two.sided", length.state="1", show_alternative.state="1", x.available="warpbreaks[[\"breaks\"]]\ntest50z\ntest10y", submit.mode="submit")
+		}, 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"))
 	), 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