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(4 + ,1 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,1 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,1 + ,0 + ,'NA' + ,0 + ,0 + ,1 + ,1 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,1 + ,4 + ,1 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,1 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,1 + ,0 + ,1 + ,0 + ,4 + ,1 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,'NA' + ,1 + ,0 + ,1 + ,1 + ,4 + ,0 + ,1 + ,'NA' + ,1 + ,0 + ,1 + ,1 + ,4 + ,1 + ,1 + ,'NA' + ,1 + ,1 + ,1 + ,0 + ,4 + ,1 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,4 + 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2 + ,0 + ,'NA' + ,0 + ,1 + ,1 + ,0 + ,1 + ,2 + ,0 + ,'NA' + ,1 + ,1 + ,0 + ,0 + ,1 + ,2 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,0 + ,2 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,1 + ,1 + ,2 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,1 + ,0 + ,2 + ,0 + ,'NA' + ,1 + ,0 + ,0 + ,0 + ,1 + ,2 + ,0 + ,'NA' + ,1 + ,1 + ,0 + ,0 + ,0 + ,2 + ,0 + ,'NA' + ,1 + ,0 + ,0 + ,0 + ,0 + ,2 + ,1 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,0 + ,2 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,1 + ,1 + ,2 + ,0 + ,'NA' + ,0 + ,0 + ,0 + ,0 + ,1 + ,2 + ,1 + ,'NA' + ,0 + ,1 + ,1 + ,0 + ,0 + ,2 + ,1 + ,'NA' + ,0 + ,1 + ,1 + ,1 + ,0 + ,2 + ,1 + ,'NA' + ,0 + ,1 + ,0 + ,0 + ,0) + ,dim=c(8 + ,154) + ,dimnames=list(c('Weeks' + ,'UseLimit' + ,'T40' + ,'T20' + ,'Used' + ,'CorrectAnalysis' + ,'Useful' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(8,154),dimnames=list(c('Weeks','UseLimit','T40','T20','Used','CorrectAnalysis','Useful','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 = 'Exact Pearson Chi-Squared by Simulation' > par2 = '6' > par1 = '4' > main = 'Association Plot' > 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] [,3] [,4] [,5] [,6] [,7] [,8] [1,] "4" "1" "1" "NA" "0" "0" "0" "1" [2,] "4" "0" "0" "NA" "0" "0" "0" "0" [3,] "4" "0" "0" "NA" "0" "0" "0" "0" [4,] "4" "0" "0" "NA" "0" "0" "0" "0" [5,] "4" "0" "0" "NA" "0" "0" "0" "0" [6,] "4" "1" "0" "NA" "0" "0" "1" "1" [7,] "4" "0" "0" "NA" "0" "0" "0" "0" [8,] "4" "0" "1" "NA" "0" "0" "0" "0" [9,] "4" "0" "0" "NA" "0" "0" "0" "1" [10,] "4" "1" "0" "NA" "0" "0" "0" "0" [11,] "4" "1" "1" "NA" "0" "0" "0" "0" [12,] "4" "0" "0" "NA" "0" "0" "0" "0" [13,] "4" "0" "0" "NA" "1" "0" "1" "0" [14,] "4" "1" "1" "NA" "0" "0" "0" "0" [15,] "4" "0" "0" "NA" "1" "0" "1" "1" [16,] "4" "0" "1" "NA" "1" "0" "1" "1" [17,] "4" "1" "1" "NA" "1" "1" "1" "0" [18,] "4" "1" "1" "NA" "0" "0" "0" "0" [19,] "4" "0" "0" "NA" "0" "0" "0" "1" [20,] "4" "0" "1" "NA" "1" "1" "1" "1" [21,] "4" "1" "0" "NA" "0" "0" "1" "0" [22,] "4" "1" "0" "NA" "1" "0" "1" "1" [23,] "4" "0" "0" "NA" "0" "0" "1" "1" [24,] "4" "1" "0" "NA" "0" "0" "1" "1" [25,] "4" "0" "1" "NA" "1" "0" "0" "1" [26,] "4" "0" "0" "NA" "1" "0" "1" "0" [27,] "4" "1" "0" "NA" "0" "0" "0" "1" [28,] "4" "0" "0" "NA" "1" "0" "0" "0" [29,] "4" "0" "0" "NA" "0" "0" "0" "1" [30,] "4" "0" "0" "NA" "0" "0" "1" "0" [31,] "4" "0" "0" "NA" "0" "0" "0" "0" [32,] "4" "1" "0" "NA" "0" "0" "0" "0" [33,] "4" "1" "0" "NA" "0" "0" "1" "0" [34,] "4" "0" "1" "NA" "0" "0" "0" "1" [35,] "4" "0" "0" "NA" "0" "0" "0" "0" [36,] "4" "0" "0" "NA" "0" "0" "0" "0" [37,] "4" "1" "1" "NA" "1" "0" "1" "0" [38,] "4" "0" "0" "NA" "1" "0" "0" "1" [39,] "4" "0" "0" "NA" "0" "0" "1" "1" [40,] "4" "0" "1" "NA" "0" "0" "1" "0" [41,] "4" "0" "0" "NA" "1" "1" "1" "1" [42,] "4" "0" "0" "NA" "1" "0" "0" "1" [43,] "4" "1" "0" "NA" "0" "0" "1" "1" [44,] "4" "1" "1" "NA" "0" "0" "0" "0" [45,] "4" "0" "0" "NA" "0" "0" "1" "0" [46,] "4" "0" "0" "NA" "0" "0" "1" "1" [47,] "4" "0" "0" "NA" "0" "0" "0" "0" [48,] "4" "0" "0" "NA" "0" "0" "0" "1" [49,] "4" "0" "0" "NA" "0" "0" "1" "1" [50,] "4" "0" "0" "NA" "0" "0" "0" "0" [51,] "4" "0" "1" "NA" "1" "0" "0" "0" [52,] "4" "1" "1" "NA" "1" "1" "1" "0" [53,] "4" "0" "0" "NA" "0" "0" "0" "1" [54,] "4" "0" "0" "NA" "1" "1" "0" "0" [55,] "4" "0" "0" "NA" "0" "0" "0" "0" [56,] "4" "0" "1" "NA" "1" "0" "0" "1" [57,] "4" "0" "0" "NA" "1" "0" "1" "1" [58,] "4" "0" "0" "NA" "0" "0" "0" "1" [59,] "4" "0" "0" "NA" "0" "0" "0" "1" [60,] "4" "1" "1" "NA" "1" "1" "1" "1" [61,] "4" "1" "1" "NA" "0" "0" "0" "1" [62,] "4" "0" "0" "NA" "1" "0" "1" "0" [63,] "4" "0" "0" "NA" "0" "0" "0" "0" [64,] "4" "1" "1" "NA" "0" "0" "0" "1" [65,] "4" "0" "0" "NA" "0" "0" "0" "0" [66,] "4" "0" "0" "NA" "0" "0" "0" "0" [67,] "4" "0" "1" "NA" "1" "1" "1" "0" [68,] "4" "1" "0" "NA" "0" "0" "0" "0" [69,] "4" "0" "0" "NA" "0" "0" "0" "1" [70,] "4" "0" "0" "NA" "1" "0" "0" "0" [71,] "4" "0" "0" "NA" "0" "0" "0" "0" [72,] "4" "0" "0" "NA" "0" "0" "0" "1" [73,] "4" "0" "0" "NA" "1" "0" "0" "1" [74,] "4" "1" "0" "NA" "1" "0" "0" "0" [75,] "4" "0" "0" "NA" "0" "0" "0" "1" [76,] "4" "0" "1" "NA" "0" "0" "1" "1" [77,] "4" "0" "0" "NA" "0" "0" "0" "1" [78,] "4" "0" "0" "NA" "1" "0" "1" "1" [79,] "4" "0" "1" "NA" "1" "1" "0" "1" [80,] "4" "0" "1" "NA" "0" "0" "1" "0" [81,] "4" "0" "0" "NA" "0" "0" "0" "0" [82,] "4" "1" "0" "NA" "1" "0" "0" "1" [83,] "4" "0" "0" "NA" "0" "0" "0" "0" [84,] "4" "0" "0" "NA" "1" "1" "0" "0" [85,] "4" "0" "0" "NA" "0" "0" "1" "1" [86,] "4" "1" "0" "NA" "0" "0" "0" "0" [87,] "2" "1" "NA" "0" "0" "0" "0" "1" [88,] "2" "1" "NA" "1" "1" "0" "0" "1" [89,] "2" "0" "NA" "0" "0" "0" "0" "0" [90,] "2" "0" "NA" "0" "0" "0" "0" "1" [91,] "2" "0" "NA" "0" "0" "0" "1" "0" [92,] "2" "1" "NA" "1" "0" "0" "0" "0" [93,] "2" "1" "NA" "0" "0" "0" "1" "0" [94,] "2" "0" "NA" "0" "0" "0" "0" "0" [95,] "2" "0" "NA" "1" "0" "0" "0" "0" [96,] "2" "0" "NA" "0" "0" "0" "0" "1" [97,] "2" "1" "NA" "1" "0" "0" "0" "0" [98,] "2" "0" "NA" "0" "0" "0" "0" "0" [99,] "2" "1" "NA" "0" "0" "0" "0" "0" [100,] "2" "0" "NA" "0" "0" "0" "0" "1" [101,] "2" "1" "NA" "0" "0" "0" "0" "1" [102,] "2" "0" "NA" "0" "0" "0" "0" "0" [103,] "2" "0" "NA" "0" "0" "0" "0" "0" [104,] "2" "0" "NA" "0" "0" "0" "0" "0" [105,] "2" "0" "NA" "1" "1" "0" "0" "0" [106,] "2" "0" "NA" "0" "0" "0" "0" "0" [107,] "2" "0" "NA" "0" "0" "0" "0" "0" [108,] "2" "1" "NA" "1" "1" "0" "0" "0" [109,] "2" "0" "NA" "0" "0" "0" "0" "0" [110,] "2" "1" "NA" "0" "0" "0" "0" "0" [111,] "2" "1" "NA" "1" "1" "0" "1" "0" [112,] "2" "0" "NA" "1" "0" "0" "0" "0" [113,] "2" "0" "NA" "0" "1" "0" "0" "0" [114,] "2" "1" "NA" "1" "1" "0" "0" "0" [115,] "2" "1" "NA" "0" "0" "0" "0" "0" [116,] "2" "0" "NA" "0" "0" "0" "0" "0" [117,] "2" "1" "NA" "0" "0" "0" "0" "1" [118,] "2" "1" "NA" "0" "0" "0" "0" "0" [119,] "2" "0" "NA" "0" "0" "0" "0" "0" [120,] "2" "0" "NA" "0" "0" "0" "0" "1" [121,] "2" "1" "NA" "0" "0" "0" "0" "0" [122,] "2" "0" "NA" "0" "0" "0" "0" "0" [123,] "2" "1" "NA" "1" "1" "0" "0" "0" [124,] "2" "0" "NA" "0" "1" "0" "1" "1" [125,] "2" "0" "NA" "0" "0" "0" "0" "1" [126,] "2" "0" "NA" "1" "0" "0" "0" "0" [127,] "2" "0" "NA" "0" "0" "0" "1" "0" [128,] "2" "0" "NA" "0" "0" "0" "0" "1" [129,] "2" "0" "NA" "0" "0" "0" "0" "0" [130,] "2" "0" "NA" "0" "0" "0" "0" "1" [131,] "2" "1" "NA" "0" "0" "0" "0" "0" [132,] "2" "1" "NA" "0" "0" "0" "0" "1" [133,] "2" "1" "NA" "0" "1" "0" "0" "0" [134,] "2" "0" "NA" "0" "0" "0" "0" "0" [135,] "2" "0" "NA" "0" "0" "0" "0" "0" [136,] "2" "0" "NA" "0" "0" "0" "0" "0" [137,] "2" "1" "NA" "0" "1" "0" "1" "1" [138,] "2" "1" "NA" "1" "1" "0" "1" "1" [139,] "2" "0" "NA" "1" "0" "0" "0" "0" [140,] "2" "0" "NA" "0" "0" "0" "0" "0" [141,] "2" "0" "NA" "0" "1" "1" "0" "1" [142,] "2" "0" "NA" "1" "1" "0" "0" "1" [143,] "2" "1" "NA" "0" "0" "0" "0" "0" [144,] "2" "0" "NA" "0" "0" "0" "1" "1" [145,] "2" "0" "NA" "0" "0" "0" "1" "0" [146,] "2" "0" "NA" "1" "0" "0" "0" "1" [147,] "2" "0" "NA" "1" "1" "0" "0" "0" [148,] "2" "0" "NA" "1" "0" "0" "0" "0" [149,] "2" "1" "NA" "0" "0" "0" "0" "0" [150,] "2" "0" "NA" "0" "0" "0" "1" "1" [151,] "2" "0" "NA" "0" "0" "0" "0" "1" [152,] "2" "1" "NA" "0" "1" "1" "0" "0" [153,] "2" "1" "NA" "0" "1" "1" "1" "0" [154,] "2" "1" "NA" "0" "1" "0" "0" "0" > (table1 <- table(z[,cat1],z[,cat2])) 0 1 0 48 3 1 17 0 NA 77 9 > (V1<-dimnames(y)[[1]][cat1]) [1] "T20" > (V2<-dimnames(y)[[1]][cat2]) [1] "CorrectAnalysis" > postscript(file="/var/fisher/rcomp/tmp/158me1356129029.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/2njcj1356129029.tab") > (cst<-chisq.test(table1, simulate.p.value=simulate.p.value) ) Pearson's Chi-squared test with simulated p-value (based on 2000 replicates) data: table1 X-squared = 2.5507, df = NA, p-value = 0.3353 > 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/fisher/rcomp/tmp/3425v1356129029.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/fisher/rcomp/tmp/43u9r1356129029.tab") > > try(system("convert tmp/158me1356129029.ps tmp/158me1356129029.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.925 0.365 2.273