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(7,0,109,13.1,68,32,258,183,137,7,1,112,12.9,65,19,449,245,134,8,0,124,14.1,64,22,441,268,147,8,1,125,16.2,67,41,234,146,124,8,0,127,21.5,93,52,202,131,104,9,0,130,17.5,68,44,308,155,118,11,1,139,30.7,89,28,305,179,119,12,1,150,28.4,69,18,369,198,103,12,0,146,25.1,67,24,312,194,128,13,1,155,31.5,68,23,413,225,136,13,0,156,39.9,89,39,206,142,95,14,1,153,42.1,90,26,253,191,121,14,0,160,45.6,93,45,174,139,108,15,1,158,51.2,93,45,158,124,90,16,1,160,35.9,66,31,302,133,101,17,1,153,34.8,70,29,204,118,120,17,0,174,44.7,70,49,187,104,103,17,1,176,60.1,92,29,188,129,130,17,0,171,42.6,69,38,172,130,103,19,1,156,37.2,72,21,216,119,81,19,0,174,54.6,86,37,184,118,101,20,0,178,64,86,34,225,148,135,23,0,180,73.8,97,57,171,108,98,23,0,175,51.1,71,33,224,131,113,23,0,179,71.5,95,52,225,127,101),dim=c(9,25),dimnames=list(c('age','sex','height','weight','bmp','fav1','rv','frc','tlc'),1:25)) > y <- array(NA,dim=c(9,25),dimnames=list(c('age','sex','height','weight','bmp','fav1','rv','frc','tlc'),1:25)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = '0' > par2 = 'TRUE' > par1 = '3' > ylab = 'Test Scores' > xlab = 'CARE Variable Names' > main = 'CARE DATA' > par3 <- '0' > par2 <- 'TRUE' > par1 <- '3' > par1 <- as.numeric(par1) #colour > par2<- as.logical(par2) # Notches ? > par3<-as.numeric(par3) # % trim > if(par3>45){par3<-45;warning('trim limited to 45%')} > if(par3<0){par3<-0;warning('negative trim makes no sense. Trim is zero.')} > lotrm<-as.integer(length(y[1,])*par3/100)+1 > hitrm<-as.integer(length(y[1,])*(100-par3)/100) > y1<-array(dim=c(dim(y)[1], hitrm-lotrm+1), dimnames=list(dimnames(y)[[1]], 1:(hitrm-lotrm+1) )) > for(i in 1:dim(y)[1]){ + tmp<-order(y[i,]) + y1[i,]<- y[i, tmp[lotrm:hitrm] ] + } > postscript(file="/var/wessaorg/rcomp/tmp/12qxu1359638602.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pairs(t(y)) > dev.off() null device 1 > y<-y1 > z <- as.data.frame(t(y)) > postscript(file="/var/wessaorg/rcomp/tmp/2k9ng1359638602.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=par2,col=par1)) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 7 0 109 12.9 64 18 158 104 81 [2,] 11 0 139 25.1 68 26 188 127 101 [3,] 14 0 156 37.2 71 33 225 139 113 [4,] 17 1 174 51.1 90 44 305 183 128 [5,] 23 1 180 73.8 97 57 449 245 147 $n [1] 25 25 25 25 25 25 25 25 25 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 12.104 -0.316 144.94 28.984 64.048 27.312 188.028 121.304 104.468 [2,] 15.896 0.316 167.06 45.416 77.952 38.688 261.972 156.696 121.532 $out [1] 268 $group [1] 8 $names [1] "age" "sex" "height" "weight" "bmp" "fav1" "rv" "frc" [9] "tlc" Warning message: In bxp(list(stats = c(7, 11, 14, 17, 23, 0, 0, 0, 1, 1, 109, 139, : some notches went outside hinges ('box'): maybe set notch=FALSE > 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,signif(r$stats[j,i], digits=4)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3ucu91359638602.tab") > if (par2){ + 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,signif(r$conf[1,i], digits=4)) + a<-table.element(a, signif(r$stats[3,i], digits=4)) + a<-table.element(a,signif(r$conf[2,i], digits=4)) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/4cx6h1359638602.tab") + } > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Boxplot Means',4,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/trimmed_mean.htm','trimmed mean','definition of trimmed mean'),1,TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/unbiased1.htm','unbiased SD','definition of unbiased SD'),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,signif(mean(z[i], trim=par3/100, na.rm=TRUE), digits=4)) + a<-table.element(a,signif(sd(z[i], na.rm=TRUE), digits=4)) + a<-table.row.end(a) + } There were 18 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/58y791359638602.tab") > > try(system("convert tmp/12qxu1359638602.ps tmp/12qxu1359638602.png",intern=TRUE)) character(0) > try(system("convert tmp/2k9ng1359638602.ps tmp/2k9ng1359638602.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.072 0.304 2.454