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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Apr 27 18:23:49 UTC 2011


Revision: 3534
          http://rkward.svn.sourceforge.net/rkward/?rev=3534&view=rev
Author:   tfry
Date:     2011-04-27 18:23:48 +0000 (Wed, 27 Apr 2011)

Log Message:
-----------
Update crosstabs_n_to_1 auto-test, and add test for the new proportions / margins feature.

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkcommands.R
    trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkout
    trunk/rkward/tests/analysis_plugins.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-04-27 18:09:23 UTC (rev 3533)
+++ trunk/rkward/ChangeLog	2011-04-27 18:23:48 UTC (rev 3534)
@@ -1,6 +1,6 @@
 - Box plot plugin gains support for grouped outcome data
 - Fixed: Pressing Ctrl+C would not reset syntactically incomplete commands in the R console
-- Crosstabs N to 1 plugin gains options to compute proportions and margins (thanks to Andrés Necochea)		TODO: update / add automated test(s)
+- Crosstabs N to 1 plugin gains options to compute proportions and margins (thanks to Andrés Necochea)
 - Added convenience R function rk.list() to allow simplification of plugin code		# TODO: ideally, this should be used in all applicable plugins
 - Added stack-based window switching using Ctrl+(Shift)+Tab; this replaces the old "Next Window" and "Previous Window" actions
 - Fixed: Graphics device windows would disappear when trying to attach them to the main window with some versions of Qt

