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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Aug 30 12:44:33 UTC 2012


Revision: 4295
          http://rkward.svn.sourceforge.net/rkward/?rev=4295&view=rev
Author:   tfry
Date:     2012-08-30 12:44:33 +0000 (Thu, 30 Aug 2012)
Log Message:
-----------
Update tests and standards for t-test plugin

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

Added Paths:
-----------
    trunk/rkward/tests/analysis_plugins/t_test.rkcommands.R
    trunk/rkward/tests/analysis_plugins/t_test.rkout

Removed Paths:
-------------
    trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkcommands.R
    trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkout

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2012-08-30 12:28:56 UTC (rev 4294)
+++ trunk/rkward/ChangeLog	2012-08-30 12:44:33 UTC (rev 4295)
@@ -15,7 +15,7 @@
 - Added dynamically generated table-of-contents menu to output document
 - Fixed: Would not show output of system() commands to stderr on the console (on Unix-like systems)
 - Allow some markup inside <text> elements in plugins, and auto-add breaks only for duplicate newlines.
-- Reorganized t-test plugin, and add support for single sample t-tests			TODO: adjust test(s)
+- Reorganized t-test plugin, and add support for single sample t-tests
 - Fixed: Function argument hints for the second half of the parameter list would not be quoted, correctly
 - Improve keypress handling issues in the R Console, when the cursor or a selection is outside the editable range
 - Fixed: Failure to open workspaces with non-latin1 filenames from the command line

Copied: trunk/rkward/tests/analysis_plugins/t_test.rkcommands.R (from rev 4291, trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkcommands.R)
===================================================================
--- trunk/rkward/tests/analysis_plugins/t_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/t_test.rkcommands.R	2012-08-30 12:44:33 UTC (rev 4295)
@@ -0,0 +1,58 @@
+local({
+## Prepare
+names <- rk.get.description (test50x, test50y)
+## Compute
+result <- t.test (x=test50x, y=test50y, alternative="two.sided")
+## Print result
+rk.header (result$method, 
+	parameters=list ("Comparing"=paste (names[1], "against", names[2]),
+	"H1"=rk.describe.alternative (result),
+	"Equal variances"="not assumed"))
+
+rk.results (list (
+	'Variable Name'=names,
+	'estimated mean'=result$estimate,
+	'degrees of freedom'=result$parameter,
+	t=result$statistic,
+	p=result$p.value,
+	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+	'confidence interval of difference'=result$conf.int ))
+})
+local({
+## Prepare
+names <- rk.get.description (test10y, test10z)
+## Compute
+result <- t.test (x=test10y, y=test10z, alternative="less", paired=TRUE, conf.level=0.99)
+## Print result
+rk.header (result$method, 
+	parameters=list ("Comparing"=paste (names[1], "against", names[2]),
+	"H1"=rk.describe.alternative (result)))
+
+rk.results (list (
+	'Variable Name'=names,
+	'estimated mean'=result$estimate,
+	'degrees of freedom'=result$parameter,
+	t=result$statistic,
+	p=result$p.value,
+	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+	'confidence interval of difference'=result$conf.int ))
+})
+local({
+## Prepare
+names <- rk.get.description (test10z)
+## Compute
+result <- t.test (x=test10z, mu=20.00, alternative="two.sided")
+## Print result
+rk.header (result$method, 
+	parameters=list ("Comparing"=paste (names[1], "against constant"),
+	"H1"=rk.describe.alternative (result)))
+
+rk.results (list (
+	'Variable Name'=names,
+	'estimated mean'=result$estimate,
+	'degrees of freedom'=result$parameter,
+	t=result$statistic,
+	p=result$p.value,
+	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
+	'confidence interval of difference'=result$conf.int ))
+})

Copied: trunk/rkward/tests/analysis_plugins/t_test.rkout (from rev 4291, trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkout)
===================================================================
--- trunk/rkward/tests/analysis_plugins/t_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/analysis_plugins/t_test.rkout	2012-08-30 12:44:33 UTC (rev 4295)
@@ -0,0 +1,37 @@
+<h1>Welch Two Sample t-test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test50x against test50y</li>
+<li>H1: true difference in means is not equal to 0</li>
+<li>Equal variances: not assumed</li>
+</ul>
+DATE<br />
+<table border="1">
+<tr><td>Variable Name</td><td>estimated mean</td><td>degrees of freedom</td><td>t</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td></tr>
+<tr><td>test50x
+<br/>test50y</td><td>125.5
+<br/>225.5</td><td>98</td><td>-34.3</td><td>2.1436e-56</td><td>95</td><td>-105.79
+<br/>-94.214</td></tr>
+</table>
+<h1>Paired t-test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test10y against test10z</li>
+<li>H1: true difference in means is less than 0</li>
+</ul>
+DATE<br />
+<table border="1">
+<tr><td>Variable Name</td><td>estimated mean</td><td>degrees of freedom</td><td>t</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td></tr>
+<tr><td>test10y
+<br/>test10z</td><td>183.5</td><td>9</td><td>63.886</td><td>1</td><td>99</td><td>-Inf
+<br/>191.6</td></tr>
+</table>
+<h1>One Sample t-test</h1>
+<h2>Parameters</h2>
+<ul><li>Comparing: test10z against constant</li>
+<li>H1: true mean is not equal to 20</li>
+</ul>
+DATE<br />
+<table border="1">
+<tr><td>Variable Name</td><td>estimated mean</td><td>degrees of freedom</td><td>t</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td></tr>
+<tr><td>test10z</td><td>22</td><td>9</td><td>0.52223</td><td>0.61412</td><td>95</td><td>13.337
+<br/>30.663</td></tr>
+</table>

