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(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('Happiness' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(2,162),dimnames=list(c('Happiness','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]) + } + } > par1 = 'grey' > ylab = 'value' > xlab = 'variables' > main = 'Notched Boxplots Happiness & Depression' > par1 <- 'grey' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Notched Boxplots (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_notchedbox1.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > z <- as.data.frame(t(y)) > postscript(file="/var/wessaorg/rcomp/tmp/1973f1354698443.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > (r<-boxplot(z ,xlab=xlab,ylab=ylab,main=main,notch=TRUE,col=par1)) $stats [,1] [,2] [1,] 9 7 [2,] 13 11 [3,] 14 12 [4,] 16 14 [5,] 19 18 $n [1] 162 162 $conf [,1] [,2] [1,] 13.62759 11.62759 [2,] 14.37241 12.37241 $out [1] 8 7 21 22 20 20 19 22 19 24 20 23 19 19 $group [1] 1 1 2 2 2 2 2 2 2 2 2 2 2 2 $names [1] "Happiness" "Depression" > 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,hyperlink('http://www.xycoon.com/overview.htm','Boxplot statistics','Boxplot overview'),6,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/lower_whisker.htm','lower whisker','definition of lower whisker'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/lower_hinge.htm','lower hinge','definition of lower hinge'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/central_tendency.htm','median','definitions about measures of central tendency'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/upper_hinge.htm','upper hinge','definition of upper hinge'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/upper_whisker.htm','upper whisker','definition of upper whisker'),1,TRUE) > a<-table.row.end(a) > for (i in 1:length(y[,1])) + { + a<-table.row.start(a) + a<-table.element(a,dimnames(t(x))[[2]][i],1,TRUE) + for (j in 1:5) + { + a<-table.element(a,r$stats[j,i]) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2s4wj1354698443.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Boxplot Notches',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',1,TRUE) > a<-table.element(a,'lower bound',1,TRUE) > a<-table.element(a,'median',1,TRUE) > a<-table.element(a,'upper bound',1,TRUE) > a<-table.row.end(a) > for (i in 1:length(y[,1])) + { + a<-table.row.start(a) + a<-table.element(a,dimnames(t(x))[[2]][i],1,TRUE) + a<-table.element(a,r$conf[1,i]) + a<-table.element(a,r$stats[3,i]) + a<-table.element(a,r$conf[2,i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3ta6q1354698443.tab") > > try(system("convert tmp/1973f1354698443.ps tmp/1973f1354698443.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.883 0.194 1.078