R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(203089,198480,192684,187827,182414,182510,211524,211451,200140,191568,186424,191987,203583,201920,195978,191395,188222,189422,214419,224325,216222,210506,207221,210027,215191,215177,211701,210176,205491,206996,235980,241292,236675,229127,225436,229570,239973,236168,230703,224790,217811,219576,245472,248511,242084,235572,229827,229697,239567,237201,233164,227755,220189,221270,245413,247826,237736,230079,225939,228987) > 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,] 203089 203583 215191 239973 239567 NA [2,] 198480 201920 215177 236168 237201 NA [3,] 192684 195978 211701 230703 233164 NA [4,] 187827 191395 210176 224790 227755 NA [5,] 182414 188222 205491 217811 220189 NA [6,] 182510 189422 206996 219576 221270 NA [7,] 211524 214419 235980 245472 245413 NA [8,] 211451 224325 241292 248511 247826 NA [9,] 200140 216222 236675 242084 237736 NA [10,] 191568 210506 229127 235572 230079 NA [11,] 186424 207221 225436 229827 225939 NA [12,] 191987 210027 229570 229697 228987 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/1ojiz1479554703.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/2r47i1479554703.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/3r21j1479554703.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/4n5eo1479554703.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,] 203089 198480 192684 187827 182414 182510 211524 211451 200140 191568 [2,] 203583 201920 195978 191395 188222 189422 214419 224325 216222 210506 [3,] 215191 215177 211701 210176 205491 206996 235980 241292 236675 229127 [4,] 239567 236168 230703 224790 217811 219576 245413 247826 237736 230079 [5,] 239973 237201 233164 227755 220189 221270 245472 248511 242084 235572 [,11] [,12] [1,] 186424 191987 [2,] 207221 210027 [3,] 225436 228987 [4,] 225939 229570 [5,] 229827 229697 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 189764.8 190977.4 187164.4 186579.2 184583.5 185689.3 214079.7 224686.3 [2,] 240617.2 239376.6 236237.6 233772.8 226398.5 228302.7 257880.3 257897.7 [,9] [,10] [,11] [,12] [1,] 221473.3 215296.8 212209.9 215178 [2,] 251876.7 242957.2 238662.1 242796 $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(203089, 203583, 215191, 239567, 239973, 198480, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5t04d1479554703.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,] 182414.0 188222.0 205491.0 217811.0 220189.0 NA [2,] 187125.5 193686.5 210938.5 227243.5 226847.0 NA [3,] 192335.5 205402.0 220313.5 233137.5 231621.5 NA [4,] 201614.5 212462.5 232775.0 241028.5 238651.5 NA [5,] 211524.0 224325.0 241292.0 248511.0 247826.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 185727 196838.1 210353.7 226850.1 226237.4 NA [2,] 198944 213965.9 230273.3 239424.9 237005.6 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(182414, 187125.5, 192335.5, 201614.5, 211524, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cuma1479554703.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,] 16237.65 33948.0 18718.0 [2,] 16935.81 37385.0 20543.5 [3,] 18016.52 38740.5 29871.5 [4,] 18387.85 41212.0 33821.5 [5,] 18868.23 44004.0 35984.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17354.24 36994.98 23815.32 [2,] 18678.80 40486.02 35927.68 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(16237.648244127, 16935.8148811303, 18016.5218736369, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ojiz1479554703.ps tmp/1ojiz1479554703.png",intern=TRUE)) character(0) > try(system("convert tmp/2r47i1479554703.ps tmp/2r47i1479554703.png",intern=TRUE)) character(0) > try(system("convert tmp/3r21j1479554703.ps tmp/3r21j1479554703.png",intern=TRUE)) character(0) > try(system("convert tmp/4n5eo1479554703.ps tmp/4n5eo1479554703.png",intern=TRUE)) character(0) > try(system("convert tmp/5t04d1479554703.ps tmp/5t04d1479554703.png",intern=TRUE)) character(0) > try(system("convert tmp/6cuma1479554703.ps tmp/6cuma1479554703.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.669 0.165 2.954