R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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(14 + ,12 + ,18 + ,11 + ,11 + ,14 + ,12 + ,12 + ,16 + ,21 + ,18 + ,12 + ,14 + ,22 + ,14 + ,11 + ,15 + ,10 + ,15 + ,13 + ,17 + ,10 + ,19 + ,8 + ,10 + ,15 + ,16 + ,14 + ,18 + ,10 + ,14 + ,14 + ,14 + ,14 + ,17 + ,11 + ,14 + ,10 + ,16 + ,13 + ,18 + ,7 + ,11 + ,14 + ,14 + ,12 + ,12 + ,14 + ,17 + ,11 + ,9 + ,9 + ,16 + ,11 + ,14 + ,15 + ,15 + ,14 + ,11 + ,13 + ,16 + ,9 + ,13 + ,15 + ,17 + ,10 + ,15 + ,11 + ,14 + ,13 + ,16 + ,8 + ,9 + ,20 + ,15 + ,12 + ,17 + ,10 + ,13 + ,10 + ,15 + ,9 + ,16 + ,14 + ,16 + ,8 + ,12 + ,14 + ,12 + ,11 + ,11 + ,13 + ,15 + ,9 + ,15 + ,11 + ,17 + ,15 + ,13 + ,11 + ,16 + ,10 + ,14 + ,14 + ,11 + ,18 + ,12 + ,14 + ,12 + ,11 + ,15 + ,12 + ,16 + ,13 + ,15 + ,9 + ,12 + ,10 + ,12 + ,15 + ,8 + ,20 + ,13 + ,12 + ,11 + ,12 + ,14 + ,14 + ,15 + ,13 + ,10 + ,11 + ,11 + ,17 + ,12 + ,12 + ,15 + ,13 + ,15 + ,14 + ,14 + ,13 + ,16 + ,15 + ,15 + ,13 + ,15 + ,10 + ,13 + ,11 + ,12 + ,19 + ,17 + ,13 + ,13 + ,17 + ,15 + ,13 + ,13 + ,9 + ,15 + ,11 + ,16 + ,10 + ,15 + ,9 + ,16 + ,12 + ,15 + ,12 + ,14 + ,13 + ,15 + ,13 + ,14 + ,12 + ,13 + ,15 + ,7 + ,22 + ,17 + ,13 + ,13 + ,15 + ,15 + ,13 + ,14 + ,15 + ,13 + ,10 + ,16 + ,11 + ,12 + ,16 + ,14 + ,11 + ,17 + ,11 + ,15 + ,10 + ,17 + ,10 + ,12 + ,16 + ,16 + ,12 + ,11 + ,11 + ,15 + ,16 + ,9 + ,19 + ,16 + ,11 + ,15 + ,16 + ,10 + ,15 + ,10 + ,24 + ,15 + ,14 + ,11 + ,15 + ,13 + ,11 + ,14 + ,15 + ,18 + ,12 + ,16 + ,10 + ,14 + ,14 + ,14 + ,13 + ,14 + ,9 + ,14 + ,15 + ,12 + ,15 + ,14 + ,14 + ,15 + ,11 + ,15 + ,8 + ,15 + ,11 + ,13 + ,11 + ,17 + ,8 + ,17 + ,10 + ,19 + ,11 + ,15 + ,13 + ,13 + ,11 + ,9 + ,20 + ,15 + ,10 + ,15 + ,15 + ,15 + ,12 + ,16 + ,14 + ,11 + ,23 + ,14 + ,14 + ,11 + ,16 + ,15 + ,11 + ,13 + ,12 + ,15 + ,10 + ,16 + ,14 + ,14 + ,12 + ,15 + ,12 + ,16 + ,11 + ,16 + ,12 + ,11 + ,13 + ,12 + ,11 + ,9 + ,19 + ,16 + ,12 + ,13 + ,17 + ,16 + ,9 + ,12 + ,12 + ,9 + ,19 + ,13 + ,18 + ,13 + ,15 + ,14 + ,14 + ,19 + ,11 + ,13 + ,9 + ,12 + ,18 + ,13 + ,16) + ,dim=c(2 + ,162) + ,dimnames=list(c('Hapiness' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(2,162),dimnames=list(c('Hapiness','Depression'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Pearson Chi-Squared' > par2 = 'Y' > par1 = 'X' > main = 'Association Plot' > par3 <- 'Pearson Chi-Squared' > par2 <- 'Y' > par1 <- 'X' > #'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) # Warning message: NAs introduced by coercion > cat2<- as.numeric(par2) # Warning message: NAs introduced by coercion > 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,] 14 12 [2,] 18 11 [3,] 11 14 [4,] 12 12 [5,] 16 21 [6,] 18 12 [7,] 14 22 [8,] 14 11 [9,] 15 10 [10,] 15 13 [11,] 17 10 [12,] 19 8 [13,] 10 15 [14,] 16 14 [15,] 18 10 [16,] 14 14 [17,] 14 14 [18,] 17 11 [19,] 14 10 [20,] 16 13 [21,] 18 7 [22,] 11 14 [23,] 14 12 [24,] 12 14 [25,] 17 11 [26,] 9 9 [27,] 16 11 [28,] 14 15 [29,] 15 14 [30,] 11 13 [31,] 16 9 [32,] 13 15 [33,] 17 10 [34,] 15 11 [35,] 14 13 [36,] 16 8 [37,] 9 20 [38,] 15 12 [39,] 17 10 [40,] 13 10 [41,] 15 9 [42,] 16 14 [43,] 16 8 [44,] 12 14 [45,] 12 11 [46,] 11 13 [47,] 15 9 [48,] 15 11 [49,] 17 15 [50,] 13 11 [51,] 16 10 [52,] 14 14 [53,] 11 18 [54,] 12 14 [55,] 12 11 [56,] 15 12 [57,] 16 13 [58,] 15 9 [59,] 12 10 [60,] 12 15 [61,] 8 20 [62,] 13 12 [63,] 11 12 [64,] 14 14 [65,] 15 13 [66,] 10 11 [67,] 11 17 [68,] 12 12 [69,] 15 13 [70,] 15 14 [71,] 14 13 [72,] 16 15 [73,] 15 13 [74,] 15 10 [75,] 13 11 [76,] 12 19 [77,] 17 13 [78,] 13 17 [79,] 15 13 [80,] 13 9 [81,] 15 11 [82,] 16 10 [83,] 15 9 [84,] 16 12 [85,] 15 12 [86,] 14 13 [87,] 15 13 [88,] 14 12 [89,] 13 15 [90,] 7 22 [91,] 17 13 [92,] 13 15 [93,] 15 13 [94,] 14 15 [95,] 13 10 [96,] 16 11 [97,] 12 16 [98,] 14 11 [99,] 17 11 [100,] 15 10 [101,] 17 10 [102,] 12 16 [103,] 16 12 [104,] 11 11 [105,] 15 16 [106,] 9 19 [107,] 16 11 [108,] 15 16 [109,] 10 15 [110,] 10 24 [111,] 15 14 [112,] 11 15 [113,] 13 11 [114,] 14 15 [115,] 18 12 [116,] 16 10 [117,] 14 14 [118,] 14 13 [119,] 14 9 [120,] 14 15 [121,] 12 15 [122,] 14 14 [123,] 15 11 [124,] 15 8 [125,] 15 11 [126,] 13 11 [127,] 17 8 [128,] 17 10 [129,] 19 11 [130,] 15 13 [131,] 13 11 [132,] 9 20 [133,] 15 10 [134,] 15 15 [135,] 15 12 [136,] 16 14 [137,] 11 23 [138,] 14 14 [139,] 11 16 [140,] 15 11 [141,] 13 12 [142,] 15 10 [143,] 16 14 [144,] 14 12 [145,] 15 12 [146,] 16 11 [147,] 16 12 [148,] 11 13 [149,] 12 11 [150,] 9 19 [151,] 16 12 [152,] 13 17 [153,] 16 9 [154,] 12 12 [155,] 9 19 [156,] 13 18 [157,] 13 15 [158,] 14 14 [159,] 19 11 [160,] 13 9 [161,] 12 18 [162,] 13 16 > (table1 <- table(z[,cat1],z[,cat2])) <0 x 0 matrix> > (V1<-dimnames(y)[[1]][cat1]) [1] NA > (V2<-dimnames(y)[[1]][cat2]) [1] NA > postscript(file="/var/fisher/rcomp/tmp/19p3v1350827761.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) Error in loglin(x, expected, fit = TRUE, print = FALSE) : incorrect specification of 'table' or 'start' Calls: assoc -> assoc.default -> strucplot -> loglin Execution halted