R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(58 + ,161 + ,77 + ,182 + ,53 + ,161 + ,68 + ,177 + ,59 + ,157 + ,76 + ,170 + ,51 + ,161 + ,76 + ,167 + ,64 + ,168 + ,69 + ,186 + ,52 + ,163 + ,71 + ,178 + ,65 + ,166 + ,65 + ,171 + ,62 + ,168 + ,70 + ,175 + ,61 + ,175 + ,92 + ,187 + ,61 + ,170 + ,76 + ,197 + ,54 + ,171 + ,119 + ,180 + ,50 + ,166 + ,65 + ,175 + ,63 + ,169 + ,66 + ,173 + ,58 + ,166 + ,101 + ,183 + ,39 + ,157 + ,75 + ,178 + ,71 + ,166 + ,79 + ,173 + ,52 + ,164 + ,64 + ,176 + ,68 + ,169 + ,69 + ,174 + ,56 + ,166 + ,88 + ,178 + ,54 + ,164 + ,65 + ,187 + ,63 + ,163 + ,80 + ,178 + ,54 + ,160 + ,78 + ,183 + ,49 + ,161 + ,85 + ,179 + ,54 + ,174 + ,73 + ,180 + ,75 + ,162 + ,82 + ,182 + ,56 + ,165 + ,74 + ,169 + ,66 + ,170 + ,102 + ,185 + ,78 + ,173 + ,64 + ,177 + ,60 + ,162 + ,65 + ,176 + ,64 + ,165 + ,73 + ,183 + ,64 + ,164 + ,75 + ,172 + ,52 + ,158 + ,57 + ,173 + ,62 + ,175 + ,68 + ,165 + ,55 + ,165 + ,71 + ,177 + ,56 + ,163 + ,71 + ,180 + ,50 + ,166 + ,97 + ,189 + ,50 + ,171 + ,80 + ,178 + ,50 + ,160 + ,66 + ,173 + ,63 + ,160 + ,69 + ,182 + ,61 + ,165 + ,69 + ,183 + ,53 + ,169 + ,55 + ,168 + ,60 + ,167 + ,59 + ,182 + ,56 + ,170 + ,62 + ,178 + ,53 + ,165 + ,70 + ,173 + ,57 + ,163 + ,84 + ,184 + ,57 + ,162 + ,69 + ,180 + ,56 + ,161 + ,88 + ,189 + ,56 + ,165 + ,103 + ,185 + ,50 + ,169 + ,63 + ,178 + ,52 + ,159 + ,84 + ,183 + ,55 + ,155 + ,79 + ,179 + ,55 + ,164 + ,67 + ,179 + ,47 + ,163 + ,83 + ,184 + ,45 + ,163 + ,96 + ,184 + ,62 + ,175 + ,75 + ,169 + ,53 + ,164 + ,65 + ,178 + ,52 + ,152 + ,78 + ,178 + ,57 + ,167 + ,69 + ,167 + ,64 + ,166 + ,67 + ,179 + ,59 + ,166 + ,87 + ,185 + ,55 + ,174 + ,83 + ,177 + ,76 + ,167 + ,90 + ,188 + ,62 + ,168 + ,85 + ,191 + ,68 + ,178 + ,66 + ,175 + ,55 + ,165 + ,88 + ,184 + ,52 + ,169 + ,54 + ,169 + ,47 + ,153 + ,69 + ,172 + ,45 + ,157 + ,56 + ,163 + ,68 + ,171 + ,96 + ,191 + ,44 + ,157 + ,76 + ,169 + ,62 + ,166 + ,61 + ,170 + ,56 + ,160 + ,82 + ,176 + ,50 + ,148 + ,62 + ,168 + ,53 + ,162 + ,71 + ,178 + ,64 + ,172 + ,66 + ,170 + ,62 + ,167 + ,81 + ,178 + ,52 + ,163 + ,68 + ,174 + ,53 + ,165 + ,80 + ,176 + ,54 + ,176 + ,82 + ,181 + ,64 + ,171 + ,70 + ,173 + ,55 + ,160 + ,76 + ,183 + ,55 + ,165 + ,88 + ,185 + ,59 + ,157 + ,89 + ,173 + ,70 + ,173 + ,74 + ,175 + ,57 + ,168 + ,83 + ,180 + ,47 + ,162 + ,81 + ,175 + ,47 + ,150 + ,90 + ,181 + ,55 + ,162 + ,79 + ,177 + ,48 + ,163 + ,NA + ,NA + ,59 + ,170 + ,NA + ,NA + ,58 + ,169 + ,NA + ,NA + ,57 + ,167 + ,NA + ,NA + ,51 + ,163 + ,NA + ,NA + ,54 + ,161 + ,NA + ,NA + ,53 + ,162 + ,NA + ,NA + ,59 + ,172 + ,NA + ,NA + ,59 + ,159 + ,NA + ,NA + ,63 + ,170 + ,NA + ,NA + ,66 + ,166 + ,NA + ,NA + ,53 + ,158 + ,NA + ,NA + ,54 + ,163 + ,NA + ,NA + ,60 + ,174 + ,NA + ,NA + ,43 + ,154 + ,NA + ,NA + ,63 + ,165 + ,NA + ,NA + ,56 + ,162 + ,NA + ,NA + ,60 + ,172 + ,NA + ,NA + ,58 + ,169 + ,NA + ,NA + ,50 + ,158 + ,NA + ,NA + ,59 + ,164 + ,NA + ,NA + ,51 + ,156 + ,NA + ,NA + ,62 + ,164 + ,NA + ,NA) + ,dim=c(4 + ,111) + ,dimnames=list(c('FW' + ,'FH' + ,'MW' + ,'MH') + ,1:111)) > y <- array(NA,dim=c(4,111),dimnames=list(c('FW','FH','MW','MH'),1:111)) > 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' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: aston2 > #To cite this work: Ian E. Holliday, 2012, CARE Boxplots and Scatterplot Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_CARE%20Data%20Boxplot.wasp/ > #Source of accompanying publication: > # > 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/www/rcomp/tmp/19vau1338473582.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/www/rcomp/tmp/2tcct1338473582.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,] 39.0 152.0 54.0 163 [2,] 52.5 161.5 67.5 173 [3,] 56.0 165.0 75.0 178 [4,] 62.0 169.0 83.0 183 [5,] 76.0 178.0 103.0 197 $n [1] 111 111 88 88 $conf [,1] [,2] [,3] [,4] [1,] 54.57531 163.8752 72.38936 176.3157 [2,] 57.42469 166.1248 77.61064 179.6843 $out [1] 78 148 150 119 $group [1] 1 2 2 3 $names [1] "FW" "FH" "MW" "MH" > dev.off() null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/3k01w1338473582.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/www/rcomp/tmp/44btn1338473582.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/www/rcomp/tmp/54f4s1338473583.tab") > > try(system("convert tmp/19vau1338473582.ps tmp/19vau1338473582.png",intern=TRUE)) character(0) > try(system("convert tmp/2tcct1338473582.ps tmp/2tcct1338473582.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.810 0.300 1.086