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(1795,1756,2237,1960,1829,2524,2077,2366,2185,2098,1836,1863,2044,2136,2931,3263,3328,3570,2313,1623,1316,1507,1419,1660,1790,1733,2086,1814,2241,1943,1773,2143,2087,1805,1913,2296,2500,2210,2526,2249,2024,2091,2045,1882,1831,1964,1763,1688,2149,1823,2094,2145,1790,1996,2097,1795,1963,2041,1746,2210,2949,3110,3716,3014,1515,1498,1366,1607,1757,1623,1451,1765) > 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,] 1795 2044 1790 2500 2149 2949 NA [2,] 1756 2136 1733 2210 1823 3110 NA [3,] 2237 2931 2086 2526 2094 3716 NA [4,] 1960 3263 1814 2249 2145 3014 NA [5,] 1829 3328 2241 2024 1790 1515 NA [6,] 2524 3570 1943 2091 1996 1498 NA [7,] 2077 2313 1773 2045 2097 1366 NA [8,] 2366 1623 2143 1882 1795 1607 NA [9,] 2185 1316 2087 1831 1963 1757 NA [10,] 2098 1507 1805 1964 2041 1623 NA [11,] 1836 1419 1913 1763 1746 1451 NA [12,] 1863 1660 2296 1688 2210 1765 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/1su291448194201.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/27c831448194201.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/3yv301448194201.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/49at01448194201.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] [1,] 1790.0 1733.0 2086.0 1814 1515.0 1498.0 1366 1607.0 1316 1507.0 1419.0 [2,] 1795.0 1756.0 2094.0 1960 1790.0 1943.0 1773 1623.0 1757 1623.0 1451.0 [3,] 2096.5 1979.5 2381.5 2197 1926.5 2043.5 2061 1838.5 1897 1884.5 1754.5 [4,] 2500.0 2210.0 2931.0 3014 2241.0 2524.0 2097 2143.0 2087 2041.0 1836.0 [5,] 2949.0 2210.0 3716.0 3263 2241.0 2524.0 2313 2366.0 2185 2098.0 1913.0 [,12] [1,] 1660 [2,] 1688 [3,] 1814 [4,] 2210 [5,] 2296 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1641.752 1686.655 1841.608 1517.136 1635.59 1668.736 1852.01 1503.083 [2,] 2551.248 2272.345 2921.392 2876.864 2217.41 2418.264 2269.99 2173.917 [,9] [,10] [,11] [,12] [1,] 1684.139 1614.876 1506.163 1477.293 [2,] 2109.861 2154.124 2002.837 2150.707 $out [1] 3110 3328 3570 $group [1] 2 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1790, 1795, 2096.5, 2500, 2949, 1733, 1756, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qebl1448194201.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,] 1756.0 1316 1733.0 1688.0 1746.0 1366.0 NA [2,] 1832.5 1565 1797.5 1856.5 1809.0 1506.5 NA [3,] 2018.5 2090 1928.0 2034.5 2018.5 1690.0 NA [4,] 2211.0 3097 2115.0 2229.5 2121.0 2981.5 NA [5,] 2524.0 3570 2296.0 2526.0 2210.0 3716.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1845.864 1391.245 1783.186 1864.372 1876.195 1017.243 NA [2,] 2191.136 2788.755 2072.814 2204.628 2160.805 2362.757 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1756, 1832.5, 2018.5, 2211, 2524, 1316, 1565, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68eg21448194201.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,] 204.9624 494.0 251.000 [2,] 286.7506 697.5 323.125 [3,] 390.6639 1053.0 413.875 [4,] 612.6995 1539.5 507.250 [5,] 716.1767 2072.0 700.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 241.9964 668.9581 329.8944 [2,] 539.3313 1437.0419 497.8556 $out [1] 816.5 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(204.962435582718, 286.75064304489, 390.663852634023, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1su291448194201.ps tmp/1su291448194201.png",intern=TRUE)) character(0) > try(system("convert tmp/27c831448194201.ps tmp/27c831448194201.png",intern=TRUE)) character(0) > try(system("convert tmp/3yv301448194201.ps tmp/3yv301448194201.png",intern=TRUE)) character(0) > try(system("convert tmp/49at01448194201.ps tmp/49at01448194201.png",intern=TRUE)) character(0) > try(system("convert tmp/5qebl1448194201.ps tmp/5qebl1448194201.png",intern=TRUE)) character(0) > try(system("convert tmp/68eg21448194201.ps tmp/68eg21448194201.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.496 0.386 2.891