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(530.3,527.76,521.41,1601.93,1577.49,1551.43,1551.43,1516.88,1485.95,1438.22,1385.06,1329.49,1329.49,1276.16,1242.34,1181.59,1160.21,1135.18,1135.18,1084.96,1077.35,1061.13,1029.98,1013.08,1013.08,996.04,975.02,951.89,944.4,932.47,932.47,920.44,900.18,886.9,867.74,859.03,859.03,844.99,834.82,825.62,816.92,813.21,813.21,811.03,804.16,788.62,778.76,765.91,765.91,753.85,742.22,732.11,729.94,731.22,731.22,729.11,726.94,720.52,709.36,703.21,703.21,695.88,681.63,672.1,665.49,658.93,658.93,656,650.66,645.93,638.74,634.67) > 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,] 530.30 1329.49 1013.08 859.03 765.91 703.21 NA [2,] 527.76 1276.16 996.04 844.99 753.85 695.88 NA [3,] 521.41 1242.34 975.02 834.82 742.22 681.63 NA [4,] 1601.93 1181.59 951.89 825.62 732.11 672.10 NA [5,] 1577.49 1160.21 944.40 816.92 729.94 665.49 NA [6,] 1551.43 1135.18 932.47 813.21 731.22 658.93 NA [7,] 1551.43 1135.18 932.47 813.21 731.22 658.93 NA [8,] 1516.88 1084.96 920.44 811.03 729.11 656.00 NA [9,] 1485.95 1077.35 900.18 804.16 726.94 650.66 NA [10,] 1438.22 1061.13 886.90 788.62 720.52 645.93 NA [11,] 1385.06 1029.98 867.74 778.76 709.36 638.74 NA [12,] 1329.49 1013.08 859.03 765.91 703.21 634.67 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/195jo1353927206.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/2zifc1353927206.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/34dy21353927206.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/4ouq61353927206.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,] 530.30 527.76 521.41 672.100 665.49 658.93 658.93 656.000 650.66 [2,] 703.21 695.88 681.63 732.110 729.94 731.22 731.22 729.110 726.94 [3,] 812.47 799.42 788.52 888.755 880.66 872.84 872.84 865.735 852.17 [4,] 1013.08 996.04 975.02 1181.590 1160.21 1135.18 1135.18 1084.960 1077.35 [5,] 1329.49 1276.16 1242.34 1601.930 1577.49 1551.43 1551.43 1516.880 1485.95 [,10] [,11] [,12] [1,] 645.93 638.74 634.67 [2,] 720.52 709.36 703.21 [3,] 837.76 823.25 812.47 [4,] 1061.13 1029.98 1013.08 [5,] 1438.22 1385.06 1329.49 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 612.5938 605.8071 599.274 598.8259 603.122 612.2728 612.2728 [2,] 1012.3462 993.0329 977.766 1178.6841 1158.198 1133.4072 1133.4072 [,8] [,9] [,10] [,11] [,12] [1,] 636.2003 626.1442 618.0555 616.4397 612.5938 [2,] 1095.2697 1078.1958 1057.4645 1030.0603 1012.3462 $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(530.3, 703.21, 812.47, 1013.08, 1329.49, 527.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qu5r1353927206.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,] 521.410 1013.080 859.030 765.91 709.360 634.670 NA [2,] 929.895 1069.240 893.540 796.39 723.730 648.295 NA [3,] 1462.085 1135.180 932.470 813.21 730.580 658.930 NA [4,] 1551.430 1211.965 963.455 830.22 737.165 676.865 NA [5,] 1601.930 1329.490 1013.080 859.03 753.850 703.210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1178.599 1070.082 900.5813 797.7799 724.4522 645.899 NA [2,] 1745.571 1200.278 964.3587 828.6401 736.7078 671.961 NA $out [1] 765.91 703.21 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(521.41, 929.895, 1462.085, 1551.43, 1601.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zaof1353927206.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,] 251.3859 694.82 243.1925 [2,] 266.8190 747.36 255.6825 [3,] 297.8545 817.24 283.4200 [4,] 330.1867 892.50 332.7850 [5,] 348.4536 929.83 368.6775 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 268.9521 751.0407 248.253 [2,] 326.7569 883.4393 318.587 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(251.385914296459, 266.819031092903, 297.854515235631, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/195jo1353927206.ps tmp/195jo1353927206.png",intern=TRUE)) character(0) > try(system("convert tmp/2zifc1353927206.ps tmp/2zifc1353927206.png",intern=TRUE)) character(0) > try(system("convert tmp/34dy21353927206.ps tmp/34dy21353927206.png",intern=TRUE)) character(0) > try(system("convert tmp/4ouq61353927206.ps tmp/4ouq61353927206.png",intern=TRUE)) character(0) > try(system("convert tmp/5qu5r1353927206.ps tmp/5qu5r1353927206.png",intern=TRUE)) character(0) > try(system("convert tmp/6zaof1353927206.ps tmp/6zaof1353927206.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.121 0.735 3.857