R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698,111203,110030,104009,99772,96301,97680,121563,134210,133111,124527,117589,115699,117830,115874,111267,107985,102185,102101,128932,135782,136971,126292,119260,117359,119818,116059,110046,104100,97981,97527,123700,129678,130790,120961,114232,110518,110959,108443,103977,97126,90860,91959,113735,119713,121905,112442,106728,104906,105308,102909,97849,93181,87470,86998,106716,115028,116828,108413,102628,99126) > 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,] 109843 111203 117830 119818 110959 105308 NA [2,] 106365 110030 115874 116059 108443 102909 NA [3,] 102304 104009 111267 110046 103977 97849 NA [4,] 97968 99772 107985 104100 97126 93181 NA [5,] 92462 96301 102185 97981 90860 87470 NA [6,] 92286 97680 102101 97527 91959 86998 NA [7,] 120092 121563 128932 123700 113735 106716 NA [8,] 126656 134210 135782 129678 119713 115028 NA [9,] 124144 133111 136971 130790 121905 116828 NA [10,] 114045 124527 126292 120961 112442 108413 NA [11,] 108120 117589 119260 114232 106728 102628 NA [12,] 105698 115699 117359 110518 104906 99126 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/1ovs31493065290.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/2t4uy1493065290.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/3po5w1493065290.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/4zdvj1493065290.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,] 105308 102909.0 97849 93181 87470.0 86998.0 106716.0 115028 116828 [2,] 109843 106365.0 102304 97126 90860.0 91959.0 113735.0 119713 121905 [3,] 111081 109236.5 103993 98870 94381.5 94906.5 120827.5 128167 127467 [4,] 117830 115874.0 110046 104100 97981.0 97680.0 123700.0 134210 133111 [5,] 119818 116059.0 111267 107985 102185.0 102101.0 128932.0 135782 136971 [,10] [,11] [,12] [1,] 108413 102628 99126 [2,] 112442 106728 104906 [3,] 117503 111176 108108 [4,] 124527 117589 115699 [5,] 126292 119260 117359 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105929.1 103102.9 98999.16 94371.54 89788.22 91216.27 114399.8 118816 [2,] 116232.9 115370.1 108986.84 103368.46 98974.78 98596.73 127255.2 137518 [,9] [,10] [,11] [,12] [1,] 120238.8 109707.8 104170.3 101146.2 [2,] 134695.2 125298.2 118181.7 115069.8 $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(105308, 109843, 111081, 117830, 119818, 102909, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53cxc1493065290.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,] 92286.0 96301.0 102101.0 97527.0 90860.0 86998.0 NA [2,] 100136.0 101890.5 109626.0 107073.0 100551.5 95515.0 NA [3,] 107242.5 113451.0 117594.5 115145.5 107585.5 102768.5 NA [4,] 117068.5 123045.0 127612.0 122330.5 113088.5 107564.5 NA [5,] 126656.0 134210.0 136971.0 130790.0 121905.0 116828.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99519.47 103802.3 109391 108186.5 101867.3 97272.64 NA [2,] 114965.53 123099.7 125798 122104.5 113303.7 108264.36 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(92286, 100136, 107242.5, 117068.5, 126656, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66rxj1493065290.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,] 5002.423 13150.0 5601.000 [2,] 5298.465 14612.5 5932.875 [3,] 5989.492 15867.5 7685.000 [4,] 7389.688 19188.0 9869.875 [5,] 8156.981 22216.0 11628.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5035.671 13780.58 5889.308 [2,] 6943.313 17954.42 9480.692 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5002.4230395546, 5298.46453206959, 5989.4919687725, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ovs31493065290.ps tmp/1ovs31493065290.png",intern=TRUE)) character(0) > try(system("convert tmp/2t4uy1493065290.ps tmp/2t4uy1493065290.png",intern=TRUE)) character(0) > try(system("convert tmp/3po5w1493065290.ps tmp/3po5w1493065290.png",intern=TRUE)) character(0) > try(system("convert tmp/4zdvj1493065290.ps tmp/4zdvj1493065290.png",intern=TRUE)) character(0) > try(system("convert tmp/53cxc1493065290.ps tmp/53cxc1493065290.png",intern=TRUE)) character(0) > try(system("convert tmp/66rxj1493065290.ps tmp/66rxj1493065290.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.165 0.415 3.756