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(2135,1157,1290,1071,1169,1431,945,1034,1100,1297,921,236,1990,966,1326,908,1206,1861,929,1296,1332,1352,1040,148,2090,1435,1124,1319,1436,1774,1566,1385,1147,1274,625,52,1990,1154,954,887,825,966,954,770,1838,1371,589,116,1898,712,1175,1240,1329,1550,1201,938,1030,1060,1035,635,2565,910,1304,1331,1681,1983,1021,1061,1292,1274,1024,568,2570,1125,1600,1492,2492,3523,990,869,1310,979,1244,442,2956,1055,2004,1462,1144,1454,4060,1538,1388,1547,4473,1570,1535,1352) > 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] 98 > (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] 9 9 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2135 1990 2090 1990 1898 2565 2570 2956 1535 [2,] 1157 966 1435 1154 712 910 1125 1055 1352 [3,] 1290 1326 1124 954 1175 1304 1600 2004 NA [4,] 1071 908 1319 887 1240 1331 1492 1462 NA [5,] 1169 1206 1436 825 1329 1681 2492 1144 NA [6,] 1431 1861 1774 966 1550 1983 3523 1454 NA [7,] 945 929 1566 954 1201 1021 990 4060 NA [8,] 1034 1296 1385 770 938 1061 869 1538 NA [9,] 1100 1332 1147 1838 1030 1292 1310 1388 NA [10,] 1297 1352 1274 1371 1060 1274 979 1547 NA [11,] 921 1040 625 589 1035 1024 1244 4473 NA [12,] 236 148 52 116 635 568 442 1570 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/13pbg1416758916.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/248r11416758916.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/3soax1416758916.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/4pkb71416758916.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,] 1535 712 954.0 887.0 825.0 966.0 929.0 770.0 1030.0 979.0 589.0 [2,] 1990 966 1149.5 989.5 1156.5 1442.5 949.5 903.5 1123.5 1167.0 773.0 [3,] 2090 1125 1297.0 1279.5 1267.5 1662.0 1005.5 1047.5 1301.0 1285.5 1029.5 [4,] 2565 1157 1463.0 1396.5 1558.5 1922.0 1383.5 1340.5 1360.0 1361.5 1142.0 [5,] 2956 1435 1600.0 1492.0 1681.0 1983.0 1566.0 1538.0 1388.0 1547.0 1244.0 [,12] [1,] 52.0 [2,] 132.0 [3,] 339.0 [4,] 601.5 [5,] 635.0 $n [1] 9 9 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1787.167 1024.407 1121.874 1052.144 1042.937 1394.144 763.0614 803.3855 [2,] 2392.833 1225.593 1472.126 1506.856 1492.063 1929.856 1247.9386 1291.6145 [,9] [,10] [,11] [,12] [1,] 1168.888 1176.85 823.3713 76.73056 [2,] 1433.112 1394.15 1235.6287 601.26944 $out [1] 2004 2492 3523 4060 1838 4473 1570 $group [1] 3 5 6 7 9 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1535, 1990, 2090, 2565, 2956, 712, 966, 1125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50ycc1416758916.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,] 921.0 908.0 625.0 116.0 635.0 568.0 442.0 1055.0 1352.0 [2,] 989.5 947.5 1135.5 797.5 984.0 1022.5 984.5 1421.0 1352.0 [3,] 1128.5 1251.0 1352.0 954.0 1117.5 1283.0 1277.0 1542.5 1443.5 [4,] 1293.5 1342.0 1501.0 1262.5 1284.5 1506.0 2046.0 2480.0 1535.0 [5,] 1431.0 1861.0 1774.0 1838.0 1550.0 1983.0 3523.0 4060.0 1535.0 $n [1] 12 12 12 12 12 12 12 12 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 989.8436 1071.066 1185.293 741.9104 980.4399 1062.472 792.8427 [2,] 1267.1564 1430.934 1518.707 1166.0896 1254.5601 1503.528 1761.1573 [,8] [,9] [1,] 1059.483 1239.047 [2,] 2025.517 1647.953 $out [1] 2135 236 1990 148 2090 52 1990 1898 2565 4473 $group [1] 1 1 2 2 3 3 4 5 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(921, 989.5, 1128.5, 1293.5, 1431, 908, 947.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6wud31416758916.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.5623 568.0 136.250 [2,] 241.8622 745.5 221.500 [3,] 377.0034 1235.5 334.000 [4,] 629.8189 2112.0 420.375 [5,] 1072.7225 3884.0 575.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 200.0538 612.2302 243.2918 [2,] 553.9531 1858.7698 424.7082 $out [1] 1273.46 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(178.562314053106, 241.862233488147, 377.0034386116, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13pbg1416758916.ps tmp/13pbg1416758916.png",intern=TRUE)) character(0) > try(system("convert tmp/248r11416758916.ps tmp/248r11416758916.png",intern=TRUE)) character(0) > try(system("convert tmp/3soax1416758916.ps tmp/3soax1416758916.png",intern=TRUE)) character(0) > try(system("convert tmp/4pkb71416758916.ps tmp/4pkb71416758916.png",intern=TRUE)) character(0) > try(system("convert tmp/50ycc1416758916.ps tmp/50ycc1416758916.png",intern=TRUE)) character(0) > try(system("convert tmp/6wud31416758916.ps tmp/6wud31416758916.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.129 0.405 2.563