R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes" 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(10670.5,11129,13474.5,12317.8,11990.1,13478.3,11762.4,11149.1,13597.2,13367.9,13304.2,12407.2,13008.3,13379.5,15696,13529.6,14857,14375.1,12958.4,12612.8,14405.2,13655.8,13783.1,12336.1,13366.7,14042.4,15412,13566.5,13981.5,14042,13131,12771.2,13600.1,14886.9,13813.1,11551,13750.5,13415.4,15040.9,14349.5,13900.2,13956.6,13951,11802.1,14219.1,14914.5,14098.2,12773.6,14225,13513,14754.4,14447.7,13777.8,14328.6,14106.1,12157,15425.1,15448.8,13604.5,12269.3) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 10670.5 13008.3 13366.7 13750.5 14225.0 NA [2,] 11129.0 13379.5 14042.4 13415.4 13513.0 NA [3,] 13474.5 15696.0 15412.0 15040.9 14754.4 NA [4,] 12317.8 13529.6 13566.5 14349.5 14447.7 NA [5,] 11990.1 14857.0 13981.5 13900.2 13777.8 NA [6,] 13478.3 14375.1 14042.0 13956.6 14328.6 NA [7,] 11762.4 12958.4 13131.0 13951.0 14106.1 NA [8,] 11149.1 12612.8 12771.2 11802.1 12157.0 NA [9,] 13597.2 14405.2 13600.1 14219.1 15425.1 NA [10,] 13367.9 13655.8 14886.9 14914.5 15448.8 NA [11,] 13304.2 13783.1 13813.1 14098.2 13604.5 NA [12,] 12407.2 12336.1 11551.0 12773.6 12269.3 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/10w061462281311.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/2j9uv1462281311.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/32uf31462281311.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/4c1y71462281311.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] [1,] 13008.3 13379.5 14754.4 12317.8 13777.8 13478.3 11762.4 11149.1 13597.2 [2,] 13008.3 13379.5 14754.4 13529.6 13777.8 13956.6 12958.4 11802.1 13600.1 [3,] 13366.7 13415.4 15040.9 13566.5 13900.2 14042.0 13131.0 12157.0 14219.1 [4,] 13750.5 13513.0 15412.0 14349.5 13981.5 14328.6 13951.0 12612.8 14405.2 [5,] 14225.0 13513.0 15696.0 14447.7 13981.5 14375.1 14106.1 12771.2 15425.1 [,10] [,11] [,12] [1,] 13367.9 13304.2 12269.3 [2,] 13655.8 13604.5 12269.3 [3,] 14886.9 13783.1 12336.1 [4,] 14914.5 13813.1 12407.2 [5,] 15448.8 14098.2 12407.2 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12842.26 13321.07 14576.24 12987.16 13756.27 13779.15 12429.63 11584.16 [2,] 13891.14 13509.73 15505.56 14145.84 14044.13 14304.85 13832.37 12729.84 [,9] [,10] [,11] [,12] [1,] 13650.22 13997.51 13635.7 12238.66 [2,] 14787.98 15776.29 13930.5 12433.54 $out [1] 10670.5 11129.0 14042.4 13474.5 11990.1 14857.0 11551.0 12773.6 $group [1] 1 2 2 3 5 5 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(13008.3, 13008.3, 13366.7, 13750.5, 14225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p1rg1462281311.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] [1,] 10670.50 12336.10 12771.20 12773.60 12157.00 NA [2,] 11455.75 12983.35 13248.85 13582.95 13558.75 NA [3,] 12362.50 13592.70 13706.60 13953.80 14165.55 NA [4,] 13421.20 14390.15 14042.20 14284.30 14601.05 NA [5,] 13597.20 15696.00 14886.90 15040.90 15448.80 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 11466.05 12951.05 13344.75 13633.91 13690.15 NA [2,] 13258.95 14234.35 14068.45 14273.69 14640.95 NA $out [1] 15412.0 11551.0 11802.1 $group [1] 3 3 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(10670.5, 11455.75, 12362.5, 13421.2, 13597.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60wki1462281311.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,] 292.3664 794.00 133.50 [2,] 549.6149 1422.35 206.15 [3,] 857.8564 2105.40 699.90 [4,] 992.2625 2605.30 815.30 [5,] 1380.6606 3554.50 1258.70 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 655.9618 1565.849 422.0626 [2,] 1059.7509 2644.951 977.7374 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(292.366391707392, 549.614907175846, 857.856380795386, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10w061462281311.ps tmp/10w061462281311.png",intern=TRUE)) character(0) > try(system("convert tmp/2j9uv1462281311.ps tmp/2j9uv1462281311.png",intern=TRUE)) character(0) > try(system("convert tmp/32uf31462281311.ps tmp/32uf31462281311.png",intern=TRUE)) character(0) > try(system("convert tmp/4c1y71462281311.ps tmp/4c1y71462281311.png",intern=TRUE)) character(0) > try(system("convert tmp/5p1rg1462281311.ps tmp/5p1rg1462281311.png",intern=TRUE)) character(0) > try(system("convert tmp/60wki1462281311.ps tmp/60wki1462281311.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.138 0.402 2.535