Deleted: trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkcommands.R	2012-08-30 12:28:56 UTC (rev 4294)
+++ trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkcommands.R	2012-08-30 12:44:33 UTC (rev 4295)
@@ -1,39 +0,0 @@
-local({
-## Prepare
-names <- rk.get.description (test50x, test50y)
-## Compute
-result <- t.test (test50x, test50y, alternative="two.sided")
-## Print result
-rk.header (result$method, 
-	parameters=list ("Comparing", paste (names[1], "against", names[2]),
-	"H1", rk.describe.alternative (result),
-	"Equal variances", "not assumed"))
-
-rk.results (list (
-	'Variable Name'=names,
-	'estimated mean'=result$estimate,
-	'degrees of freedom'=result$parameter,
-	t=result$statistic,
-	p=result$p.value,
-	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
-	'confidence interval of difference'=result$conf.int ))
-})
-local({
-## Prepare
-names <- rk.get.description (test10y, test10z)
-## Compute
-result <- t.test (test10y, test10z, alternative="less", paired=TRUE, conf.level=0.99)
-## Print result
-rk.header (result$method, 
-	parameters=list ("Comparing", paste (names[1], "against", names[2]),
-	"H1", rk.describe.alternative (result)))
-
-rk.results (list (
-	'Variable Name'=names,
-	'estimated mean'=result$estimate,
-	'degrees of freedom'=result$parameter,
-	t=result$statistic,
-	p=result$p.value,
-	'confidence interval percent'=(100 * attr(result$conf.int, "conf.level")),
-	'confidence interval of difference'=result$conf.int ))
-})

Deleted: trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkout	2012-08-30 12:28:56 UTC (rev 4294)
+++ trunk/rkward/tests/analysis_plugins/t_test_two_vars.rkout	2012-08-30 12:44:33 UTC (rev 4295)
@@ -1,26 +0,0 @@
-<h1>Welch Two Sample t-test</h1>
-<h2>Parameters</h2>
-<ul><li>Comparing: test50x against test50y</li>
-<li>H1: true difference in means is not equal to 0</li>
-<li>Equal variances: not assumed</li>
-</ul>
-DATE<br />
-<table border="1">
-<tr><td>Variable Name</td><td>estimated mean</td><td>degrees of freedom</td><td>t</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td></tr>
-<tr><td>test50x
-<br/>test50y</td><td>125.5
-<br/>225.5</td><td>98</td><td>-34.3</td><td>2.1436e-56</td><td>95</td><td>-105.79
-<br/>-94.214</td></tr>
-</table>
-<h1>Paired t-test</h1>
-<h2>Parameters</h2>
-<ul><li>Comparing: test10y against test10z</li>
-<li>H1: true difference in means is less than 0</li>
-</ul>
-DATE<br />
-<table border="1">
-<tr><td>Variable Name</td><td>estimated mean</td><td>degrees of freedom</td><td>t</td><td>p</td><td>confidence interval percent</td><td>confidence interval of difference</td></tr>
-<tr><td>test10y
-<br/>test10z</td><td>183.5</td><td>9</td><td>63.886</td><td>1</td><td>99</td><td>-Inf
-<br/>191.6</td></tr>
-</table>

Modified: trunk/rkward/tests/analysis_plugins.R
===================================================================
--- trunk/rkward/tests/analysis_plugins.R	2012-08-30 12:28:56 UTC (rev 4294)
+++ trunk/rkward/tests/analysis_plugins.R	2012-08-30 12:44:33 UTC (rev 4295)
@@ -40,10 +40,12 @@
 		new ("RKTest", id="descriptive_stats", call=function () {
 			rk.call.plugin ("rkward::descriptive", constMad.real="1.4628", length.state="1", mad.state="1", mad_type.string="average", mean.state="1", median.state="1", prod.state="1", range.state="1", sd.state="1", sum.state="1", trim.real="0.00", x.available="women[[\"height\"]]\ntest10z", submit.mode="submit")
 		}),
-		new ("RKTest", id="t_test_two_vars", call=function () {
-			rk.call.plugin ("rkward::t_test_two_vars", confint.state="1", conflevel.real="0.95", hypothesis.string="two.sided", paired.state="0", varequal.state="0", x.available="test50x", y.available="test50y", submit.mode="submit")
+		new ("RKTest", id="t_test", call=function () {
+			rk.call.plugin ("rkward::t_test", confint.checked="1", conflevel.real="0.95", hypothesis.string="two.sided", test_form.string="indep", varequal.state="0", x.available="test50x", y.available="test50y", submit.mode="submit")
 
-			rk.call.plugin ("rkward::t_test_two_vars", confint.state="1", conflevel.real="0.99", hypothesis.string="less", paired.state="1", x.available="test10y", y.available="test10z", submit.mode="submit")
+			rk.call.plugin ("rkward::t_test", confint.checked="1", conflevel.real="0.99", hypothesis.string="less", test_form.string="paired", x.available="test10y", y.available="test10z", submit.mode="submit")
+
+			rk.call.plugin ("rkward::t_test", confint.checked="1", conflevel.real="0.95", hypothesis.string="two.sided", mu.real="20.00", test_form.string="const", x.available="test10z", submit.mode="submit")
 		}),
 		new ("RKTest", id="wilcoxon_test", call=function () {
 			rk.call.plugin ("rkward::wilcoxon_test", alternative.string="two.sided", confint.state="TRUE", conflevel.real="0.95", correct.state="FALSE", exact.string="yes", mu.real="0.00", x.available="test50x", y.available="", submit.mode="submit")

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