[rkward-cvs] SF.net SVN: rkward: [1194] trunk/rkward/rkward/plugins
sjar at users.sourceforge.net
sjar at users.sourceforge.net
Mon Jan 22 23:40:15 UTC 2007
Revision: 1194
http://svn.sourceforge.net/rkward/?rev=1194&view=rev
Author: sjar
Date: 2007-01-22 15:40:14 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
skeletons for Wilcoxon rank sum tests
work still in progress!
Added Paths:
-----------
trunk/rkward/rkward/plugins/wilcoxon/
trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.php
trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.xml
trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.php
trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.xml
Added: trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.php
===================================================================
--- trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.php (rev 0)
+++ trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.php 2007-01-22 23:40:14 UTC (rev 1194)
@@ -0,0 +1,46 @@
+<?
+ function preprocess () {
+ }
+
+ 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 ("hypothesis"); ?>"), mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?>, exact = <? getRK ("exact"); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
+if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
+rk.temp.print.conf.level <- <? if (getRK_val ("confint")) echo "TRUE"; else echo "FALSE"; ?>
+
+<?
+ }
+
+ 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)),
+ "H1", if (rk.temp$alternative == "less")
+ paste (rk.get.short.name (rk.temp.y), "is greater than", rk.get.short.name (rk.temp.x))
+ else if (rk.temp$alternative == "greater")
+ paste (rk.get.short.name (rk.temp.x), "is greater than", rk.get.short.name (rk.temp.y))
+ else
+ paste (rk.get.short.name (rk.temp.x), "and", rk.get.short.name (rk.temp.y), "differ")))
+
+rk.results (list (
+ 'Variable Name'=rk.get.description (rk.temp.x),
+ 'statistic'=rk.temp$statistic,
+ 'degrees of freedom'=rk.temp$parameter,
+ 'mu'=rk.temp$null.value,
+ 'alternative'=rk.temp$alternative,
+ p=rk.temp$p.value<?
+ if (getRK_val ("confint")) { ?>,
+ 'confidence interval percent'=(100 * attr(rk.temp$conf.int, "conf.level")),
+ 'confidence interval of difference'=rk.temp$conf.int <? } ?>))
+<?
+ }
+
+ function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+ }
+?>
Added: trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.xml (rev 0)
+++ trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_exact_test.xml 2007-01-22 23:40:14 UTC (rev 1194)
@@ -0,0 +1,37 @@
+<!DOCTYPE rkplugin>
+
+<!-- This is a simple example, of how a "plugin" might be configured. -->
+
+<document>
+ <code file="wilcoxon_exact_test.php"/>
+
+ <dialog label="Wilcoxon exact test">
+ <tabbook>
+ <tab label="Basic settings">
+ <row>
+ <varselector id="vars"/>
+ <column>
+ <varslot type="numeric" id="x" source="vars" required="true" label="compare"/>
+ <varslot type="numeric" id="y" source="vars" required="true" label="against"/>
+ <radio id="hypothesis" label="using test hypothesis">
+ <option value="two.sided" label="Two-sided"/>
+ <option value="greater" label="First is greater"/>
+ <option value="less" label="Second is greater"/>
+ </radio>
+ </column>
+ </row>
+ </tab>
+ <tab label="Options">
+ <frame label="Confidence Interval">
+ <checkbox id="confint" label="compute confidence interval" checked="false" value="FALSE" value_unchecked="TRUE" />
+ <spinbox type="real" id="conflevel" label="confidence level" min="0" max="1" initial="0.95"/>
+ </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"/>
+ <checkbox id="correct" label="apply continuity correction" checked="true" value="TRUE" value_unchecked="FALSE"/>
+ </tab>
+ </tabbook>
+ </dialog>
+
+</document>
Added: trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.php
===================================================================
--- trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.php (rev 0)
+++ trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.php 2007-01-22 23:40:14 UTC (rev 1194)
@@ -0,0 +1,44 @@
+<?
+ function preprocess () {
+ }
+
+ function calculate () {
+?>rk.temp.x <- substitute (<? getRK ("x"); ?>)
+rk.temp.y <- substitute (<? getRK ("y"); ?>)
+rk.temp <- t.test (eval (rk.temp.x), eval (rk.temp.y), alternative = c("<? getRK ("hypothesis"); ?>"), mu = <? getRK ("mu"); ?>, paired = <? getRK ("paired"); ?>, exact = <? getRK ("exact"); ?>, correct = <? getRK ("correct"); ?>, conf.int = <? getRK ("confint"); ?> <?
+if (($conflevel = getRK_val ("conflevel")) != "0.95") echo (", conf.level=" . $conflevel); ?>)
+rk.temp.print.conf.level <- <? if (getRK_val ("confint")) echo "TRUE"; else echo "FALSE"; ?>
+
+<?
+ }
+
+ 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)),
+ "H1", if (rk.temp$alternative == "less")
+ paste (rk.get.short.name (rk.temp.y), "is greater than", rk.get.short.name (rk.temp.x))
+ else if (rk.temp$alternative == "greater")
+ paste (rk.get.short.name (rk.temp.x), "is greater than", rk.get.short.name (rk.temp.y))
+ else
+ paste (rk.get.short.name (rk.temp.x), "and", rk.get.short.name (rk.temp.y), "differ")))
+
+rk.results (list (
+ 'Variable Name'=rk.get.description (rk.temp.x),
+ 'statistic'=rk.temp$statistic,
+ 'degrees of freedom'=rk.temp$parameter,
+ 'mu'=rk.temp$null.value,
+ 'alternative'=rk.temp$alternative,
+ p=rk.temp$p.value<?
+ if (getRK_val ("confint")) { ?>,
+ 'confidence interval percent'=(100 * attr(rk.temp$conf.int, "conf.level")),
+ 'confidence interval of difference'=rk.temp$conf.int <? } ?>))
+<?
+ }
+
+ function cleanup () {
+?>
+rm (list=grep ("^rk.temp", ls (), value=TRUE))
+<?
+ }
+?>
Added: trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.xml
===================================================================
--- trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.xml (rev 0)
+++ trunk/rkward/rkward/plugins/wilcoxon/wilcoxon_test.xml 2007-01-22 23:40:14 UTC (rev 1194)
@@ -0,0 +1,37 @@
+<!DOCTYPE rkplugin>
+
+<!-- This is a simple example, of how a "plugin" might be configured. -->
+
+<document>
+ <code file="wilcoxon_test.php"/>
+
+ <dialog label="Wilcoxon test">
+ <tabbook>
+ <tab label="Basic settings">
+ <row>
+ <varselector id="vars"/>
+ <column>
+ <varslot type="numeric" id="x" source="vars" required="true" label="compare"/>
+ <varslot type="numeric" id="y" source="vars" required="true" label="against"/>
+ <radio id="hypothesis" label="using test hypothesis">
+ <option value="two.sided" label="Two-sided"/>
+ <option value="greater" label="First is greater"/>
+ <option value="less" label="Second is greater"/>
+ </radio>
+ </column>
+ </row>
+ </tab>
+ <tab label="Options">
+ <frame label="Confidence Interval">
+ <checkbox id="confint" label="compute confidence interval" checked="false" value="FALSE" value_unchecked="TRUE" />
+ <spinbox type="real" id="conflevel" label="confidence level" min="0" max="1" initial="0.95"/>
+ </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"/>
+ <checkbox id="correct" label="apply continuity correction" checked="true" value="TRUE" value_unchecked="FALSE"/>
+ </tab>
+ </tabbook>
+ </dialog>
+
+</document>
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