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(45570,45118,41921,40167,37315,39206,57075,58664,51705,45527,41057,40867,41484,39738,37254,35177,32846,34079,51287,52800,48443,42223,38796,38952,42343,42023,39340,37149,35431,36537,49626,58677,56009,50069,46470,45603,46729,46989,44666,42920,40125,40941,57748,61246,59809,52682,48394,47436,49750,48172,44960,41831,38672,39704,56207,59254,57374,51309,47083,45092,46353,45348,42867,39980,36790,37504,53331,55997,54764,48590,45565,44959) > 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,] 45570 41484 42343 46729 49750 46353 NA [2,] 45118 39738 42023 46989 48172 45348 NA [3,] 41921 37254 39340 44666 44960 42867 NA [4,] 40167 35177 37149 42920 41831 39980 NA [5,] 37315 32846 35431 40125 38672 36790 NA [6,] 39206 34079 36537 40941 39704 37504 NA [7,] 57075 51287 49626 57748 56207 53331 NA [8,] 58664 52800 58677 61246 59254 55997 NA [9,] 51705 48443 56009 59809 57374 54764 NA [10,] 45527 42223 50069 52682 51309 48590 NA [11,] 41057 38796 46470 48394 47083 45565 NA [12,] 40867 38952 45603 47436 45092 44959 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/14p4t1492772464.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/2io4v1492772464.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/3kkkb1492772464.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/4wr311492772464.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,] 41484.0 39738 37254 35177.0 32846.0 34079 49626 52800.0 48443.0 42223.0 [2,] 42343.0 42023 39340 37149.0 35431.0 36537 51287 55997.0 51705.0 45527.0 [3,] 45961.5 45233 42394 40073.5 37052.5 38355 54769 58670.5 55386.5 49329.5 [4,] 46729.0 46989 44666 41831.0 38672.0 39704 57075 59254.0 57374.0 51309.0 [5,] 49750.0 48172 44960 42920.0 40125.0 40941 57748 61246.0 59809.0 52682.0 [,11] [,12] [1,] 38796.0 38952.0 [2,] 41057.0 40867.0 [3,] 46017.5 45025.5 [4,] 47083.0 45603.0 [5,] 48394.0 47436.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 43132.39 42029.77 38958.56 37053.46 34961.95 36312.18 51035.55 56569.63 [2,] 48790.61 48436.23 45829.44 43093.54 39143.05 40397.82 58502.45 60771.37 [,9] [,10] [,11] [,12] [1,] 51729.81 45599.92 42130.54 41970.63 [2,] 59043.19 53059.08 49904.46 48080.37 $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(41484, 42343, 45961.5, 46729, 49750, 39738, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zth01492772464.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,] 37315.0 32846.0 35431.0 40125.0 38672.0 36790.0 NA [2,] 40517.0 36215.5 38244.5 43793.0 43395.5 41423.5 NA [3,] 43519.5 39345.0 43973.0 47212.5 47627.5 45456.5 NA [4,] 48637.5 45333.0 49847.5 55215.0 53758.0 50960.5 NA [5,] 58664.0 52800.0 58677.0 61246.0 59254.0 55997.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 39815.69 35186.45 38680.79 42002.85 42901.09 41106.61 NA [2,] 47223.31 43503.55 49265.21 52422.15 52353.91 49806.39 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(37315, 40517, 43519.5, 48637.5, 58664, 32846, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6oecq1492772464.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,] 2480.646 6862.0 2446.000 [2,] 2928.390 7724.5 3143.000 [3,] 3095.808 8350.0 3683.625 [4,] 3545.998 9041.0 4634.625 [5,] 4076.476 10459.0 5060.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2814.113 7749.536 3003.285 [2,] 3377.503 8950.464 4363.965 $out [1] 11366 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2480.64583660519, 2928.39028196821, 3095.80814122431, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14p4t1492772464.ps tmp/14p4t1492772464.png",intern=TRUE)) character(0) > try(system("convert tmp/2io4v1492772464.ps tmp/2io4v1492772464.png",intern=TRUE)) character(0) > try(system("convert tmp/3kkkb1492772464.ps tmp/3kkkb1492772464.png",intern=TRUE)) character(0) > try(system("convert tmp/4wr311492772464.ps tmp/4wr311492772464.png",intern=TRUE)) character(0) > try(system("convert tmp/5zth01492772464.ps tmp/5zth01492772464.png",intern=TRUE)) character(0) > try(system("convert tmp/6oecq1492772464.ps tmp/6oecq1492772464.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.512 0.399 4.130