R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing 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(84728,84412,84092,83430,89981,89635,84728,81466,81781,81781,82133,82764,83746,83746,83115,81466,89981,91279,89319,84728,86692,83746,85075,85710,86372,84728,85075,82764,89981,92261,90301,86692,90617,86372,90301,89981,90964,87355,91279,90964,96852,95523,90301,87670,91279,86372,89981,90617,91946,89004,90617,91599,95208,92261,88337,84092,88021,77221,82448,85390,88337,84092,84092,84092,86372,83115,78839,75261,77857,67724,73933,77541,78204,74595,74910,73933,77221,74910,70355,67062,72630,60537,68390,71968,71968,67724,63799,63484,67062,63799,57595,53319,57911,47115,56928,62150,63799,60191,55631,58893,60191,59208,49391,44835,48093,38280,48413,52022,54964,50057,45466,48093,49391,46795,36982,32706,36631,25835,37613,44835) > 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,] 84728 83746 86372 90964 91946 88337 78204 71968 63799 54964 NA [2,] 84412 83746 84728 87355 89004 84092 74595 67724 60191 50057 NA [3,] 84092 83115 85075 91279 90617 84092 74910 63799 55631 45466 NA [4,] 83430 81466 82764 90964 91599 84092 73933 63484 58893 48093 NA [5,] 89981 89981 89981 96852 95208 86372 77221 67062 60191 49391 NA [6,] 89635 91279 92261 95523 92261 83115 74910 63799 59208 46795 NA [7,] 84728 89319 90301 90301 88337 78839 70355 57595 49391 36982 NA [8,] 81466 84728 86692 87670 84092 75261 67062 53319 44835 32706 NA [9,] 81781 86692 90617 91279 88021 77857 72630 57911 48093 36631 NA [10,] 81781 83746 86372 86372 77221 67724 60537 47115 38280 25835 NA [11,] 82133 85075 90301 89981 82448 73933 68390 56928 48413 37613 NA [12,] 82764 85710 89981 90617 85390 77541 71968 62150 52022 44835 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/1358i1375961841.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/2asnl1375961841.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/3gsw41375961841.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/4o0bz1375961841.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,] 54964 50057 45466.0 48093 49391.0 46795 36982.0 32706.0 36631 25835.0 [2,] 71968 67724 63799.0 63484 67062.0 63799 57595.0 53319.0 57911 47115.0 [3,] 84237 83919 83603.5 82115 88176.5 86375 81783.5 78363.5 79819 72472.5 [4,] 88337 84728 85075.0 84092 89981.0 92261 89319.0 84728.0 88021 83746.0 [5,] 91946 89004 91279.0 91599 96852.0 95523 90301.0 87670.0 91279 86372.0 [,11] [,12] [1,] 37613 44835.0 [2,] 56928 62150.0 [3,] 78033 80152.5 [4,] 85075 85710.0 [5,] 90301 90617.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 76058.39 75423.12 72973.16 71818.42 76725.25 72154.25 65932.92 62670.31 [2,] 92415.61 92414.88 94233.84 92411.58 99627.75 100595.75 97634.08 94056.69 [,9] [,10] [,11] [,12] [1,] 64774.84 54170.19 63969.64 68380.98 [2,] 94863.16 90774.81 92096.36 91924.02 $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(54964, 71968, 84237, 88337, 91946, 50057, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5li6r1375961841.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] [1,] 81466 81466.0 82764.0 86372.0 77221.0 67724 67062.0 47115.0 38280.0 [2,] 81957 83746.0 85723.5 88825.5 84741.0 76401 69372.5 57261.5 48253.0 [3,] 83761 84901.5 88336.5 90790.5 88670.5 80977 73281.5 62817.0 53826.5 [4,] 84728 88005.5 90301.0 91279.0 91772.5 84092 74910.0 65430.5 59699.5 [5,] 84728 91279.0 92261.0 91279.0 95208.0 88337 78204.0 71968.0 63799.0 [,10] [,11] [1,] 25835.0 NA [2,] 36806.5 NA [3,] 45150.5 NA [4,] 48742.0 NA [5,] 54964.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82497.13 82958.71 86248.67 89671.44 85463.39 77469.08 70755.81 59091.06 [2,] 85024.87 86844.29 90424.33 91909.56 91877.61 84484.92 75807.19 66542.94 [,9] [,10] [,11] [1,] 48605.67 39706.64 NA [2,] 59047.33 50594.36 NA $out [1] 89981 89635 96852 95523 60537 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(81466, 81957, 83761, 84728, 84728, 81466, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hx6l1375961841.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,] 12310.57 36982.0 14318.75 [2,] 15088.21 44644.0 18041.38 [3,] 16574.24 48094.5 22825.12 [4,] 19287.17 53983.5 26956.12 [5,] 21828.82 60537.0 32784.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 14659.07 43834.69 18759.05 [2,] 18489.41 52354.31 26891.20 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(12310.568736749, 15088.2132992902, 16574.2380309894, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1358i1375961841.ps tmp/1358i1375961841.png",intern=TRUE)) character(0) > try(system("convert tmp/2asnl1375961841.ps tmp/2asnl1375961841.png",intern=TRUE)) character(0) > try(system("convert tmp/3gsw41375961841.ps tmp/3gsw41375961841.png",intern=TRUE)) character(0) > try(system("convert tmp/4o0bz1375961841.ps tmp/4o0bz1375961841.png",intern=TRUE)) character(0) > try(system("convert tmp/5li6r1375961841.ps tmp/5li6r1375961841.png",intern=TRUE)) character(0) > try(system("convert tmp/6hx6l1375961841.ps tmp/6hx6l1375961841.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.221 0.738 3.939