R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(24158,24359,24628,25021,25315,25481,26043,26207,26466,26276,26236,26211,26265,25996,25794,25752,25491,25092,25759,25624,25138,25042,25014,25244,25493,25269,25170,25332,24966,24851,25518,25403,25028,24895,24905,25317,25718,25822,25967,25907,25940,26247,26900,26980,26677,26701,26808,27469,27586,27567,27508,27444,27380,27500,28217,28355,27627,27565,27496,27453,27705,27462,27152,27016,26836,26722,27391,27139,26644,26455,26294,26437,26954,26620,26307,26003,25798,25603,26242,26051,25658,25489,25425,25183,24774,24977,24980,25081,25240,25419,26309,26600,26690,26889,27109,27646,28330,28332,28202,28163,28077,28351,28950,28972,28812,28979,29112,29139) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 24158 26265 25493 25718 27586 27705 26954 24774 28330 NA [2,] 24359 25996 25269 25822 27567 27462 26620 24977 28332 NA [3,] 24628 25794 25170 25967 27508 27152 26307 24980 28202 NA [4,] 25021 25752 25332 25907 27444 27016 26003 25081 28163 NA [5,] 25315 25491 24966 25940 27380 26836 25798 25240 28077 NA [6,] 25481 25092 24851 26247 27500 26722 25603 25419 28351 NA [7,] 26043 25759 25518 26900 28217 27391 26242 26309 28950 NA [8,] 26207 25624 25403 26980 28355 27139 26051 26600 28972 NA [9,] 26466 25138 25028 26677 27627 26644 25658 26690 28812 NA [10,] 26276 25042 24895 26701 27565 26455 25489 26889 28979 NA [11,] 26236 25014 24905 26808 27496 26294 25425 27109 29112 NA [12,] 26211 25244 25317 27469 27453 26437 25183 27646 29139 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/1y9d91447864067.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/2kr5d1447864067.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/3ansy1447864067.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/4tc9f1447864067.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] [,11] [,12] [1,] 24158 24359 24628 25021 24966 24851 25518 25403 25028 24895 24905 25183 [2,] 25493 25269 25170 25332 25315 25419 26043 26051 25658 25489 25425 25317 [3,] 26265 25996 25967 25907 25798 25603 26309 26600 26644 26455 26294 26437 [4,] 27586 27462 27152 27016 26836 26722 27391 27139 26690 26889 27109 27469 [5,] 28330 28332 28202 28163 28077 28351 28950 28355 27627 28979 29112 29139 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25162.69 24841.02 24923.15 25020.09 24996.94 24916.75 25599.05 26026.99 [2,] 27367.31 27150.98 27010.85 26793.91 26599.06 26289.25 27018.95 27173.01 [,9] [,10] [,11] [,12] [1,] 26100.48 25717.67 25407.09 25303.61 [2,] 27187.52 27192.33 27180.91 27570.39 $out [1] 28972 28812 $group [1] 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(24158, 25493, 26265, 27586, 28330, 24359, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5guo31447864067.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] [,8] [,9] [1,] 24158.0 25014.0 24851.0 25718.0 27380.0 26294.0 25183.0 24774.0 28077.0 [2,] 24824.5 25115.0 24935.5 25923.5 27474.5 26549.5 25546.0 25030.5 28266.0 [3,] 25762.0 25557.5 25219.5 26462.0 27536.5 26926.0 25900.5 25864.0 28581.5 [4,] 26223.5 25776.5 25367.5 26854.0 27606.5 27271.5 26274.5 26789.5 28975.5 [5,] 26466.0 26265.0 25518.0 27469.0 27627.0 27705.0 26954.0 27646.0 29139.0 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25123.91 25255.79 25022.46 26037.59 27476.29 26596.69 25568.23 25061.71 [2,] 26400.09 25859.21 25416.54 26886.41 27596.71 27255.31 26232.77 26666.29 [,9] [,10] [1,] 28257.89 NA [2,] 28905.11 NA $out [1] 28217 28355 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(24158, 24824.5, 25762, 26223.5, 26466, 25014, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ihrs1447864067.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,] 1073.302 3111.0 1032.0 [2,] 1170.748 3466.0 1325.5 [3,] 1210.437 3679.0 1602.5 [4,] 1331.766 4028.5 2037.5 [5,] 1417.550 4207.0 2193.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1136.996 3422.44 1277.752 [2,] 1283.879 3935.56 1927.248 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1073.3020828784, 1170.74797215412, 1210.43748460464, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1y9d91447864067.ps tmp/1y9d91447864067.png",intern=TRUE)) character(0) > try(system("convert tmp/2kr5d1447864067.ps tmp/2kr5d1447864067.png",intern=TRUE)) character(0) > try(system("convert tmp/3ansy1447864067.ps tmp/3ansy1447864067.png",intern=TRUE)) character(0) > try(system("convert tmp/4tc9f1447864067.ps tmp/4tc9f1447864067.png",intern=TRUE)) character(0) > try(system("convert tmp/5guo31447864067.ps tmp/5guo31447864067.png",intern=TRUE)) character(0) > try(system("convert tmp/6ihrs1447864067.ps tmp/6ihrs1447864067.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.186 0.329 2.540