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(1329,1385,1681,1591,1598,1557,1190,932,1664,1717,1567,1355,1430,1863,1868,1711,1873,2095,1379,1021,1999,2094,2026,1390,1744,2117,1823,1963,1816,1966,1309,1250,2184,2295,1870,1222,1640,2194,2179,1976,1850,2077,1658,1156,2400,2218,1802,1444,1804,1541,2206,1972,1815,1749,1492,1307,1916,2035,1855,1086,1951,1733,1868,1532,1894,1586,1247,1212,2119,1931,1649,1296,1625,1454,1562,1612,1648,1412,1219,1207,1614,1537,1497,1141,1135,1368,1203,1201,1190,1347,607,914,1606,1518,1120,910) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1329 1430 1744 1640 1804 1951 1625 1135 NA [2,] 1385 1863 2117 2194 1541 1733 1454 1368 NA [3,] 1681 1868 1823 2179 2206 1868 1562 1203 NA [4,] 1591 1711 1963 1976 1972 1532 1612 1201 NA [5,] 1598 1873 1816 1850 1815 1894 1648 1190 NA [6,] 1557 2095 1966 2077 1749 1586 1412 1347 NA [7,] 1190 1379 1309 1658 1492 1247 1219 607 NA [8,] 932 1021 1250 1156 1307 1212 1207 914 NA [9,] 1664 1999 2184 2400 1916 2119 1614 1606 NA [10,] 1717 2094 2295 2218 2035 1931 1537 1518 NA [11,] 1567 2026 1870 1802 1855 1649 1497 1120 NA [12,] 1355 1390 1222 1444 1086 1296 1141 910 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/1jgke1426190998.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/286cr1426190998.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/3q2x41426190998.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/48hve1426190998.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] [1,] 1135.0 1368.0 1203.0 1201.0 1598.0 1347.0 1190.0 914.0 1606.0 1518 [2,] 1379.5 1419.5 1621.5 1561.5 1623.0 1484.5 1204.5 976.5 1639.0 1627 [3,] 1632.5 1637.0 1845.5 1661.5 1815.5 1667.5 1278.0 1181.5 1957.5 1983 [4,] 1774.0 1990.0 2023.5 1967.5 1861.5 2021.5 1435.5 1231.0 2151.5 2156 [5,] 1951.0 2194.0 2206.0 1976.0 1894.0 2095.0 1658.0 1307.0 2400.0 2295 [,11] [,12] [1,] 1120.0 910.0 [2,] 1532.0 1113.5 [3,] 1725.5 1259.0 [4,] 1862.5 1372.5 [5,] 2026.0 1444.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1412.127 1318.311 1620.937 1434.703 1682.27 1367.524 1148.96 1039.333 [2,] 1852.873 1955.689 2070.063 1888.297 1948.73 1967.476 1407.04 1323.667 [,9] [,10] [,11] [,12] [1,] 1671.21 1687.493 1540.878 1114.319 [2,] 2243.79 2278.507 1910.122 1403.681 $out [1] 1190 607 $group [1] 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1135, 1379.5, 1632.5, 1774, 1951, 1368, 1419.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kboe1426190998.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] [1,] 932 1021.0 1222.0 1156.0 1086.0 1212.0 1141.0 607.0 NA [2,] 1342 1410.0 1526.5 1649.0 1516.5 1414.0 1315.5 1017.0 NA [3,] 1562 1865.5 1846.5 1913.0 1809.5 1691.0 1517.0 1195.5 NA [4,] 1631 2012.5 2041.5 2186.5 1944.0 1912.5 1613.0 1357.5 NA [5,] 1717 2095.0 2295.0 2400.0 2206.0 2119.0 1648.0 1606.0 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1430.185 1590.696 1611.605 1667.843 1614.514 1463.631 1381.308 1040.196 [2,] 1693.815 2140.304 2081.395 2158.157 2004.486 1918.369 1652.692 1350.804 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(932, 1342, 1562, 1631, 1717, 1021, 1410, 1865.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67hdi1426190998.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,] 178.2839 534.0 195.500 [2,] 252.0195 726.0 229.625 [3,] 288.1774 785.5 331.750 [4,] 302.8575 866.0 463.000 [5,] 326.3336 1051.0 489.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 264.9898 721.6451 225.3061 [2,] 311.3649 849.3549 438.1939 $out [1] 149.5655 393.0000 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(178.283882774475, 252.019457024923, 288.177379456486, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jgke1426190998.ps tmp/1jgke1426190998.png",intern=TRUE)) character(0) > try(system("convert tmp/286cr1426190998.ps tmp/286cr1426190998.png",intern=TRUE)) character(0) > try(system("convert tmp/3q2x41426190998.ps tmp/3q2x41426190998.png",intern=TRUE)) character(0) > try(system("convert tmp/48hve1426190998.ps tmp/48hve1426190998.png",intern=TRUE)) character(0) > try(system("convert tmp/5kboe1426190998.ps tmp/5kboe1426190998.png",intern=TRUE)) character(0) > try(system("convert tmp/67hdi1426190998.ps tmp/67hdi1426190998.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.095 0.312 2.433