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(1 + ,7 + ,0 + ,109 + ,13.1 + ,68 + ,32 + ,258 + ,183 + ,137 + ,95 + ,2 + ,7 + ,1 + ,112 + ,12.9 + ,65 + ,19 + ,449 + ,245 + ,134 + ,85 + ,3 + ,8 + ,0 + ,124 + ,14.1 + ,64 + ,22 + ,441 + ,268 + ,147 + ,100 + ,4 + ,8 + ,1 + ,125 + ,16.2 + ,67 + ,41 + ,234 + ,146 + ,124 + ,85 + ,5 + ,8 + ,0 + ,127 + ,21.5 + ,93 + ,52 + ,202 + ,131 + ,104 + ,95 + ,6 + ,9 + ,0 + ,130 + ,17.5 + ,68 + ,44 + ,308 + ,155 + ,118 + ,80 + ,7 + ,11 + ,1 + ,139 + ,30.7 + ,89 + ,28 + ,305 + ,179 + ,119 + ,65 + ,8 + ,12 + ,1 + ,150 + ,28.4 + ,69 + ,18 + ,369 + ,198 + ,103 + ,110 + ,9 + ,12 + ,0 + ,146 + ,25.1 + ,67 + ,24 + ,312 + ,194 + ,128 + ,70 + ,10 + ,13 + ,1 + ,155 + ,31.5 + ,68 + ,23 + ,413 + ,225 + ,136 + ,95 + ,11 + ,13 + ,0 + ,156 + ,39.9 + ,89 + ,39 + ,206 + ,142 + ,95 + ,110 + ,12 + ,14 + ,1 + ,153 + ,42.1 + ,90 + ,26 + ,253 + ,191 + ,121 + ,90 + ,13 + ,14 + ,0 + ,160 + ,45.6 + ,93 + ,45 + ,174 + ,139 + ,108 + ,100 + ,14 + ,15 + ,1 + ,158 + ,51.2 + ,93 + ,45 + ,158 + ,124 + ,90 + ,80 + ,15 + ,16 + ,1 + ,160 + ,35.9 + ,66 + ,31 + ,302 + ,133 + ,101 + ,134 + ,16 + ,17 + ,1 + ,153 + ,34.8 + ,70 + ,29 + ,204 + ,118 + ,120 + ,134 + ,17 + ,17 + ,0 + ,174 + ,44.7 + ,70 + ,49 + ,187 + ,104 + ,103 + ,165 + ,18 + ,17 + ,1 + ,176 + ,60.1 + ,92 + ,29 + ,188 + ,129 + ,130 + ,120 + ,19 + ,17 + ,0 + ,171 + ,42.6 + ,69 + ,38 + ,172 + ,130 + ,103 + ,130 + ,20 + ,19 + ,1 + ,156 + ,37.2 + ,72 + ,21 + ,216 + ,119 + ,81 + ,85 + ,21 + ,19 + ,0 + ,174 + ,54.6 + ,86 + ,37 + ,184 + ,118 + ,101 + ,85 + ,22 + ,20 + ,0 + ,178 + ,64 + ,86 + ,34 + ,225 + ,148 + ,135 + ,160 + ,23 + ,23 + ,0 + ,180 + ,73.8 + ,97 + ,57 + ,171 + ,108 + ,98 + ,165 + ,24 + ,23 + ,0 + ,175 + ,51.1 + ,71 + ,33 + ,224 + ,131 + ,113 + ,95 + ,25 + ,23 + ,0 + ,179 + ,71.5 + ,95 + ,52 + ,225 + ,127 + ,101 + ,195) + ,dim=c(11 + ,25) + ,dimnames=list(c('ID' + ,'Age' + ,'Sex' + ,'Height' + ,'Weight' + ,'BMP' + ,'FEV1' + ,'RV' + ,'FRC' + ,'TLC' + ,'Premax') + ,1:25)) > y <- array(NA,dim=c(11,25),dimnames=list(c('ID','Age','Sex','Height','Weight','BMP','FEV1','RV','FRC','TLC','Premax'),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/1pqc61362155132.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/2yie11362155132.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] [,10] [,11] [1,] 1 7 0 109 12.9 64 18 158 104 81 65 [2,] 7 11 0 139 25.1 68 26 188 127 101 85 [3,] 13 14 0 156 37.2 71 33 225 139 113 95 [4,] 19 17 1 174 51.1 90 44 305 183 128 130 [5,] 25 23 1 180 73.8 97 57 449 245 147 195 $n [1] 25 25 25 25 25 25 25 25 25 25 25 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 9.208 12.104 -0.316 144.94 28.984 64.048 27.312 188.028 121.304 104.468 [2,] 16.792 15.896 0.316 167.06 45.416 77.952 38.688 261.972 156.696 121.532 [,11] [1,] 80.78 [2,] 109.22 $out [1] 268 $group [1] 9 $names [1] "ID" "Age" "Sex" "Height" "Weight" "BMP" "FEV1" "RV" [9] "FRC" "TLC" "Premax" Warning message: In bxp(list(stats = c(1, 7, 13, 19, 25, 7, 11, 14, 17, 23, 0, 0, : 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/37hm71362155132.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/490gm1362155132.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 22 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/5dwa81362155132.tab") > > try(system("convert tmp/1pqc61362155132.ps tmp/1pqc61362155132.png",intern=TRUE)) character(0) > try(system("convert tmp/2yie11362155132.ps tmp/2yie11362155132.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.916 0.231 2.120