[rkward-cvs] SF.net SVN: rkward: [1362] trunk/rkward/rkward/plugins/analysis

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Feb 8 17:13:57 UTC 2007


Revision: 1362
          http://svn.sourceforge.net/rkward/?rev=1362&view=rev
Author:   tfry
Date:     2007-02-08 09:13:57 -0800 (Thu, 08 Feb 2007)

Log Message:
-----------
Allow automatic mode for exact option. Some minor cleanups

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.php
    trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.xml
    trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.php
    trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.xml
    trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.php
    trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.xml
    trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.php
    trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.xml

Modified: trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.php	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.php	2007-02-08 17:13:57 UTC (rev 1362)
@@ -1,22 +1,28 @@
 <?
-	function preprocess () {
+function preprocess () {
+}
+
+function calculate () {
+	$exact_setting = getRK_val ("exact");
+	if ($exact_setting == "yes") {
+		$exact_opt = ", exact=TRUE";
+	} else if ($exact_setting == "no") {
+		$exact_opt = ", exact=FALSE";
 	}
-	
-	function calculate () {
 ?>
 require(exactRankTests)
 rk.temp.x <- substitute (<? getRK ("x"); ?>)
 rk.temp.y <- substitute (<? getRK ("y"); ?>)
-rk.temp <- ansari.exact (eval (rk.temp.x), eval (rk.temp.y), alternative = c("<? getRK ("alternative"); ?>"), exact = <? getRK ("exact"); ?>, conf.int = <? getRK ("confint"); ?> <?
+rk.temp <- ansari.exact (eval (rk.temp.x), eval (rk.temp.y), alternative = "<? getRK ("alternative"); ?>"<? echo ($exact_opt); ?>, conf.int = <? getRK ("confint"); ?> <?
 if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
 
 <?
-	}
-	
-	function printout () {
+}
+
+function printout () {
 ?>
 rk.header ("Ansari-Bradley two-sample exact test", 
-	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),"Confidence Interval", "<? getRK ("confint"); ?>", "Confidence Level","Compute exact p-value", "<? getRK ("exact"); ?>"))
+	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),"Confidence Interval", "<? getRK ("confint"); ?>", "Confidence Level",<? getRK ("conflevel"); ?>, "Compute exact p-value", "<? getRK ("exact"); ?>"))
 
 rk.results (list (
 	'Variable Names'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
@@ -28,11 +34,11 @@
 	'confidence interval percent'=(100 * attr(rk.temp$conf.int, "conf.level")),
 	'confidence interval of difference'=rk.temp$conf.int <? } ?>))
 <?
-	}
-	
-	function cleanup () {
+}
+
+function cleanup () {
 ?>
 rm (list=grep ("^rk.temp", ls (), value=TRUE))
 <?
-	}
+}
 ?>

Modified: trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.xml	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_exact_test.xml	2007-02-08 17:13:57 UTC (rev 1362)
@@ -22,7 +22,11 @@
 				</row>
 			</tab>
 			<tab label="Options">
-				<checkbox id="exact" label="compute exact p-value" checked="true" value="NULL" value_unchecked="FALSE"/>
+				<radio id="exact" label="compute exact p-value">
+					<option label="Always" value="yes" />
+					<option label="Automatic" value="automatic" checked="true" />
+					<option label="Never" value="no" />
+				</radio>
 				<frame label="Confidence Interval">
 					<checkbox id="confint" label="compute confidence interval" checked="false" value="TRUE" value_unchecked="FALSE" />
 					<spinbox type="real" id="conflevel" label="confidence level" min="0" max="1" initial="0.95"/>

Modified: trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.php	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.php	2007-02-08 17:13:57 UTC (rev 1362)
@@ -1,21 +1,27 @@
 <?
