R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(77 + ,182 + ,77 + ,180 + ,68 + ,177 + ,70 + ,175 + ,76 + ,170 + ,76 + ,165 + ,76 + ,167 + ,77 + ,165 + ,69 + ,186 + ,73 + ,180 + ,71 + ,178 + ,71 + ,175 + ,65 + ,171 + ,64 + ,170 + ,70 + ,175 + ,75 + ,174 + ,92 + ,187 + ,101 + ,185 + ,76 + ,197 + ,75 + ,200 + ,119 + ,180 + ,124 + ,178 + ,65 + ,175 + ,66 + ,173 + ,66 + ,173 + ,70 + ,170 + ,101 + ,183 + ,100 + ,180 + ,75 + ,178 + ,73 + ,175 + ,79 + ,173 + ,76 + ,173 + ,64 + ,176 + ,65 + ,175 + ,69 + ,174 + ,69 + ,171 + ,88 + ,178 + ,86 + ,175 + ,65 + ,187 + ,67 + ,188 + ,80 + ,178 + ,80 + ,178 + ,78 + ,183 + ,80 + ,180 + ,85 + ,179 + ,82 + ,175 + ,82 + ,182 + ,85 + ,183 + ,74 + ,169 + ,73 + ,170 + ,102 + ,185 + ,107 + ,185 + ,64 + ,177 + ,NA + ,NA + ,65 + ,176 + ,64 + ,172 + ,73 + ,183 + ,74 + ,180 + ,75 + ,172 + ,70 + ,169 + ,57 + ,173 + ,58 + ,170 + ,68 + ,165 + ,69 + ,165 + ,71 + ,177 + ,71 + ,170 + ,71 + ,180 + ,76 + ,175 + ,97 + ,189 + ,98 + ,185 + ,80 + ,178 + ,76 + ,175 + ,66 + ,173 + ,66 + ,175 + ,69 + ,182 + ,70 + ,180 + ,69 + ,183 + ,70 + ,183 + ,55 + ,168 + ,56 + ,170 + ,59 + ,182 + ,61 + ,183 + ,62 + ,178 + ,66 + ,175 + ,70 + ,173 + ,68 + ,170 + ,84 + ,184 + ,86 + ,183 + ,69 + ,180 + ,71 + ,180 + ,88 + ,189 + ,87 + ,185 + ,103 + ,185 + ,101 + ,182 + ,63 + ,178 + ,63 + ,175 + ,84 + ,183 + ,90 + ,183 + ,79 + ,179 + ,79 + ,171 + ,67 + ,179 + ,67 + ,179 + ,83 + ,184 + ,83 + ,181 + ,96 + ,184 + ,94 + ,183 + ,75 + ,169 + ,76 + ,165 + ,65 + ,178 + ,66 + ,178 + ,78 + ,178 + ,77 + ,175 + ,69 + ,167 + ,73 + ,165 + ,87 + ,185 + ,89 + ,185 + ,83 + ,177 + ,84 + ,175 + ,90 + ,188 + ,91 + ,185 + ,85 + ,191 + ,83 + ,188 + ,66 + ,175 + ,68 + ,175 + ,88 + ,184 + ,86 + ,183 + ,54 + ,169 + ,58 + ,165 + ,69 + ,172 + ,68 + ,174 + ,56 + ,163 + ,58 + ,161 + ,96 + ,191 + ,95 + ,188 + ,76 + ,169 + ,75 + ,165 + ,61 + ,170 + ,61 + ,170 + ,62 + ,168 + ,64 + ,168 + ,71 + ,178 + ,68 + ,178 + ,66 + ,170 + ,67 + ,165 + ,81 + ,178 + ,82 + ,175 + ,68 + ,174 + ,68 + ,173 + ,80 + ,176 + ,78 + ,175 + ,70 + ,173 + ,70 + ,173 + ,76 + ,183 + ,75 + ,180 + ,88 + ,185 + ,93 + ,188 + ,89 + ,173 + ,86 + ,173 + ,74 + ,175 + ,71 + ,175 + ,83 + ,180 + ,80 + ,180 + ,90 + ,181 + ,91 + ,178 + ,79 + ,177 + ,81 + ,178) + ,dim=c(4 + ,83) + ,dimnames=list(c('weight' + ,'height' + ,'repwt' + ,'repht ') + ,1:83)) > y <- array(NA,dim=c(4,83),dimnames=list(c('weight','height','repwt','repht '),1:83)) > 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 = 'Height and Weight values' > xlab = 'CARE Variable Names' > main = 'Males' > 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/1g90d1338544975.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pairs(t(y)) Warning messages: 1: In strwidth(labels, "user") : font width unknown for character 0xd 2: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 3: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd > dev.off() null device 1 > y<-y1 > z <- as.data.frame(t(y)) > postscript(file="/var/wessaorg/rcomp/tmp/2ihev1338544975.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] [1,] 54.0 163 56 161 [2,] 67.5 173 68 171 [3,] 75.0 178 75 175 [4,] 83.0 183 83 180 [5,] 103.0 197 101 188 $n [1] 83 83 82 82 $conf [,1] [,2] [,3] [,4] [1,] 72.31187 176.2657 72.38277 173.4297 [2,] 77.68813 179.7343 77.61723 176.5703 $out [1] 119 107 124 200 $group [1] 1 3 3 4 $names [1] "weight" "height" "repwt" "repht\r" Warning messages: 1: In axis(side = 1, at = 1:4, labels = c("weight", "height", "repwt", : font width unknown for character 0xd 2: In axis(side = 1, at = 1:4, labels = c("weight", "height", "repwt", : font width unknown for character 0xd > 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/3lajr1338544975.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/4wbgc1338544975.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) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/52vqs1338544975.tab") > > try(system("convert tmp/1g90d1338544975.ps tmp/1g90d1338544975.png",intern=TRUE)) character(0) > try(system("convert tmp/2ihev1338544975.ps tmp/2ihev1338544975.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.909 0.216 1.130