R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list('NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'UsedStats' + ,'Good' + ,'UsedStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Bad' + ,'NoStats' + ,'Good' + ,'NoStats' + ,'Good' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Bad' + ,'UsedStats' + ,'Bad') + ,dim=c(2 + ,154) + ,dimnames=list(c('Used' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(2,154),dimnames=list(c('Used','Outcome'),1:154)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 50 or more warnings (use warnings() to see the first 50) > par3 = 'Pearson Chi-Squared' > par2 = '2' > par1 = '1' > main = 'Association Plot' > par3 <- 'Pearson Chi-Squared' > par2 <- '2' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > library(vcd) Loading required package: MASS Loading required package: grid Loading required package: colorspace > cat1 <- as.numeric(par1) # > cat2<- as.numeric(par2) # > simulate.p.value=FALSE > if (par3 == 'Exact Pearson Chi-Squared by Simulation') simulate.p.value=TRUE > x <- t(x) > (z <- array(unlist(x),dim=c(length(x[,1]),length(x[1,])))) [,1] [,2] [1,] "NoStats" "Good" [2,] "NoStats" "Bad" [3,] "NoStats" "Bad" [4,] "NoStats" "Bad" [5,] "NoStats" "Bad" [6,] "NoStats" "Good" [7,] "NoStats" "Bad" [8,] "NoStats" "Bad" [9,] "NoStats" "Good" [10,] "NoStats" "Bad" [11,] "NoStats" "Bad" [12,] "NoStats" "Bad" [13,] "UsedStats" "Bad" [14,] "NoStats" "Bad" [15,] "UsedStats" "Good" [16,] "UsedStats" "Good" [17,] "UsedStats" "Bad" [18,] "NoStats" "Bad" [19,] "NoStats" "Good" [20,] "UsedStats" "Good" [21,] "NoStats" "Bad" [22,] "UsedStats" "Good" [23,] "NoStats" "Good" [24,] "NoStats" "Good" [25,] "UsedStats" "Good" [26,] "UsedStats" "Bad" [27,] "NoStats" "Good" [28,] "UsedStats" "Bad" [29,] "NoStats" "Good" [30,] "NoStats" "Bad" [31,] "NoStats" "Bad" [32,] "NoStats" "Bad" [33,] "NoStats" "Bad" [34,] "NoStats" "Good" [35,] "NoStats" "Bad" [36,] "NoStats" "Bad" [37,] "UsedStats" "Bad" [38,] "UsedStats" "Good" [39,] "NoStats" "Good" [40,] "NoStats" "Bad" [41,] "UsedStats" "Good" [42,] "UsedStats" "Good" [43,] "NoStats" "Good" [44,] "NoStats" "Bad" [45,] "NoStats" "Bad" [46,] "NoStats" "Good" [47,] "NoStats" "Bad" [48,] "NoStats" "Good" [49,] "NoStats" "Good" [50,] "NoStats" "Bad" [51,] "UsedStats" "Bad" [52,] "UsedStats" "Bad" [53,] "NoStats" "Good" [54,] "UsedStats" "Bad" [55,] "NoStats" "Bad" [56,] "UsedStats" "Good" [57,] "UsedStats" "Good" [58,] "NoStats" "Good" [59,] "NoStats" "Good" [60,] "UsedStats" "Good" [61,] "NoStats" "Good" [62,] "UsedStats" "Bad" [63,] "NoStats" "Bad" [64,] "NoStats" "Good" [65,] "NoStats" "Bad" [66,] "NoStats" "Bad" [67,] "UsedStats" "Bad" [68,] "NoStats" "Bad" [69,] "NoStats" "Good" [70,] "UsedStats" "Bad" [71,] "NoStats" "Bad" [72,] "NoStats" "Good" [73,] "UsedStats" "Good" [74,] "UsedStats" "Bad" [75,] "NoStats" "Good" [76,] "NoStats" "Good" [77,] "NoStats" "Good" [78,] "UsedStats" "Good" [79,] "UsedStats" "Good" [80,] "NoStats" "Bad" [81,] "NoStats" "Bad" [82,] "UsedStats" "Good" [83,] "NoStats" "Bad" [84,] "UsedStats" "Bad" [85,] "NoStats" "Good" [86,] "NoStats" "Bad" [87,] "NoStats" "Good" [88,] "UsedStats" "Good" [89,] "NoStats" "Bad" [90,] "NoStats" "Good" [91,] "NoStats" "Bad" [92,] "NoStats" "Bad" [93,] "NoStats" "Bad" [94,] "NoStats" "Bad" [95,] "NoStats" "Bad" [96,] "NoStats" "Good" [97,] "NoStats" "Bad" [98,] "NoStats" "Bad" [99,] "NoStats" "Bad" [100,] "NoStats" "Good" [101,] "NoStats" "Good" [102,] "NoStats" "Bad" [103,] "NoStats" "Bad" [104,] "NoStats" "Bad" [105,] "UsedStats" "Bad" [106,] "NoStats" "Bad" [107,] "NoStats" "Bad" [108,] "UsedStats" "Bad" [109,] "NoStats" "Bad" [110,] "NoStats" "Bad" [111,] "UsedStats" "Bad" [112,] "NoStats" "Bad" [113,] "UsedStats" "Bad" [114,] "UsedStats" "Bad" [115,] "NoStats" "Bad" [116,] "NoStats" "Bad" [117,] "NoStats" "Good" [118,] "NoStats" "Bad" [119,] "NoStats" "Bad" [120,] "NoStats" "Good" [121,] "NoStats" "Bad" [122,] "NoStats" "Bad" [123,] "UsedStats" "Bad" [124,] "UsedStats" "Good" [125,] "NoStats" "Good" [126,] "NoStats" "Bad" [127,] "NoStats" "Bad" [128,] "NoStats" "Good" [129,] "NoStats" "Bad" [130,] "NoStats" "Good" [131,] "NoStats" "Bad" [132,] "NoStats" "Good" [133,] "UsedStats" "Bad" [134,] "NoStats" "Bad" [135,] "NoStats" "Bad" [136,] "NoStats" "Bad" [137,] "UsedStats" "Good" [138,] "UsedStats" "Good" [139,] "NoStats" "Bad" [140,] "NoStats" "Bad" [141,] "UsedStats" "Good" [142,] "UsedStats" "Good" [143,] "NoStats" "Bad" [144,] "NoStats" "Good" [145,] "NoStats" "Bad" [146,] "NoStats" "Good" [147,] "UsedStats" "Bad" [148,] "NoStats" "Bad" [149,] "NoStats" "Bad" [150,] "NoStats" "Good" [151,] "NoStats" "Good" [152,] "UsedStats" "Bad" [153,] "UsedStats" "Bad" [154,] "UsedStats" "Bad" > (table1 <- table(z[,cat1],z[,cat2])) Bad Good NoStats 69 40 UsedStats 24 21 > (V1<-dimnames(y)[[1]][cat1]) [1] "Used" > (V2<-dimnames(y)[[1]][cat2]) [1] "Outcome" > postscript(file="/var/wessaorg/rcomp/tmp/1095n1355752792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > assoc(ftable(z[,cat1],z[,cat2],row.vars=1,dnn=c(V1,V2)),shade=T) > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Tabulation of Results',ncol(table1)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,paste(V1,' x ', V2),ncol(table1)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, ' ', 1,TRUE) > for(nc in 1:ncol(table1)){ + a<-table.element(a, colnames(table1)[nc], 1, TRUE) + } > a<-table.row.end(a) > for(nr in 1:nrow(table1) ){ + a<-table.element(a, rownames(table1)[nr], 1, TRUE) + for(nc in 1:ncol(table1) ){ + a<-table.element(a, table1[nr, nc], 1, FALSE) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2a0p21355752792.tab") > (cst<-chisq.test(table1, simulate.p.value=simulate.p.value) ) Pearson's Chi-squared test with Yates' continuity correction data: table1 X-squared = 0.9394, df = 1, p-value = 0.3324 > if (par3 == 'McNemar Chi-Squared') { + (cst <- mcnemar.test(table1)) + } > if (par3=='Fisher Exact Test') { + (cst <- fisher.test(table1)) + } > if ((par3 != 'McNemar Chi-Squared') & (par3 != 'Fisher Exact Test')) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Tabulation of Expected Results',ncol(table1)+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,paste(V1,' x ', V2),ncol(table1)+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a, ' ', 1,TRUE) + for(nc in 1:ncol(table1)){ + a<-table.element(a, colnames(table1)[nc], 1, TRUE) + } + a<-table.row.end(a) + for(nr in 1:nrow(table1) ){ + a<-table.element(a, rownames(table1)[nr], 1, TRUE) + for(nc in 1:ncol(table1) ){ + a<-table.element(a, round(cst$expected[nr, nc], digits=2), 1, FALSE) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/36byy1355752792.tab") + } > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Statistical Results',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, cst$method, 2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > if (par3=='Pearson Chi-Squared') a<-table.element(a, 'Pearson Chi Square Statistic', 1, TRUE) > if (par3=='Exact Pearson Chi-Squared by Simulation') a<-table.element(a, 'Exact Pearson Chi Square Statistic', 1, TRUE) > if (par3=='McNemar Chi-Squared') a<-table.element(a, 'McNemar Chi Square Statistic', 1, TRUE) > if (par3=='Fisher Exact Test') a<-table.element(a, 'Odds Ratio', 1, TRUE) > if (par3=='Fisher Exact Test') { + if ((ncol(table1) == 2) & (nrow(table1) == 2)) { + a<-table.element(a, round(cst$estimate, digits=2), 1,FALSE) + } else { + a<-table.element(a, '--', 1,FALSE) + } + } else { + a<-table.element(a, round(cst$statistic, digits=2), 1,FALSE) + } > a<-table.row.end(a) > if(!simulate.p.value){ + if(par3!='Fisher Exact Test') { + a<-table.row.start(a) + a<-table.element(a, 'Degrees of Freedom', 1, TRUE) + a<-table.element(a, cst$parameter, 1,FALSE) + a<-table.row.end(a) + } + } > a<-table.row.start(a) > a<-table.element(a, 'P value', 1, TRUE) > a<-table.element(a, round(cst$p.value, digits=2), 1,FALSE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/480if1355752792.tab") > > try(system("convert tmp/1095n1355752792.ps tmp/1095n1355752792.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.624 0.220 1.824