R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(1876.88,1876.68,1865.52,1858.99,1856.87,1858.22,1858.22,1859.32,1859.52,1852.48,1850.07,1850.07,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) > 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,] 1876.88 1850.07 1844.33 1886.42 1916.24 1921.81 NA [2,] 1876.68 1841.55 1845.39 1891.65 1922.05 1921.48 NA [3,] 1865.52 1845.00 1861.84 1903.11 1922.63 1917.07 NA [4,] 1858.99 1844.01 1862.85 1905.29 1922.47 1912.64 NA [5,] 1856.87 1842.67 1869.46 1904.26 1920.64 1901.15 NA [6,] 1858.22 1842.67 1870.80 1905.37 1920.66 1898.12 NA [7,] 1858.22 1842.67 1870.80 1905.37 1920.66 1900.02 NA [8,] 1859.32 1842.90 1871.52 1905.12 1921.19 1900.02 NA [9,] 1859.52 1840.37 1875.52 1908.62 1921.44 1900.82 NA [10,] 1852.48 1841.59 1880.38 1915.08 1921.73 1901.90 NA [11,] 1850.07 1844.33 1885.05 1916.36 1921.81 1902.19 NA [12,] 1850.07 1844.33 1886.42 1916.68 1921.81 1901.84 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/1x4pp1386236276.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/255b01386236276.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/39ukv1386236276.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/4zqob1386236276.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.33 1841.550 1845.000 1844.01 1842.670 1842.67 1842.67 1842.90 1840.37 [2,] 1850.07 1845.390 1861.840 1858.99 1856.870 1858.22 1858.22 1859.32 1859.52 [3,] 1881.65 1884.165 1884.315 1884.07 1885.305 1884.46 1885.41 1885.77 1888.17 [4,] 1916.24 1921.480 1917.070 1912.64 1904.260 1905.37 1905.37 1905.12 1908.62 [5,] 1921.81 1922.050 1922.630 1922.47 1920.640 1920.66 1920.66 1921.19 1921.44 [,10] [,11] [,12] [1,] 1841.59 1844.33 1844.33 [2,] 1852.48 1850.07 1850.07 [3,] 1891.14 1893.62 1894.13 [4,] 1915.08 1916.36 1916.68 [5,] 1921.73 1921.81 1921.81 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1838.968 1835.084 1848.69 1849.464 1854.737 1854.047 1854.997 1856.228 [2,] 1924.332 1933.246 1919.94 1918.676 1915.873 1914.873 1915.823 1915.312 [,9] [,10] [,11] [,12] [1,] 1856.499 1850.761 1850.861 1851.164 [2,] 1919.841 1931.519 1936.379 1937.096 $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, 1881.65, 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/5ip4u1386236276.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,] 1850.070 1840.370 1844.330 1891.650 1920.640 1898.120 NA [2,] 1854.675 1842.130 1862.345 1903.685 1920.660 1900.420 NA [3,] 1858.605 1842.785 1870.800 1905.330 1921.585 1901.870 NA [4,] 1862.520 1844.330 1877.950 1911.850 1921.930 1914.855 NA [5,] 1865.520 1845.000 1886.420 1916.680 1922.630 1921.810 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1855.027 1841.782 1863.682 1901.606 1921.006 1895.286 NA [2,] 1862.183 1843.788 1877.918 1909.054 1922.164 1908.454 NA $out [1] 1876.88 1876.68 1850.07 1886.42 1916.24 $group [1] 1 1 2 4 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1850.07, 1854.675, 1858.605, 1862.52, 1865.52, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/655rd1386236276.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,] 30.11952 77.480 41.47500 [2,] 30.47438 77.555 42.90875 [3,] 32.43918 77.990 50.83375 [4,] 33.15067 79.300 53.07125 [5,] 35.36350 81.070 60.81000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 31.21850 77.19409 46.19857 [2,] 33.65985 78.78591 55.46893 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(30.1195172604077, 30.4743823657418, 32.439177182259, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1x4pp1386236276.ps tmp/1x4pp1386236276.png",intern=TRUE)) character(0) > try(system("convert tmp/255b01386236276.ps tmp/255b01386236276.png",intern=TRUE)) character(0) > try(system("convert tmp/39ukv1386236276.ps tmp/39ukv1386236276.png",intern=TRUE)) character(0) > try(system("convert tmp/4zqob1386236276.ps tmp/4zqob1386236276.png",intern=TRUE)) character(0) > try(system("convert tmp/5ip4u1386236276.ps tmp/5ip4u1386236276.png",intern=TRUE)) character(0) > try(system("convert tmp/655rd1386236276.ps tmp/655rd1386236276.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.876 1.075 5.921