R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(1095,1085,1075,1054,1261,1250,1095,992,1002,1002,1013,1033,1095,1075,1106,1157,1447,1447,1385,1323,1374,1436,1447,1478,1571,1509,1509,1602,1860,1881,1829,1705,1798,1798,1808,1860,1901,1922,1922,1984,2222,2284,2294,2139,2222,2191,2129,2263,2294,2242,2253,2325,2594,2728,2728,2666,2759,2666,2614,2811,2842,2769,2955,3028,3245,3389,3369,3358,3441,3431,3307,3493,3555,3493,3751,3875,4164,4278,4247,4185,4237,4299,4092,4257,4361,4319,4588,4681,5074,5146,5053,5105,5136,5167,4970,5156,5259,5156,5456,5549,5952,6014,6034,6138,6138,6179,5993,6086,6148,6034,6365,6427,6840,6913,7016,7109,7119,7130,6944,7130) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 1095 1095 1571 1901 2294 2842 3555 4361 5259 6148 NA [2,] 1085 1075 1509 1922 2242 2769 3493 4319 5156 6034 NA [3,] 1075 1106 1509 1922 2253 2955 3751 4588 5456 6365 NA [4,] 1054 1157 1602 1984 2325 3028 3875 4681 5549 6427 NA [5,] 1261 1447 1860 2222 2594 3245 4164 5074 5952 6840 NA [6,] 1250 1447 1881 2284 2728 3389 4278 5146 6014 6913 NA [7,] 1095 1385 1829 2294 2728 3369 4247 5053 6034 7016 NA [8,] 992 1323 1705 2139 2666 3358 4185 5105 6138 7109 NA [9,] 1002 1374 1798 2222 2759 3441 4237 5136 6138 7119 NA [10,] 1002 1436 1798 2191 2666 3431 4299 5167 6179 7130 NA [11,] 1013 1447 1808 2129 2614 3307 4092 4970 5993 6944 NA [12,] 1033 1478 1860 2263 2811 3493 4257 5156 6086 7130 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/1887v1408352813.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/2mnqe1408352813.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/39c111408352813.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/4t1si1408352813.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,] 1095 1075.0 1075 1054.0 1261.0 1250.0 1095.0 992 1002 1002.0 1013.0 1033 [2,] 1571 1509.0 1509 1602.0 1860.0 1881.0 1829.0 1705 1798 1798.0 1808.0 1860 [3,] 2568 2505.5 2604 2676.5 2919.5 3058.5 3048.5 3012 3100 3048.5 2960.5 3152 [4,] 4361 4319.0 4588 4681.0 5074.0 5146.0 5053.0 5105 5136 5167.0 4970.0 5156 [5,] 6148 6034.0 6365 6427.0 6840.0 6913.0 7016.0 7109 7119 7130.0 6944.0 7130 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1174.005 1101.512 1065.609 1138.109 1313.657 1427.176 1437.661 1313.224 [2,] 3961.995 3909.488 4142.391 4214.891 4525.343 4689.824 4659.339 4710.776 [,9] [,10] [,11] [,12] [1,] 1432.202 1365.213 1380.639 1505.187 [2,] 4767.798 4731.787 4540.361 4798.813 $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(1095, 1571, 2568, 4361, 6148, 1075, 1509, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yc261408352813.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] [,10] [1,] 992.0 1075.0 1509.0 1901.0 2242.0 2769.0 3493.0 4319.0 5156.0 6034.0 [2,] 1007.5 1131.5 1586.5 1953.0 2309.5 2991.5 3813.0 4634.5 5502.5 6396.0 [3,] 1064.5 1379.5 1798.0 2165.0 2640.0 3332.5 4174.5 5063.5 6003.5 6928.5 [4,] 1095.0 1447.0 1844.5 2242.5 2728.0 3410.0 4252.0 5141.0 6112.0 7114.0 [5,] 1095.0 1478.0 1881.0 2294.0 2811.0 3493.0 4299.0 5167.0 6179.0 7130.0 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1024.591 1235.598 1680.324 2032.957 2449.119 3141.619 3974.269 4832.482 [2,] 1104.409 1523.402 1915.676 2297.043 2830.881 3523.381 4374.731 5294.518 [,9] [,10] [,11] [1,] 5725.503 6601.015 NA [2,] 6281.497 7255.985 NA $out [1] 1261 1250 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(992, 1007.5, 1064.5, 1095, 1095, 1075, 1131.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6pwt31408352813.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,] 1738.664 4959.0 2500.250 [2,] 1882.055 5331.5 2774.250 [3,] 1996.638 5792.0 2901.125 [4,] 2069.971 6107.0 2988.875 [5,] 2103.985 6128.0 3061.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1910.928 5438.289 2803.233 [2,] 2082.347 6145.711 2999.017 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1738.66361196051, 1882.05532630684, 1996.63759420218, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1887v1408352813.ps tmp/1887v1408352813.png",intern=TRUE)) character(0) > try(system("convert tmp/2mnqe1408352813.ps tmp/2mnqe1408352813.png",intern=TRUE)) character(0) > try(system("convert tmp/39c111408352813.ps tmp/39c111408352813.png",intern=TRUE)) character(0) > try(system("convert tmp/4t1si1408352813.ps tmp/4t1si1408352813.png",intern=TRUE)) character(0) > try(system("convert tmp/5yc261408352813.ps tmp/5yc261408352813.png",intern=TRUE)) character(0) > try(system("convert tmp/6pwt31408352813.ps tmp/6pwt31408352813.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.152 0.328 2.508