-	function preprocess () {
+function preprocess () {
+}
+
+function calculate () {
+	$exact_setting = getRK_val ("exact");
+	if ($exact_setting == "yes") {
+		$exact_opt = ", exact=TRUE";
+	} else if ($exact_setting == "no") {
+		$exact_opt = ", exact=FALSE";
 	}
-	
-	function calculate () {
 ?>
 rk.temp.x <- substitute (<? getRK ("x"); ?>)
 rk.temp.y <- substitute (<? getRK ("y"); ?>)
-rk.temp <- ansari.test (eval (rk.temp.x), eval (rk.temp.y), alternative = c("<? getRK ("alternative"); ?>"), exact = <? getRK ("exact"); ?>, conf.int = <? getRK ("confint"); ?> <?
+rk.temp <- ansari.test (eval (rk.temp.x), eval (rk.temp.y), alternative = "<? getRK ("alternative"); ?>"<? echo ($exact_opt); ?>, conf.int = <? getRK ("confint"); ?> <?
 if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
 
 <?
-	}
-	
-	function printout () {
+}
+
+function printout () {
 ?>
 rk.header ("Ansari-Bradley two-sample test",
-	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),"Compute exact p-value", "<? getRK ("confint"); ?>","Confidence Interval", "<? getRK ("exact"); ?>"))
+	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),"Compute exact p-value", "<? getRK ("exact"); ?>","Confidence Interval", "<? getRK ("confint"); ?>"))
 
 rk.results (list (
 	'Variable Names'=rk.get.description (rk.temp.x, rk.temp.y, is.substitute=TRUE),
@@ -27,11 +33,11 @@
 	'confidence interval percent'=(100 * attr(rk.temp$conf.int, "conf.level")),
 	'confidence interval of difference'=rk.temp$conf.int <? } ?>))
 <?
-	}
-	
-	function cleanup () {
+}
+
+function cleanup () {
 ?>
 rm (list=grep ("^rk.temp", ls (), value=TRUE))
 <?
-	}
+}
 ?>

Modified: trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.xml	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/ansari_bradley/ansari_bradley_test.xml	2007-02-08 17:13:57 UTC (rev 1362)
@@ -22,7 +22,11 @@
 				</row>
 			</tab>
 			<tab label="Options">
-				<checkbox id="exact" label="compute exact p-value" checked="true" value="TRUE" value_unchecked="FALSE"/>
+				<radio id="exact" label="compute exact p-value">
+					<option label="Always" value="yes" />
+					<option label="Automatic" value="automatic" checked="true" />
+					<option label="Never" value="no" />
+				</radio>
 				<frame label="Confidence Interval">
 					<checkbox id="confint" label="Compute confidence interval" checked="false" value="TRUE" value_unchecked="FALSE" />
 					<spinbox type="real" id="conflevel" label="confidence level" min="0" max="1" initial="0.95"/>

Modified: trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.php	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.php	2007-02-08 17:13:57 UTC (rev 1362)
@@ -1,19 +1,25 @@
 <?
-	function preprocess () {
+function preprocess () {
+}
+
+function calculate () {
+	$exact_setting = getRK_val ("exact");
+	if ($exact_setting == "yes") {
+		$exact_opt = ", exact=TRUE";
+	} else if ($exact_setting == "no") {
+		$exact_opt = ", exact=FALSE";
 	}
-	
-	function calculate () {
 ?>
 require(exactRankTests)
 rk.temp.x <- substitute (<? getRK ("x"); ?>)
 rk.temp.y <- substitute (<? getRK ("y"); ?>)
-rk.temp <- wilcox.exact (eval (rk.temp.x), eval (rk.temp.y), alternative = c("<? getRK ("alternative"); ?>"), mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?>, exact = <? getRK ("exact"); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
+rk.temp <- wilcox.exact (eval (rk.temp.x), eval (rk.temp.y), alternative = "<? getRK ("alternative"); ?>", mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?><? echo ($exact_opt); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
 if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
 
 <?
-	}
-	
-	function printout () {
+}
+
+function printout () {
 ?>
 rk.header ("Wilcoxon exact test", 
 	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),
@@ -35,11 +41,11 @@
 	'confidence interval of difference'=rk.temp$conf.int,
 	'Difference in Location' = rk.temp$estimate <? } ?>))
 <?
-	}
-	
-	function cleanup () {
+}
+
+function cleanup () {
 ?>
 rm (list=grep ("^rk.temp", ls (), value=TRUE))
 <?
-	}
+}
 ?>