Modified: trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkcommands.R
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkcommands.R	2011-04-27 18:09:23 UTC (rev 3533)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkcommands.R	2011-04-27 18:23:48 UTC (rev 3534)
@@ -1,40 +1,85 @@
 local({
 ## Prepare
 ## Compute
-x <- warpbreaks[["tension"]]
-yvars <- list (substitute (warpbreaks[["wool"]]), substitute (warpbreaks[["tension"]]))
+x <- rk.list (warpbreaks[["tension"]])
+yvars <- rk.list (warpbreaks[["wool"]], warpbreaks[["tension"]])
 results <- list()
-descriptions <- list ()
+chisquares <- list ()
 
 # calculate crosstabs
 for (i in 1:length (yvars)) {
-	yvar <- eval (yvars[[i]], envir=globalenv ())
-	results[[i]] <- table(x, yvar)
+	count <- table(x[[1]], yvars[[i]])
+	chisquares[[i]] <- chisq.test (count, simulate.p.value = FALSE)
+	results[[i]] <- count
+}
+## Print result
+rk.header ("Crosstabs (n to 1)", level=1)
+for (i in 1:length (results)) {
+	rk.header ("Crosstabs (n to 1)", parameters=list ("Dependent", names (x)[1], "Independent", names (yvars)[i]), level=2)
+	rk.results (results[[i]], titles=c(names (x)[1], names (yvars)[i]))
 
-	descriptions[[i]] <- list ('Dependent'=rk.get.description (warpbreaks[["tension"]]), 'Independent'=rk.get.description (yvars[[i]], is.substitute=TRUE))
+	rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Dependent", names (x)[1], "Independent", names (yvars)[i], "Method", chisquares[[i]][["method"]]), level=2)
+	rk.results (list ('Statistic'=chisquares[[i]][['statistic']], 'df'=chisquares[[i]][['parameter']], 'p'=chisquares[[i]][['p.value']]))
+
+	rk.header ("Barplot for Crosstabs", list ("Dependent", names (x)[1], "Independent", names (yvars)[i], "colors", "default", "Type", "juxtaposed", "Legend", "FALSE"), level=2)
+	rk.graph.on ()
+	try ({
+		counts <- results[[i]]
+		barplot(counts, beside=TRUE)
+	})
+	rk.graph.off ()
 }
+})
+.rk.rerun.plugin.link(plugin="rkward::crosstab", settings="barplot.state=TRUE\nbarplot_embed.colors.string=default\nbarplot_embed.labels.state=0\nbarplot_embed.legend.state=0\nbarplot_embed.plotoptions.add_grid.state=0\nbarplot_embed.plotoptions.asp.real=0.00\nbarplot_embed.plotoptions.main.text=\nbarplot_embed.plotoptions.pointcolor.color.string=\nbarplot_embed.plotoptions.pointtype.string=\nbarplot_embed.plotoptions.sub.text=\nbarplot_embed.plotoptions.xaxt.state=\nbarplot_embed.plotoptions.xlab.text=\nbarplot_embed.plotoptions.xlog.state=\nbarplot_embed.plotoptions.xmaxvalue.text=\nbarplot_embed.plotoptions.xminvalue.text=\nbarplot_embed.plotoptions.yaxt.state=\nbarplot_embed.plotoptions.ylab.text=\nbarplot_embed.plotoptions.ylog.state=\nbarplot_embed.plotoptions.ymaxvalue.text=\nbarplot_embed.plotoptions.yminvalue.text=\nbarplot_embed.type.string=juxtaposed\nchisq.state=TRUE\nchisq_expected.state=FALSE\nmargins.state=FALSE\nprop_column.state=FALSE\nprop_row.state=FALSE\nprop_total.state=FALSE\nsimpv.string=FALSE\nx.available=warpbreaks[[\\\"tension\\\"]]\ny.available=warpbreaks[[\\\"wool\\\"]]\\nwarpbreaks[[\\\"tension\\\"]]", label="Run again")
+.rk.make.hr()
+local({
+## Prepare
+# convenience function to bind together several two dimensional tables into a single three dimensional table
+bind.tables <- function (...) {
+	tables <- list (...)
+	output <- unlist (tables)
+	dim (output) <- c (dim (tables[[1]]), length (tables))
+	dimnames (output) <- c (dimnames (tables[[1]]), list (statistic=names(tables)))
+	output
+}
+## Compute
+x <- rk.list (warpbreaks[["tension"]])
+yvars <- rk.list (warpbreaks[["wool"]], warpbreaks[["tension"]])
+results <- list()
+chisquares <- list ()
 
-# calculate chisquares
-chisquares <- list ()
-for (i in 1:length (results)) {
-	chisquares[[i]] <- chisq.test (results[[i]], simulate.p.value = FALSE)
+# calculate crosstabs
+for (i in 1:length (yvars)) {
+	count <- table(x[[1]], yvars[[i]])
+	chisquares[[i]] <- chisq.test (count, simulate.p.value = FALSE)
+	results[[i]] <- bind.tables ("count"=addmargins (count),
+		"% of row"=addmargins (prop.table(count, 1) * 100, quiet=TRUE, FUN=function(x) NA),
+		"% of column"=addmargins (prop.table(count, 2) * 100, quiet=TRUE, FUN=function(x) NA),
+		"% of total"=addmargins (prop.table(count) * 100),
+		"expected"=addmargins (chisquares[[i]]$expected, quiet=TRUE, FUN=function(x) NA))
 }
 ## Print result
 rk.header ("Crosstabs (n to 1)", level=1)
 for (i in 1:length (results)) {
-	rk.header ("Crosstabs (n to 1)", parameters=list ("Dependent", descriptions[[i]][['Dependent']], "Independent", descriptions[[i]][['Independent']]), level=2)
-	rk.results (results[[i]], titles=c(descriptions[[i]][['Dependent']], descriptions[[i]][['Independent']]))
+	rk.header ("Crosstabs (n to 1)", parameters=list ("Dependent", names (x)[1], "Independent", names (yvars)[i]), level=2)
+	rk.print (ftable (results[[i]], col.vars=2))
 
-	rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Dependent", descriptions[[i]][['Dependent']], "Independent", descriptions[[i]][['Independent']], "Method", chisquares[[i]][["method"]]), level=2)
+	rk.header ("Pearson's Chi Square Test for Crosstabs", list ("Dependent", names (x)[1], "Independent", names (yvars)[i], "Method", chisquares[[i]][["method"]]), level=2)
 	rk.results (list ('Statistic'=chisquares[[i]][['statistic']], 'df'=chisquares[[i]][['parameter']], 'p'=chisquares[[i]][['p.value']]))
 
-	rk.header ("Barplot for Crosstabs", list ("Dependent", descriptions[[i]][['Dependent']], "Independent", descriptions[[i]][['Independent']], "colors", "default", "Type", "juxtaposed", "Legend", "FALSE"), level=2)
+	rk.header ("Barplot for Crosstabs", list ("Dependent", names (x)[1], "Independent", names (yvars)[i], "colors", "rainbow", "Type", "juxtaposed", "Legend", "FALSE"), level=2)
 	rk.graph.on ()
 	try ({
-		barplot(results[[i]], beside=TRUE)
+		counts <- results[[i]][, , "count"]
+		# adjust the range so that the labels will fit
+		yrange <- range (counts, na.rm=TRUE) * 1.2
+		if (yrange[1] > 0) yrange[1] <- 0
+		if (yrange[2] < 0) yrange[2] <- 0
+		bplot <- barplot(counts, col=rainbow (if(is.matrix(counts)) dim(counts) else length(counts)), beside=TRUE, ylim = yrange)
+		text (bplot,counts, labels=counts, pos=3, offset=.5)
 	})
 	rk.graph.off ()
 }
 })
-.rk.rerun.plugin.link(plugin="rkward::crosstab", settings="barplot.state=TRUE\nbarplot_embed.colors.string=default\nbarplot_embed.labels.state=0\nbarplot_embed.legend.state=0\nbarplot_embed.plotoptions.add_grid.state=0\nbarplot_embed.plotoptions.asp.real=0.00\nbarplot_embed.plotoptions.main.text=\nbarplot_embed.plotoptions.pointcolor.color.string=\nbarplot_embed.plotoptions.pointtype.string=\nbarplot_embed.plotoptions.sub.text=\nbarplot_embed.plotoptions.xaxt.state=\nbarplot_embed.plotoptions.xlab.text=\nbarplot_embed.plotoptions.xlog.state=\nbarplot_embed.plotoptions.xmaxvalue.text=\nbarplot_embed.plotoptions.xminvalue.text=\nbarplot_embed.plotoptions.yaxt.state=\nbarplot_embed.plotoptions.ylab.text=\nbarplot_embed.plotoptions.ylog.state=\nbarplot_embed.plotoptions.ymaxvalue.text=\nbarplot_embed.plotoptions.yminvalue.text=\nbarplot_embed.type.string=juxtaposed\nchisq.state=TRUE\nsimpv.string=FALSE\nx.available=warpbreaks[[\\\"tension\\\"]]\ny.available=warpbreaks[[\\\"wool\\\"]]\\nwarpbreaks[[\\\"tension\\\"]]", label="Run again")
+.rk.rerun.plugin.link(plugin="rkward::crosstab", settings="barplot.state=TRUE\nbarplot_embed.colors.string=rainbow\nbarplot_embed.labels.state=1\nbarplot_embed.legend.state=0\nbarplot_embed.place.string=3\nbarplot_embed.plotoptions.add_grid.state=0\nbarplot_embed.plotoptions.asp.real=0.00\nbarplot_embed.plotoptions.main.text=\nbarplot_embed.plotoptions.pointcolor.color.string=\nbarplot_embed.plotoptions.pointtype.string=\nbarplot_embed.plotoptions.sub.text=\nbarplot_embed.plotoptions.xaxt.state=\nbarplot_embed.plotoptions.xlab.text=\nbarplot_embed.plotoptions.xlog.state=\nbarplot_embed.plotoptions.xmaxvalue.text=\nbarplot_embed.plotoptions.xminvalue.text=\nbarplot_embed.plotoptions.yaxt.state=\nbarplot_embed.plotoptions.ylab.text=\nbarplot_embed.plotoptions.ylog.state=\nbarplot_embed.plotoptions.ymaxvalue.text=\nbarplot_embed.plotoptions.yminvalue.text=\nbarplot_embed.type.string=juxtaposed\nchisq.state=TRUE\nchisq_expected.state=TRUE\nmargins.state=TRUE\nprop_column.state=TRUE\nprop_row.state=TRUE\nprop_total.state=TRUE\nsimpv.string=FALSE\nx.available=warpbreaks[[\\\"tension\\\"]]\ny.available=warpbreaks[[\\\"wool\\\"]]\\nwarpbreaks[[\\\"tension\\\"]]", label="Run again")
 .rk.make.hr()

Modified: trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkout
===================================================================
--- trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkout	2011-04-27 18:09:23 UTC (rev 3533)
+++ trunk/rkward/tests/analysis_plugins/RKTestStandard.crosstab_n_to_1.rkout	2011-04-27 18:23:48 UTC (rev 3534)
@@ -66,3 +66,411 @@
 </ul>
 <br>
 <img src="graph.png" width="480" height="480"><br>
+<h1>Crosstabs (n to 1)</h1>
+DATE<br>
+<h2>Crosstabs (n to 1)</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: wool</li>
+</ul>
+<br>
+
+
+<p align= center >
+<table cellspacing=0 border=1><caption align=bottom class=captiondataframe></caption>
+<tr><td>
+	<table border=0 class=dataframe>
+	<tbody> 
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>      A    </td>
+<td class=cellinside>      B    </td>
+<td class=cellinside>    Sum    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>statistic  </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td></tr>
+ 
+<td class=cellinside>L          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>M          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>H          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 16.667    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>  9.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>Sum        </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 27.000    </td>
+<td class=cellinside> 27.000    </td>
+<td class=cellinside> 54.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside> 50.000    </td>
+<td class=cellinside>100.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+	</tbody>
+</table>
+ </td></table>
+ <br>
+<h2>Pearson's Chi Square Test for Crosstabs</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: wool</li>
+<li>Method: Pearson's Chi-squared test</li>
+</ul>
+<br>
+<table border="1">
+<tr><td>Statistic</td><td>df</td><td>p</td></tr>
+<tr><td>0</td><td>2</td><td>1</td></tr>
+</table>
+<h2>Barplot for Crosstabs</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: wool</li>
+<li>colors: rainbow</li>
+<li>Type: juxtaposed</li>
+<li>Legend: FALSE</li>
+</ul>
+<br>
+<img src="graph.png" width="480" height="480"><br>
+<h2>Crosstabs (n to 1)</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: tension</li>
+</ul>
+<br>
+
+
+<p align= center >
+<table cellspacing=0 border=1><caption align=bottom class=captiondataframe></caption>
+<tr><td>
+	<table border=0 class=dataframe>
+	<tbody> 
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>      L    </td>
+<td class=cellinside>      M    </td>
+<td class=cellinside>      H    </td>
+<td class=cellinside>    Sum    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>statistic  </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td>
+<td class=cellinside>           </td></tr>
+ 
+<td class=cellinside>L          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>M          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>H          </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside> 18.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>100.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside>  0.000    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>  6.000    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>Sum        </td>
+<td class=cellinside>count      </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside> 18.000    </td>
+<td class=cellinside> 54.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of row   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of column</td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>% of total </td>
+<td class=cellinside>           </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside> 33.333    </td>
+<td class=cellinside>100.000    </td></tr>
+ 
+<td class=cellinside>           </td>
+<td class=cellinside>expected   </td>
+<td class=cellinside>           </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td>
+<td class=cellinside>     NA    </td></tr>
+ 
+	</tbody>
+</table>
+ </td></table>
+ <br>
+<h2>Pearson's Chi Square Test for Crosstabs</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: tension</li>
+<li>Method: Pearson's Chi-squared test</li>
+</ul>
+<br>
+<table border="1">
+<tr><td>Statistic</td><td>df</td><td>p</td></tr>
+<tr><td>108</td><td>4</td><td>1.9429e-22</td></tr>
+</table>
+<h2>Barplot for Crosstabs</h2>
+<h3>Parameters</h3>
+<ul><li>Dependent: tension</li>
+<li>Independent: tension</li>
+<li>colors: rainbow</li>
+<li>Type: juxtaposed</li>
+<li>Legend: FALSE</li>
+</ul>
+<br>
+<img src="graph.png" width="480" height="480"><br>

Modified: trunk/rkward/tests/analysis_plugins.R
===================================================================
--- trunk/rkward/tests/analysis_plugins.R	2011-04-27 18:09:23 UTC (rev 3533)
+++ trunk/rkward/tests/analysis_plugins.R	2011-04-27 18:23:48 UTC (rev 3534)
@@ -120,6 +120,8 @@
 		}),
 		new ("RKTest", id="crosstab_n_to_1", call=function () {
 			rk.call.plugin ("rkward::crosstab", barplot.state="TRUE", barplot_embed.colors.string="default", barplot_embed.labels.state="0", barplot_embed.legend.state="0", barplot_embed.plotoptions.add_grid.state="0", barplot_embed.plotoptions.asp.real="0.00", barplot_embed.plotoptions.main.text="", barplot_embed.plotoptions.pointcolor.color.string="", barplot_embed.plotoptions.pointtype.string="", barplot_embed.plotoptions.sub.text="", barplot_embed.plotoptions.xaxt.state="", barplot_embed.plotoptions.xlab.text="", barplot_embed.plotoptions.xlog.state="", barplot_embed.plotoptions.xmaxvalue.text="", barplot_embed.plotoptions.xminvalue.text="", barplot_embed.plotoptions.yaxt.state="", barplot_embed.plotoptions.ylab.text="", barplot_embed.plotoptions.ylog.state="", barplot_embed.plotoptions.ymaxvalue.text="", barplot_embed.plotoptions.yminvalue.text="", barplot_embed.type.string="juxtaposed", chisq.state="TRUE", simpv.string="FALSE", x.available="warpbreaks[[\"tension\"]]", y.available="warpbreaks[[\"wool\"]]\nwarpbreaks[[\"tension\"]]", submit.mode="submit")
+
+			rk.call.plugin ("rkward::crosstab", barplot.state="TRUE", barplot_embed.colors.string="rainbow", barplot_embed.labels.state="1", barplot_embed.legend.state="0", barplot_embed.place.string="3", barplot_embed.plotoptions.add_grid.state="0", barplot_embed.plotoptions.asp.real="0.00", barplot_embed.plotoptions.main.text="", barplot_embed.plotoptions.pointcolor.color.string="", barplot_embed.plotoptions.pointtype.string="", barplot_embed.plotoptions.sub.text="", barplot_embed.plotoptions.xaxt.state="", barplot_embed.plotoptions.xlab.text="", barplot_embed.plotoptions.xlog.state="", barplot_embed.plotoptions.xmaxvalue.text="", barplot_embed.plotoptions.xminvalue.text="", barplot_embed.plotoptions.yaxt.state="", barplot_embed.plotoptions.ylab.text="", barplot_embed.plotoptions.ylog.state="", barplot_embed.plotoptions.ymaxvalue.text="", barplot_embed.plotoptions.yminvalue.text="", barplot_embed.type.string="juxtaposed", chisq.state="TRUE", chisq_expected.state="TRUE", margins.state="TRUE", prop_column.state="TRUE", prop_row.state="TRUE", prop_total.state="TRUE", simpv.string="FALSE", x.available="warpbreaks[[\"tension\"]]", y.available="warpbreaks[[\"wool\"]]\nwarpbreaks[[\"tension\"]]", submit.mode="submit")
 		}),
 		new ("RKTest", id="crosstab_multi", call=function () {
 			rk.call.plugin ("rkward::crosstab_multi", exclude_nas.state="1", x.available="test_table[[\"A\"]]\ntest_table[[\"B\"]]\ntest_table[[\"C\"]]\ntest_table[[\"D\"]]", 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