[rkward-cvs] SF.net SVN: rkward: [1858] trunk/rkward/rkward/plugins/analysis/crosstab. php

nono_231 at users.sourceforge.net nono_231 at users.sourceforge.net
Tue May 1 07:24:12 UTC 2007


Revision: 1858
          http://svn.sourceforge.net/rkward/?rev=1858&view=rev
Author:   nono_231
Date:     2007-05-01 00:24:12 -0700 (Tue, 01 May 2007)

Log Message:
-----------
Interchanged the x with y in tabulation to get the right results, y is treated as a data.frame now for better manipulation of data. Also xtable have digits=0 in the results of tabulation since it is the results of counts and will always be an integer. 

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/analysis/crosstab.php

Modified: trunk/rkward/rkward/plugins/analysis/crosstab.php
===================================================================
--- trunk/rkward/rkward/plugins/analysis/crosstab.php	2007-04-28 06:21:00 UTC (rev 1857)
+++ trunk/rkward/rkward/plugins/analysis/crosstab.php	2007-05-01 07:24:12 UTC (rev 1858)
@@ -26,14 +26,14 @@
 	
 ?>
 x <- (<? echo ($x); ?>)
-y <- cbind (<? echo ($yvarsstring); ?>)
+y <- data.frame (<? echo ($yvarsstring); ?>)
 
 for (i in 1:dim(y)[2]){
-xy<-table(x,y[,i])
+xy<-table(y[,i],x)
 rk.header ("Crosstabs", list ("Dependent", rk.get.description (<? echo ($x); ?>), "Independent", rk.get.description (<? echo ($yvarsstring); ?>)[i]))
 
 <?	if ($final) { ?>
-rk.print(xtable(cbind(xy)))
+rk.print(xtable(cbind(xy), digits=0))
 <?	if (getRK_val ("chisq") == "TRUE") { ?>
 rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Dependent", rk.get.description (<? echo ($x); ?>), "Independent", rk.get.description (<? echo ($yvarsstring); ?>)[i], "Simulate p vlaue", "<? getRK ("simpv");?>", "Monte Carlo", "<? getRK ("monte"); ?>" <? if (getRK_val ("monte") == "TRUE") { ?>,  "Number of replicates", <? getRK ("B"); }?> ))
 xsquared<-cbind(


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