R version 3.2.4 (2016-03-10) -- "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(45564.6,47295.5,46465.5,50679.5,47452.8,49415.4,48165.3,51814,49030.7,50820.8,49729.5,53501.6,50524.9,52095,51290.3,55064,52505.2,54318.3,53039.6,57607.6,54236.4,56586.4,55614,60085.9,56963.5,59152.8,57804.6,62541.5,59449.3,61704.7,60399,65724.7,62679.4,65526.5,64274.8,68769.1,63542.8,66198,64544.9,71041.8,66087.2,69005.8,66897,73702,68485.3,71457,69774.6,76479.7,71204.7,73783.9,71651,78541.6,72714.4,75258,73168.1,79701.6,73944.5,76401.2,73948.1,80583.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,] 45564.6 50524.9 56963.5 63542.8 71204.7 NA [2,] 47295.5 52095.0 59152.8 66198.0 73783.9 NA [3,] 46465.5 51290.3 57804.6 64544.9 71651.0 NA [4,] 50679.5 55064.0 62541.5 71041.8 78541.6 NA [5,] 47452.8 52505.2 59449.3 66087.2 72714.4 NA [6,] 49415.4 54318.3 61704.7 69005.8 75258.0 NA [7,] 48165.3 53039.6 60399.0 66897.0 73168.1 NA [8,] 51814.0 57607.6 65724.7 73702.0 79701.6 NA [9,] 49030.7 54236.4 62679.4 68485.3 73944.5 NA [10,] 50820.8 56586.4 65526.5 71457.0 76401.2 NA [11,] 49729.5 55614.0 64274.8 69774.6 73948.1 NA [12,] 53501.6 60085.9 68769.1 76479.7 80583.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/1dd411458568294.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/292xp1458568294.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/3vx7p1458568294.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/4avq41458568294.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,] 45564.6 47295.5 46465.5 50679.5 47452.8 49415.4 48165.3 51814.0 49030.7 [2,] 50524.9 52095.0 51290.3 55064.0 52505.2 54318.3 53039.6 57607.6 54236.4 [3,] 56963.5 59152.8 57804.6 62541.5 59449.3 61704.7 60399.0 65724.7 62679.4 [4,] 63542.8 66198.0 64544.9 71041.8 66087.2 69005.8 66897.0 73702.0 68485.3 [5,] 71204.7 73783.9 71651.0 78541.6 72714.4 75258.0 73168.1 79701.6 73944.5 [,10] [,11] [,12] [1,] 50820.8 49729.5 53501.6 [2,] 56586.4 55614.0 60085.9 [3,] 65526.5 64274.8 68769.1 [4,] 71457.0 69774.6 76479.7 [5,] 76401.2 73948.1 80583.3 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 47765.08 49187.66 48438.93 51251.63 49852.29 51326.55 50607.4 54352.44 [2,] 66161.92 69117.94 67170.27 73831.37 69046.31 72082.85 70190.6 77096.96 [,9] [,10] [,11] [,12] [1,] 52611.16 55018.97 54268.96 57185.28 [2,] 72747.64 76034.03 74280.64 80352.92 $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(45564.6, 50524.9, 56963.5, 63542.8, 71204.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5cmsk1458568294.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,] 45564.60 50524.90 56963.50 63542.80 71204.70 NA [2,] 47374.15 52300.10 59301.05 66142.60 72941.25 NA [3,] 49223.05 54277.35 62123.10 68745.55 73946.30 NA [4,] 50750.15 56100.20 64900.65 71249.40 77471.40 NA [5,] 53501.60 60085.90 68769.10 76479.70 80583.30 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 47683.23 52544.1 59569.08 66416.3 71880.07 NA [2,] 50762.87 56010.6 64677.12 71074.8 76012.53 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(45564.6, 47374.15, 49223.05, 50750.15, 53501.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ecg01458568294.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,] 9968.575 24218.60 13017.90 [2,] 10130.709 25094.15 13719.70 [3,] 10342.799 25610.25 14204.75 [4,] 10928.813 26785.05 15424.20 [5,] 11396.835 27887.60 16393.80 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9978.779 24839.02 13427.32 [2,] 10706.820 26381.48 14982.18 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(9968.57467068387, 10130.7093614933, 10342.799322955, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dd411458568294.ps tmp/1dd411458568294.png",intern=TRUE)) character(0) > try(system("convert tmp/292xp1458568294.ps tmp/292xp1458568294.png",intern=TRUE)) character(0) > try(system("convert tmp/3vx7p1458568294.ps tmp/3vx7p1458568294.png",intern=TRUE)) character(0) > try(system("convert tmp/4avq41458568294.ps tmp/4avq41458568294.png",intern=TRUE)) character(0) > try(system("convert tmp/5cmsk1458568294.ps tmp/5cmsk1458568294.png",intern=TRUE)) character(0) > try(system("convert tmp/6ecg01458568294.ps tmp/6ecg01458568294.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.265 0.379 2.663