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(2745,1395,1550,1378,1318,1395,1483,1049,783,1208,857,48,2681,1249,1705,1472,1413,1651,1525,1095,900,1255,984,101,2655,1309,1844,1825,1629,1718,1595,1539,1513,1475,1184,211,3387,1546,1955,1899,2415,3439,1148,1127,1186,1009,817,236,2762,1035,1500,1519,1539,1452,1409,1288,987,1542,1248,1400,4190,2185,1097,1215,1236,1374,1548,1178,902) > 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] 69 > (np <- floor(n / par1)) [1] 5 > 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 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2745 2681 2655 3387 2762 4190 [2,] 1395 1249 1309 1546 1035 2185 [3,] 1550 1705 1844 1955 1500 1097 [4,] 1378 1472 1825 1899 1519 1215 [5,] 1318 1413 1629 2415 1539 1236 [6,] 1395 1651 1718 3439 1452 1374 [7,] 1483 1525 1595 1148 1409 1548 [8,] 1049 1095 1539 1127 1288 1178 [9,] 783 900 1513 1186 987 902 [10,] 1208 1255 1475 1009 1542 NA [11,] 857 984 1184 817 1248 NA [12,] 48 101 211 236 1400 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/14jcw1416597628.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/2rm0p1416597628.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/3uzri1416597628.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/4idbg1416597628.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] [,12] [1,] 2655.0 1035 1097.0 1215.0 1236 1374.0 1409 1049.0 783.0 1009 817 48 [2,] 2681.0 1249 1500.0 1378.0 1318 1395.0 1409 1095.0 900.0 1208 857 101 [3,] 2753.5 1352 1627.5 1495.5 1476 1551.5 1504 1152.5 944.5 1255 984 211 [4,] 3387.0 1546 1844.0 1825.0 1629 1718.0 1548 1288.0 1186.0 1475 1184 236 [5,] 4190.0 1546 1955.0 1899.0 1629 1718.0 1595 1539.0 1513.0 1542 1248 236 $n [1] 6 6 6 6 6 6 6 6 6 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2298.107 1160.425 1405.609 1207.171 1275.395 1343.155 1414.341 1028.009 [2,] 3208.893 1543.575 1849.391 1783.829 1676.605 1759.845 1593.659 1276.991 [,9] [,10] [,11] [,12] [1,] 760.0208 1066.338 752.9426 115.6093 [2,] 1128.9792 1443.662 1215.0574 306.3907 $out [1] 2185 2415 3439 1148 1400 $group [1] 2 5 6 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2655, 2681, 2753.5, 3387, 4190, 1035, 1249, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pkiy1416597628.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] [1,] 783 900.0 1184.0 236 987.0 902 [2,] 953 1039.5 1392.0 1068 1268.0 1178 [3,] 1348 1334.0 1567.0 1366 1430.5 1236 [4,] 1439 1588.0 1771.5 2185 1529.0 1548 [5,] 1550 1705.0 1844.0 3439 1542.0 1548 $n [1] 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1126.332 1083.825 1393.908 856.5288 1311.456 1041.133 [2,] 1569.668 1584.175 1740.092 1875.4712 1549.544 1430.867 $out [1] 2745 48 2681 101 2655 211 2762 4190 2185 $group [1] 1 1 2 2 3 3 5 6 6 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(783, 953, 1348, 1439, 1550, 900, 1039.5, 1334, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z14i1416597628.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,] 161.3799 431.0 114.750 [2,] 203.4910 511.5 196.625 [3,] 284.6690 794.0 265.875 [4,] 496.3259 1265.5 311.875 [5,] 796.6318 2065.0 347.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 151.1051 450.0955 213.3087 [2,] 418.2330 1137.9045 318.4413 $out [1] 533.75 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(161.379883091625, 203.491044985985, 284.669020417631, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14jcw1416597628.ps tmp/14jcw1416597628.png",intern=TRUE)) character(0) > try(system("convert tmp/2rm0p1416597628.ps tmp/2rm0p1416597628.png",intern=TRUE)) character(0) > try(system("convert tmp/3uzri1416597628.ps tmp/3uzri1416597628.png",intern=TRUE)) character(0) > try(system("convert tmp/4idbg1416597628.ps tmp/4idbg1416597628.png",intern=TRUE)) character(0) > try(system("convert tmp/5pkiy1416597628.ps tmp/5pkiy1416597628.png",intern=TRUE)) character(0) > try(system("convert tmp/6z14i1416597628.ps tmp/6z14i1416597628.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.105 0.355 2.490