R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(1855.87,1868.53,1865.71,1872.59,1875.95,1875.95,1875.95,1878.08,1878.26,1876.39,1876.77,1876.88,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) > 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,] 1855.87 1876.88 1850.07 1844.33 1886.42 1916.24 NA [2,] 1868.53 1876.68 1841.55 1845.39 1891.65 1922.05 NA [3,] 1865.71 1865.52 1845.00 1861.84 1903.11 1922.63 NA [4,] 1872.59 1858.99 1844.01 1862.85 1905.29 1922.47 NA [5,] 1875.95 1856.87 1842.67 1869.46 1904.26 1920.64 NA [6,] 1875.95 1858.22 1842.67 1870.80 1905.37 1920.66 NA [7,] 1875.95 1858.22 1842.67 1870.80 1905.37 1920.66 NA [8,] 1878.08 1859.32 1842.90 1871.52 1905.12 1921.19 NA [9,] 1878.26 1859.52 1840.37 1875.52 1908.62 1921.44 NA [10,] 1876.39 1852.48 1841.59 1880.38 1915.08 1921.73 NA [11,] 1876.77 1850.07 1844.33 1885.05 1916.36 1921.81 NA [12,] 1876.88 1850.07 1844.33 1886.42 1916.68 1921.81 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/fisher/rcomp/tmp/1hlb31355485666.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/fisher/rcomp/tmp/2gv1j1355485666.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/fisher/rcomp/tmp/3864h1355485666.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/fisher/rcomp/tmp/42dqq1355485666.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] [1,] 1844.330 1841.550 1845.000 1844.01 1842.670 1842.670 1842.670 1842.90 [2,] 1850.070 1845.390 1861.840 1858.99 1856.870 1858.220 1858.220 1859.32 [3,] 1866.375 1872.605 1865.615 1867.72 1872.705 1873.375 1873.375 1874.80 [4,] 1886.420 1891.650 1903.110 1905.29 1904.260 1905.370 1905.370 1905.12 [5,] 1916.240 1922.050 1922.630 1922.47 1920.640 1920.660 1920.660 1921.19 [,9] [,10] [,11] [,12] [1,] 1840.37 1841.590 1844.33 1844.33 [2,] 1859.52 1852.480 1850.07 1850.07 [3,] 1876.89 1878.385 1880.91 1881.65 [4,] 1908.62 1915.080 1916.36 1916.68 [5,] 1921.44 1921.730 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,] 1842.928 1842.766 1838.995 1837.855 1842.137 1842.962 1842.962 1845.258 [2,] 1889.822 1902.444 1892.235 1897.585 1903.273 1903.788 1903.788 1904.342 [,9] [,10] [,11] [,12] [1,] 1845.219 1838.006 1838.151 1838.684 [2,] 1908.561 1918.764 1923.669 1924.616 $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, 1866.375, 1886.42, 1916.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/53oen1355485666.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,] 1865.710 1850.070 1840.370 1844.330 1891.650 1920.640 NA [2,] 1870.560 1854.675 1842.130 1862.345 1903.685 1920.660 NA [3,] 1875.950 1858.605 1842.785 1870.800 1905.330 1921.585 NA [4,] 1876.825 1862.520 1844.330 1877.950 1911.850 1921.930 NA [5,] 1878.260 1865.520 1845.000 1886.420 1916.680 1922.630 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1873.092 1855.027 1841.782 1863.682 1901.606 1921.006 NA [2,] 1878.808 1862.183 1843.788 1877.918 1909.054 1922.164 NA $out [1] 1855.87 1876.88 1876.68 1850.07 1886.42 1916.24 $group [1] 1 2 2 3 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1865.71, 1870.56, 1875.95, 1876.825, 1878.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6f5vn1355485666.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.18404 77.480 31.00000 [2,] 29.18607 77.555 36.32000 [3,] 29.62250 77.990 36.94625 [4,] 31.21541 79.300 42.72875 [5,] 32.46203 81.070 51.78750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 28.69691 77.19409 34.02318 [2,] 30.54809 78.78591 39.86932 $out [1] 71.9100 52.3425 $group [1] 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(27.1840385152759, 29.1860725346868, 29.6225001758918, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hlb31355485666.ps tmp/1hlb31355485666.png",intern=TRUE)) character(0) > try(system("convert tmp/2gv1j1355485666.ps tmp/2gv1j1355485666.png",intern=TRUE)) character(0) > try(system("convert tmp/3864h1355485666.ps tmp/3864h1355485666.png",intern=TRUE)) character(0) > try(system("convert tmp/42dqq1355485666.ps tmp/42dqq1355485666.png",intern=TRUE)) character(0) > try(system("convert tmp/53oen1355485666.ps tmp/53oen1355485666.png",intern=TRUE)) character(0) > try(system("convert tmp/6f5vn1355485666.ps tmp/6f5vn1355485666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.197 0.865 4.050