R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(7175,7048.75,6922.5,6670,9225,9098.75,7175,5897.5,6023.75,6023.75,6150,6416.25,5645,4872.5,4240,4240,6670,6922.5,4998.75,2822.5,3973.75,3973.75,4872.5,5391.25,5265,3973.75,4620,4366.25,6542.5,6023.75,3973.75,2442.5,3847.5,4240,4620,5125,4100,3215,3595,3721.25,7048.75,7048.75,5125,4872.5,5645,5265,6290,7567.5,7821.25,6023.75,5517.5,4998.75,8466.25,8720,8073.75,8720,8592.5,7567.5,8720,9997.5,10516.25,8972.5,7947.5,8720,12047.5,13072.5,12820,13325,13198.75,11921.25,14097.5,14616.25,15375,13072.5,12173.75,13198.75,15641.25,17817.5,17298.75,17298.75,17552.5,16666.25,18970,18970,18577.5,16400,16792.5,17046.25,18716.25,20892.5,19348.75,20121.25,19475,19096.25,22045,21398.75,20500,19222.5,20500,21146.25,21917.5,22942.5,21917.5,22550,21778.75,21652.5,24853.75,25120,24095,22297.5,23828.75,24473.75,25246.25,26397.5,25246.25,26145,25752.5,24347.5,27296.25,27296.25) > 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] [1,] 7175.00 5645.00 5265.00 4100.00 7821.25 10516.25 15375.00 18577.50 [2,] 7048.75 4872.50 3973.75 3215.00 6023.75 8972.50 13072.50 16400.00 [3,] 6922.50 4240.00 4620.00 3595.00 5517.50 7947.50 12173.75 16792.50 [4,] 6670.00 4240.00 4366.25 3721.25 4998.75 8720.00 13198.75 17046.25 [5,] 9225.00 6670.00 6542.50 7048.75 8466.25 12047.50 15641.25 18716.25 [6,] 9098.75 6922.50 6023.75 7048.75 8720.00 13072.50 17817.50 20892.50 [7,] 7175.00 4998.75 3973.75 5125.00 8073.75 12820.00 17298.75 19348.75 [8,] 5897.50 2822.50 2442.50 4872.50 8720.00 13325.00 17298.75 20121.25 [9,] 6023.75 3973.75 3847.50 5645.00 8592.50 13198.75 17552.50 19475.00 [10,] 6023.75 3973.75 4240.00 5265.00 7567.50 11921.25 16666.25 19096.25 [11,] 6150.00 4872.50 4620.00 6290.00 8720.00 14097.50 18970.00 22045.00 [12,] 6416.25 5391.25 5125.00 7567.50 9997.50 14616.25 18970.00 21398.75 [,9] [,10] [,11] [1,] 20500.00 24095.00 NA [2,] 19222.50 22297.50 NA [3,] 20500.00 23828.75 NA [4,] 21146.25 24473.75 NA [5,] 21917.50 25246.25 NA [6,] 22942.50 26397.50 NA [7,] 21917.50 25246.25 NA [8,] 22550.00 26145.00 NA [9,] 21778.75 25752.50 NA [10,] 21652.50 24347.50 NA [11,] 24853.75 27296.25 NA [12,] 25120.00 27296.25 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/1ntld1470845467.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/2jeyi1470845467.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/3z5qz1470845467.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/420xp1470845467.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] [1,] 4100.00 3215.000 3595.00 3721.25 6542.50 6023.75 3973.75 2442.50 [2,] 5645.00 4872.500 4620.00 4366.25 7048.75 7048.75 5125.00 4872.50 [3,] 9168.75 8010.625 7435.00 7695.00 10636.25 11085.62 10446.88 11022.50 [4,] 18577.50 16400.000 16792.50 17046.25 18716.25 20892.50 19348.75 20121.25 [5,] 24095.00 22297.500 23828.75 24473.75 25246.25 26397.50 25246.25 26145.00 [,9] [,10] [,11] [,12] [1,] 3847.50 3973.750 4620.00 5125.00 [2,] 5645.00 5265.000 6150.00 6416.25 [3,] 10895.62 9744.375 11408.75 12306.88 [4,] 19475.00 19096.250 22045.00 21398.75 [5,] 25752.50 24347.500 27296.25 27296.25 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2707.157 2251.026 1353.134 1359.566 4806.702 4168.736 3340.122 [2,] 15630.343 13770.224 13516.866 14030.434 16465.798 18002.514 17553.628 [,8] [,9] [,10] [,11] [,12] [1,] 3403.617 3985.606 2833.731 3466.974 4821.021 [2,] 18641.383 17805.644 16655.019 19350.526 19792.729 $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(4100, 5645, 9168.75, 18577.5, 24095, 3215, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sk0g1470845467.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] [1,] 5897.500 2822.500 2442.500 3215.000 4998.750 7947.500 12173.75 16400.00 [2,] 6086.875 4106.875 3973.750 3910.625 6795.625 9744.375 14286.88 17811.88 [3,] 6796.250 4872.500 4493.125 5195.000 8270.000 12433.750 16982.50 19222.50 [4,] 7175.000 5518.125 5195.000 6669.375 8720.000 13261.875 17685.00 20506.88 [5,] 7175.000 6922.500 6542.500 7567.500 9997.500 14616.250 18970.00 22045.00 [,9] [,10] [,11] [1,] 19222.50 22297.50 NA [2,] 20823.12 24221.25 NA [3,] 21848.12 25246.25 NA [4,] 22746.25 26271.25 NA [5,] 25120.00 27296.25 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6299.949 4228.819 3936.105 3936.716 7392.28 10829.39 15432.59 17993.29 [2,] 7292.551 5516.181 5050.145 6453.284 9147.72 14038.11 18532.41 20451.71 [,9] [,10] [,11] [1,] 20970.97 24311.23 NA [2,] 22725.28 26181.27 NA $out [1] 9225.00 9098.75 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5897.5, 6086.875, 6796.25, 7175, 7175, 2822.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uth41470845467.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,] 6817.485 18703.75 10407.81 [2,] 7263.267 20114.38 11176.72 [3,] 7714.875 20563.12 12845.62 [4,] 8283.376 22038.12 13671.09 [5,] 8843.281 23702.50 15091.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7249.597 19685.69 11707.92 [2,] 8180.154 21440.56 13983.33 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6817.48496132677, 7263.26709539066, 7714.87511187656, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ntld1470845467.ps tmp/1ntld1470845467.png",intern=TRUE)) character(0) > try(system("convert tmp/2jeyi1470845467.ps tmp/2jeyi1470845467.png",intern=TRUE)) character(0) > try(system("convert tmp/3z5qz1470845467.ps tmp/3z5qz1470845467.png",intern=TRUE)) character(0) > try(system("convert tmp/420xp1470845467.ps tmp/420xp1470845467.png",intern=TRUE)) character(0) > try(system("convert tmp/5sk0g1470845467.ps tmp/5sk0g1470845467.png",intern=TRUE)) character(0) > try(system("convert tmp/6uth41470845467.ps tmp/6uth41470845467.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.275 0.242 2.564