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(1850.07,1841.55,1845,1844.01,1842.67,1842.67,1842.67,1842.9,1840.37,1841.59,1844.33,1844.33,1844.33,1845.39,1861.84,1862.85,1869.46,1870.8,1870.8,1871.52,1875.52,1880.38,1885.05,1886.42,1886.42,1891.65,1903.11,1905.29,1904.26,1905.37,1905.37,1905.12,1908.62,1915.08,1916.36,1916.68,1916.24,1922.05,1922.63,1922.47,1920.64,1920.66,1920.66,1921.19,1921.44,1921.73,1921.81,1921.81,1921.81,1921.48,1917.07,1912.64,1901.15,1898.12,1900.02,1900.02,1900.82,1901.9,1902.19,1901.84,1903.73,1889.7,1891.27,1894.48,1894.27,1893.98,1893.98,1895.62,1901.72,1905.4,1898.14,1898.09) > 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,] 1850.07 1844.33 1886.42 1916.24 1921.81 1903.73 NA [2,] 1841.55 1845.39 1891.65 1922.05 1921.48 1889.70 NA [3,] 1845.00 1861.84 1903.11 1922.63 1917.07 1891.27 NA [4,] 1844.01 1862.85 1905.29 1922.47 1912.64 1894.48 NA [5,] 1842.67 1869.46 1904.26 1920.64 1901.15 1894.27 NA [6,] 1842.67 1870.80 1905.37 1920.66 1898.12 1893.98 NA [7,] 1842.67 1870.80 1905.37 1920.66 1900.02 1893.98 NA [8,] 1842.90 1871.52 1905.12 1921.19 1900.02 1895.62 NA [9,] 1840.37 1875.52 1908.62 1921.44 1900.82 1901.72 NA [10,] 1841.59 1880.38 1915.08 1921.73 1901.90 1905.40 NA [11,] 1844.33 1885.05 1916.36 1921.81 1902.19 1898.14 NA [12,] 1844.33 1886.42 1916.68 1921.81 1901.84 1898.09 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/1co6p1416497792.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/2mnfs1416497792.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/36wy01416497792.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/4iza31416497792.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] [1,] 1844.330 1841.550 1845.00 1844.010 1842.67 1842.67 1842.67 1842.90 1840.37 [2,] 1850.070 1845.390 1861.84 1862.850 1869.46 1870.80 1870.80 1871.52 1875.52 [3,] 1895.075 1890.675 1897.19 1899.885 1897.71 1896.05 1897.00 1897.82 1901.27 [4,] 1916.240 1921.480 1917.07 1912.640 1904.26 1905.37 1905.37 1905.12 1908.62 [5,] 1921.810 1922.050 1922.63 1922.470 1920.64 1920.66 1920.66 1921.19 1921.44 [,10] [,11] [,12] [1,] 1841.59 1844.330 1844.330 [2,] 1880.38 1885.050 1886.420 [3,] 1903.65 1900.165 1899.965 [4,] 1915.08 1916.360 1916.680 [5,] 1921.73 1921.810 1921.810 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1852.393 1841.594 1861.565 1867.769 1875.263 1873.751 1874.701 1876.147 [2,] 1937.757 1939.756 1932.815 1932.001 1920.157 1918.349 1919.299 1919.493 [,9] [,10] [,11] [,12] [1,] 1879.919 1881.267 1879.969 1880.446 [2,] 1922.621 1926.033 1920.361 1919.484 $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(1844.33, 1850.07, 1895.075, 1916.24, 1921.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xfab1416497792.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,] 1840.370 1844.330 1891.650 1920.640 1898.120 1889.70 NA [2,] 1842.130 1862.345 1903.685 1920.660 1900.420 1893.98 NA [3,] 1842.785 1870.800 1905.330 1921.585 1901.870 1895.05 NA [4,] 1844.330 1877.950 1911.850 1921.930 1914.855 1899.93 NA [5,] 1845.000 1886.420 1916.680 1922.630 1921.810 1905.40 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1841.782 1863.682 1901.606 1921.006 1895.286 1892.336 NA [2,] 1843.788 1877.918 1909.054 1922.164 1908.454 1897.764 NA $out [1] 1850.07 1886.42 1916.24 $group [1] 1 3 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1840.37, 1842.13, 1842.785, 1844.33, 1845, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6is7a1416497792.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,] 27.76709 77.480 23.63250 [2,] 27.90229 77.555 25.67500 [3,] 28.60881 77.990 27.20000 [4,] 30.75857 79.300 42.21375 [5,] 33.26090 81.070 57.55500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 27.30604 77.19409 19.65657 [2,] 29.91158 78.78591 34.74343 $out [1] 35.2877 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(27.7670891524481, 27.9022934085108, 28.6088093343914, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1co6p1416497792.ps tmp/1co6p1416497792.png",intern=TRUE)) character(0) > try(system("convert tmp/2mnfs1416497792.ps tmp/2mnfs1416497792.png",intern=TRUE)) character(0) > try(system("convert tmp/36wy01416497792.ps tmp/36wy01416497792.png",intern=TRUE)) character(0) > try(system("convert tmp/4iza31416497792.ps tmp/4iza31416497792.png",intern=TRUE)) character(0) > try(system("convert tmp/5xfab1416497792.ps tmp/5xfab1416497792.png",intern=TRUE)) character(0) > try(system("convert tmp/6is7a1416497792.ps tmp/6is7a1416497792.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.112 0.396 2.537