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 <- c(299.81,299.01,296.82,296.67,296.95,296.80,296.80,295.93,293.77,291.02,288.61,284.55,284.55,278.14,273.28,270.14,268.36,267.15,267.15,265.47,261.75,256.51,252.98,251.17,251.17,244.27,240.54,238.92,237.47,235.91,235.91,231.41,224.94,222.19,219.06,217.83,217.83,216.89,213.84,212.90,213.98,215.31,215.31,214.09,213.71,211.54,209.40,207.33,207.33,202.75,200.26,198.99,198.82,198.43,198.43,195.68,195.45,193.65,191.38,189.71,189.71,185.49,183.01,182.38,181.60,182.13,182.13,180.81,180.25,179.84,178.50,178.11) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 299.81 284.55 251.17 217.83 207.33 189.71 NA [2,] 299.01 278.14 244.27 216.89 202.75 185.49 NA [3,] 296.82 273.28 240.54 213.84 200.26 183.01 NA [4,] 296.67 270.14 238.92 212.90 198.99 182.38 NA [5,] 296.95 268.36 237.47 213.98 198.82 181.60 NA [6,] 296.80 267.15 235.91 215.31 198.43 182.13 NA [7,] 296.80 267.15 235.91 215.31 198.43 182.13 NA [8,] 295.93 265.47 231.41 214.09 195.68 180.81 NA [9,] 293.77 261.75 224.94 213.71 195.45 180.25 NA [10,] 291.02 256.51 222.19 211.54 193.65 179.84 NA [11,] 288.61 252.98 219.06 209.40 191.38 178.50 NA [12,] 284.55 251.17 217.83 207.33 189.71 178.11 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/1rf2i1356110845.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/2bn1n1356110845.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/3qkdx1356110845.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/4bekn1356110845.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] [1,] 189.71 185.49 183.01 182.38 181.600 182.13 182.13 180.81 180.250 179.840 [2,] 207.33 202.75 200.26 198.99 198.820 198.43 198.43 195.68 195.450 193.650 [3,] 234.50 230.58 227.19 225.91 225.725 225.61 225.61 222.75 219.325 216.865 [4,] 284.55 278.14 273.28 270.14 268.360 267.15 267.15 265.47 261.750 256.510 [5,] 299.81 299.01 296.82 296.67 296.950 296.80 296.80 295.93 293.770 291.020 [,11] [,12] [1,] 178.50 178.11 [2,] 191.38 189.71 [3,] 214.23 212.58 [4,] 252.98 251.17 [5,] 288.61 284.55 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 184.6906 181.951 180.0897 180.016 180.8695 181.2834 181.2834 177.7332 [2,] 284.3094 279.209 274.2903 271.804 270.5805 269.9366 269.9366 267.7668 [,9] [,10] [,11] [,12] [1,] 176.5594 176.3183 174.496 172.9363 [2,] 262.0906 257.4117 253.964 252.2237 $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(189.71, 207.33, 234.5, 284.55, 299.81, 185.49, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5h9a81356110845.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] [1,] 288.610 251.17 217.830 209.40 189.710 178.110 NA [2,] 292.395 259.13 223.565 212.22 194.550 180.045 NA [3,] 296.735 267.15 235.910 213.91 198.430 181.865 NA [4,] 296.885 271.71 239.730 215.31 199.625 182.695 NA [5,] 299.810 284.55 251.170 217.83 202.750 185.490 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 294.6871 261.4122 228.537 212.5006 196.1153 180.6563 NA [2,] 298.7829 272.8878 243.283 215.3194 200.7447 183.0737 NA $out [1] 284.55 207.33 207.33 189.71 $group [1] 1 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(288.61, 292.395, 296.735, 296.885, 299.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qb1y1356110845.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,] 39.90777 106.440 48.61500 [2,] 41.92063 110.645 51.17000 [3,] 43.35375 113.665 56.69000 [4,] 43.89203 114.670 60.65375 [5,] 44.31229 115.350 66.25000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 42.45458 111.8292 52.3644 [2,] 44.25292 115.5008 61.0156 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(39.9077696695769, 41.9206322271415, 43.3537509602569, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rf2i1356110845.ps tmp/1rf2i1356110845.png",intern=TRUE)) character(0) > try(system("convert tmp/2bn1n1356110845.ps tmp/2bn1n1356110845.png",intern=TRUE)) character(0) > try(system("convert tmp/3qkdx1356110845.ps tmp/3qkdx1356110845.png",intern=TRUE)) character(0) > try(system("convert tmp/4bekn1356110845.ps tmp/4bekn1356110845.png",intern=TRUE)) character(0) > try(system("convert tmp/5h9a81356110845.ps tmp/5h9a81356110845.png",intern=TRUE)) character(0) > try(system("convert tmp/6qb1y1356110845.ps tmp/6qb1y1356110845.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.144 0.711 3.853