[rkward-cvs] SF.net SVN: rkward: [1852] trunk/rkward/rkward/plugins/analysis
nono_231 at users.sourceforge.net
nono_231 at users.sourceforge.net
Wed Apr 25 21:59:42 UTC 2007
Revision: 1852
http://svn.sourceforge.net/rkward/?rev=1852&view=rev
Author: nono_231
Date: 2007-04-25 14:59:42 -0700 (Wed, 25 Apr 2007)
Log Message:
-----------
The Crosstab plugin transformed two a multiple 2 dimension crosstab plugin. Preview removed.
Modified Paths:
--------------
trunk/rkward/rkward/plugins/analysis/crosstab.php
trunk/rkward/rkward/plugins/analysis/crosstab.xml
Modified: trunk/rkward/rkward/plugins/analysis/crosstab.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/crosstab.php 2007-04-25 18:57:12 UTC (rev 1851)
+++ trunk/rkward/rkward/plugins/analysis/crosstab.php 2007-04-25 21:59:42 UTC (rev 1852)
@@ -21,29 +21,30 @@
function doPrintout ($final) {
$x = getRK_val ("x") ;
- $y = getRK_val ("y") ;
+ $yvarsstring = join (", ", split ("\n", getRK_val ("y")));
$labels = getRK_val ("labels")=="TRUE";
?>
x <- (<? echo ($x); ?>)
-y <- (<? echo ($y); ?>)
+y <- cbind (<? echo ($yvarsstring); ?>)
-rk.header ("Crosstabs", list ("Variable", rk.get.description (<? echo ($x); ?>), "Group", rk.get.description (<? echo ($y); ?>)))
-xy<-table(x,y)
+for (i in 1:length(y)){
+xy<-table(x,y[,i])
+rk.header ("Crosstabs", list ("Dependent", rk.get.description (<? echo ($x); ?>), "Independent", rk.get.description (<? echo ($yvarsstring); ?>)[i]))
<? if ($final) { ?>
rk.print(xtable(cbind(xy)))
<? if (getRK_val ("chisq") == "TRUE") { ?>
-rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Variable", rk.get.description (<? echo ($x); ?>), "Group", rk.get.description (<? echo ($y); ?>), "Monte Carlo", "<? getRK ("monte"); ?>" <? if (getRK_val ("monte") == "TRUE") { ?>, "Number of replicates", <? getRK ("B"); }?> ))
+rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Dependent", rk.get.description (<? echo ($x); ?>), "Independent", rk.get.description (<? echo ($yvarsstring); ?>)[i], "Monte Carlo", "<? getRK ("monte"); ?>" <? if (getRK_val ("monte") == "TRUE") { ?>, "Number of replicates", <? getRK ("B"); }?> ))
xsquared<-cbind(
-chisq.test(x,y <?if (getRK_val ("monte") == "TRUE") { ?>,B=(<? getRK ("B"); ?>) <?}?> )$statistic,
- chisq.test(x,y <?if (getRK_val ("monte") == "TRUE") { ?>,B=(<? getRK ("B"); ?>) <?}?> )$parameter,
- chisq.test(x,y <?if (getRK_val ("monte") == "TRUE") { ?>,B=(<? getRK ("B"); ?>) <?}?> )$p.value)
+chisq.test(xy)$statistic,
+ chisq.test(xy)$parameter,
+ chisq.test(xy)$p.value)
colnames(xsquared)<-c("Statistic", "df", "p-value")
rk.print(xtable(xsquared))
<? } ?>
<? if (getRK_val ("barplot") == "TRUE") { ?>
-rk.header ("Barplot for Crosstabs", list ("Variable", rk.get.description (<? echo ($x); ?>), "Group", rk.get.description (<? echo ($y); ?>) <? if (getRK_val ("barplot") == "TRUE") { ?> , "Rainbow colors", "<? getRK ("rainbow"); ?>", "Beside", "<? getRK ("beside"); ?>", "Legend", "<? getRK ("legend"); ?>"<? } ?>))
+rk.header ("Barplot for Crosstabs", list ("Dependent", rk.get.description (<? echo ($x); ?>), "Independent", rk.get.description (<? echo ($yvarsstring); ?>)[i] <? if (getRK_val ("barplot") == "TRUE") { ?> , "Rainbow colors", "<? getRK ("rainbow"); ?>", "Beside", "<? getRK ("beside"); ?>", "Legend", "<? getRK ("legend"); ?>"<? } ?>))
rk.graph.on ()
<? }
}
@@ -73,6 +74,7 @@
<? if (getRK_val ("barplot") == "TRUE") { ?>
rk.graph.off ()
<? }
+} ?>
}
-}
+<? }
?>
Modified: trunk/rkward/rkward/plugins/analysis/crosstab.xml
===================================================================
--- trunk/rkward/rkward/plugins/analysis/crosstab.xml 2007-04-25 18:57:12 UTC (rev 1851)
+++ trunk/rkward/rkward/plugins/analysis/crosstab.xml 2007-04-25 21:59:42 UTC (rev 1852)
@@ -5,7 +5,6 @@
<convert id="chisqvalue" mode="equals" sources="chisq.state" standard="TRUE" />
<connect client="chi_options.enabled" governor="chisqvalue" />
<convert id="barplotvalue" mode="equals" sources="barplot.state" standard="TRUE" />
- <connect client="preview.enabled" governor="barplotvalue" />
<connect client="plot_options.enabled" governor="barplotvalue" />
<convert id="besidevalue" mode="equals" sources="beside.string" standard="TRUE" />
<connect client="labels.enabled" governor="besidevalue" />
@@ -21,11 +20,10 @@
<row>
<varselector id="vars"/>
<column>
- <varslot multi="false" id="x" source="vars" label="variable" required="true" />
- <varslot multi="false" id="y" source="vars" label="Group" required="true" />
+ <varslot multi="false" id="x" source="vars" label="Dependent" required="true" />
+ <varslot min_vars="1" multi="true" id="y" source="vars" required="true" label="Independent"/>
<checkbox id="chisq" label="Chisquare" value="TRUE" value_unchecked="FALSE" checked="false" /> <checkbox id="barplot" label="Draw Barplot?" value="TRUE" value_unchecked="FALSE" checked="false" />
<stretch/>
- <preview id="preview"/>
</column>
</row>
</tab>
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