Modified: trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.xml	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_exact_test.xml	2007-02-08 17:13:57 UTC (rev 1362)
@@ -28,7 +28,11 @@
 				</frame>
 				<spinbox id="mu" label="mu" initial="0"/>
 				<checkbox id="paired" label="paired test" checked="true" value="FALSE" value_unchecked="TRUE"/>
-				<checkbox id="exact" label="compute exact p-value" checked="true" value="NULL" value_unchecked="FALSE"/>
+				<radio id="exact" label="compute exact p-value">
+					<option label="Always" value="yes" />
+					<option label="Automatic" value="automatic" checked="true" />
+					<option label="Never" value="no" />
+				</radio>
 				<checkbox id="correct" label="apply continuity correction" checked="true" value="TRUE" value_unchecked="FALSE"/>
 			</tab>
 		</tabbook>

Modified: trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.php	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.php	2007-02-08 17:13:57 UTC (rev 1362)
@@ -1,18 +1,24 @@
 <?
-	function preprocess () {
+function preprocess () {
+}
+
+function calculate () {
+	$exact_setting = getRK_val ("exact");
+	if ($exact_setting == "yes") {
+		$exact_opt = ", exact=TRUE";
+	} else if ($exact_setting == "no") {
+		$exact_opt = ", exact=FALSE";
 	}
-	
-	function calculate () {
 ?>
 rk.temp.x <- substitute (<? getRK ("x"); ?>)
 rk.temp.y <- substitute (<? getRK ("y"); ?>)
-rk.temp <- wilcox.test (eval (rk.temp.x), eval (rk.temp.y), alternative = c("<? getRK ("alternative"); ?>"), mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?>, exact = <? getRK ("exact"); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
+rk.temp <- wilcox.test (eval (rk.temp.x), eval (rk.temp.y), alternative = "<? getRK ("alternative"); ?>", mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?><? echo ($exact_opt); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
 if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
 
 <?
-	}
-	
-	function printout () {
+}
+
+function printout () {
 ?>
 rk.header ("Wilcoxon Test",
 	parameters=list ("Comparing", paste (rk.get.description (rk.temp.x, is.substitute=TRUE), "against", rk.get.description (rk.temp.y, is.substitute=TRUE)),
@@ -34,11 +40,11 @@
 	'confidence interval of difference'=rk.temp$conf.int,
 	'Difference in Location' = rk.temp$estimate <? } ?>))
 <?
-	}
-	
-	function cleanup () {
+}
+
+function cleanup () {
 ?>
 rm (list=grep ("^rk.temp", ls (), value=TRUE))
 <?
-	}
+}
 ?>

Modified: trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.xml	2007-02-08 16:37:13 UTC (rev 1361)
+++ trunk/rkward/rkward/plugins/analysis/wilcoxon/wilcoxon_test.xml	2007-02-08 17:13:57 UTC (rev 1362)
@@ -28,7 +28,11 @@
 				</frame>
 				<spinbox id="mu" label="mu" initial="0"/>
 				<checkbox id="paired" label="paired test" checked="true" value="FALSE" value_unchecked="TRUE"/>
-				<checkbox id="exact" label="compute exact p-value" checked="true" value="TRUE" value_unchecked="FALSE"/>
+				<radio id="exact" label="compute exact p-value">
+					<option label="Always" value="yes" />
+					<option label="Automatic" value="automatic" checked="true" />
+					<option label="Never" value="no" />
+				</radio>
 				<checkbox id="correct" label="apply continuity correction" checked="true" value="TRUE" value_unchecked="FALSE"/>
 			</tab>
 		</tabbook>


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