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 <- c(56,55,54,52,72,71,56,46,47,47,48,50,44,38,33,33,52,54,39,22,31,31,38,42,41,31,36,34,51,47,31,19,30,33,36,40,32,25,28,29,55,55,40,38,44,41,49,59,61,47,43,39,66,68,63,68,67,59,68,78,82,70,62,68,94,102,100,104,103,93,110,114,120,102,95,103,122,139,135,135,137,130,148,148,145,128,131,133,146,163,151,157,152,149,172,167,160,150,160,165,171,179,171,176,170,169,194,196,188,174,186,191,197,206,197,204,201,190,213,213) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Standard Deviation Plot (v1.0.2) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_sdplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 120 > (np <- floor(n / par1)) [1] 10 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 56 44 41 32 61 82 120 145 160 188 NA [2,] 55 38 31 25 47 70 102 128 150 174 NA [3,] 54 33 36 28 43 62 95 131 160 186 NA [4,] 52 33 34 29 39 68 103 133 165 191 NA [5,] 72 52 51 55 66 94 122 146 171 197 NA [6,] 71 54 47 55 68 102 139 163 179 206 NA [7,] 56 39 31 40 63 100 135 151 171 197 NA [8,] 46 22 19 38 68 104 135 157 176 204 NA [9,] 47 31 30 44 67 103 137 152 170 201 NA [10,] 47 31 33 41 59 93 130 149 169 190 NA [11,] 48 38 36 49 68 110 148 172 194 213 NA [12,] 50 42 40 59 78 114 148 167 196 213 NA > arr.sd <- array(NA,dim=par1) > arr.range <- array(NA,dim=par1) > arr.iqr <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.sd[j] <- sqrt(var(arr[j,],na.rm=TRUE)) + arr.range[j] <- max(arr[j,],na.rm=TRUE) - min(arr[j,],na.rm=TRUE) + arr.iqr[j] <- quantile(arr[j,],0.75,na.rm=TRUE) - quantile(arr[j,],0.25,na.rm=TRUE) + } > overall.sd <- sqrt(var(x)) > overall.range <- max(x) - min(x) > overall.iqr <- quantile(x,0.75) - quantile(x,0.25) > postscript(file="/var/wessaorg/rcomp/tmp/17u811342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.sd,type='b',ylab='S.D.',main='Standard Deviation Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.sd,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2m9a11342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.range,type='b',ylab='range',main='Range Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.range,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3dmsm1342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.iqr,type='b',ylab='IQR',main='Interquartile Range Plot',xlab='Periodic Index') > mtext(paste('# blocks = ',np)) > abline(overall.iqr,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4pg0r1342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 32.0 25.0 28 29 51 47.0 31.0 19 30 31 36 40 [2,] 44.0 38.0 36 34 55 55.0 40.0 38 44 41 48 50 [3,] 71.5 62.5 58 60 83 86.5 81.5 86 85 76 89 96 [4,] 145.0 128.0 131 133 146 163.0 151.0 157 152 149 172 167 [5,] 188.0 174.0 186 191 197 206.0 197.0 204 201 190 213 213 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 21.03637 17.53241 10.53421 10.53565 37.53277 32.53889 26.03997 [2,] 121.96363 107.46759 105.46579 109.46435 128.46723 140.46111 136.96003 [,8] [,9] [,10] [,11] [,12] [1,] 26.54286 31.03889 22.03889 27.04466 37.54214 [2,] 145.45714 138.96111 129.96111 150.95534 154.45786 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(32, 44, 71.5, 145, 188, 25, 38, 62.5, 128, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jrwa1342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 46.0 22 19.0 25.0 39.0 62.0 95.0 128 150.0 174 NA [2,] 47.5 32 31.0 30.5 53.0 76.0 111.5 139 162.5 189 NA [3,] 53.0 38 35.0 40.5 64.5 97.0 132.5 150 170.5 197 NA [4,] 56.0 43 40.5 52.0 68.0 103.5 138.0 160 177.5 205 NA [5,] 56.0 54 51.0 59.0 78.0 114.0 148.0 172 196.0 213 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 49.12309 32.98283 30.66699 30.69371 57.6584 84.45707 120.4132 140.4218 [2,] 56.87691 43.01717 39.33301 50.30629 71.3416 109.54293 144.5868 159.5782 [,9] [,10] [,11] [1,] 163.6584 189.7023 NA [2,] 177.3416 204.2977 NA $out [1] 72 71 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(46, 47.5, 53, 56, 56, 22, 32, 38, 43, 54, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fzon1342112223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.sd,arr.range,arr.iqr)) > names(z) <- list('S.D.','Range','IQR') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Variability',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 53.21654 146.0 81.25 [2,] 56.70638 157.0 87.25 [3,] 60.22671 160.5 100.25 [4,] 64.66166 172.0 106.75 [5,] 69.02850 185.0 117.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 56.59825 153.6584 91.35592 [2,] 63.85517 167.3416 109.14408 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(53.2165387826003, 56.7063755634639, 60.2267085865406, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17u811342112223.ps tmp/17u811342112223.png",intern=TRUE)) character(0) > try(system("convert tmp/2m9a11342112223.ps tmp/2m9a11342112223.png",intern=TRUE)) character(0) > try(system("convert tmp/3dmsm1342112223.ps tmp/3dmsm1342112223.png",intern=TRUE)) character(0) > try(system("convert tmp/4pg0r1342112223.ps tmp/4pg0r1342112223.png",intern=TRUE)) character(0) > try(system("convert tmp/5jrwa1342112223.ps tmp/5jrwa1342112223.png",intern=TRUE)) character(0) > try(system("convert tmp/6fzon1342112223.ps tmp/6fzon1342112223.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.864 0.465 2.325