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(78.7,75.7,77.1,86.1,86.8,86.3,91.5,90.7,78.2,73,73.7,77.3,67.5,72.7,76.6,82.4,82.3,86.3,93,88.8,96.9,103.9,115.7,112.8,114.7,118,129.3,137,156,166.2,167.8,144.3,126,90.4,67.5,52.4,54.6,52.9,59.1,63.3,73.8,87.6,81.8,90.7,86.3,93.6,98,94.3,97.6,94.2,100.2,106.7,95.7,94.6,94.7,96.2,96.3,103.3,106.8,113.7,117.4,123.6,137.6,147.4,137.2,133.8,136.7,127.3,128.7,127,133.7,132,135.1,142.6,149.3,143.5,131.4,114.7,122.3,133.4,134.6,130.9,127.9,128,133.3,136.3,129.5,124.6,125.5,126.2,133.3,137,137.8,133.5,129.9,133.3) > 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,] 78.7 67.5 114.7 54.6 97.6 117.4 135.1 133.3 NA [2,] 75.7 72.7 118.0 52.9 94.2 123.6 142.6 136.3 NA [3,] 77.1 76.6 129.3 59.1 100.2 137.6 149.3 129.5 NA [4,] 86.1 82.4 137.0 63.3 106.7 147.4 143.5 124.6 NA [5,] 86.8 82.3 156.0 73.8 95.7 137.2 131.4 125.5 NA [6,] 86.3 86.3 166.2 87.6 94.6 133.8 114.7 126.2 NA [7,] 91.5 93.0 167.8 81.8 94.7 136.7 122.3 133.3 NA [8,] 90.7 88.8 144.3 90.7 96.2 127.3 133.4 137.0 NA [9,] 78.2 96.9 126.0 86.3 96.3 128.7 134.6 137.8 NA [10,] 73.0 103.9 90.4 93.6 103.3 127.0 130.9 133.5 NA [11,] 73.7 115.7 67.5 98.0 106.8 133.7 127.9 129.9 NA [12,] 77.3 112.8 52.4 94.3 113.7 132.0 128.0 133.3 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/1pdok1425897533.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/2826p1425897533.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/3at451425897533.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/42av81425897533.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,] 54.60 52.90 59.10 63.30 73.80 86.30 81.80 88.80 78.20 73.00 [2,] 73.10 74.20 76.85 84.25 84.55 86.95 92.25 90.70 91.30 92.00 [3,] 106.15 106.10 114.75 115.65 110.60 104.65 108.50 111.75 111.45 103.60 [4,] 125.35 129.95 133.55 140.25 134.30 130.00 135.00 135.20 131.65 128.95 [5,] 135.10 142.60 149.30 147.40 156.00 166.20 167.80 144.30 137.80 133.50 [,11] [,12] [1,] 67.50 52.40 [2,] 85.85 85.80 [3,] 111.25 113.25 [4,] 128.90 130.00 [5,] 133.70 133.30 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 76.9624 74.95725 83.07657 84.3676 82.80894 80.60165 84.61924 [2,] 135.3376 137.24275 146.42343 146.9324 138.39106 128.69835 132.38076 [,8] [,9] [,10] [,11] [,12] [1,] 86.89166 88.90991 82.9592 87.20165 88.55925 [2,] 136.60834 133.99009 124.2408 135.29835 137.94075 $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(54.6, 73.1, 106.15, 125.35, 135.1, 52.9, 74.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xf2u1425897533.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,] 73.00 67.50 52.40 52.90 94.20 117.40 114.70 124.60 NA [2,] 76.40 79.45 102.55 61.20 95.20 127.15 127.95 127.85 NA [3,] 78.45 87.55 127.65 84.05 96.95 132.85 132.40 133.30 NA [4,] 86.55 100.40 150.15 92.15 105.00 136.95 138.85 134.90 NA [5,] 91.50 115.70 167.80 98.00 113.70 147.40 149.30 137.80 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.82052 77.99456 105.9393 69.9335 92.48015 128.3802 127.4284 130.0844 [2,] 83.07948 97.10544 149.3607 98.1665 101.41985 137.3198 137.3716 136.5156 [,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(73, 76.4, 78.45, 86.55, 91.5, 67.5, 79.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60vga1425897533.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,] 21.73825 55.50 35.1750 [2,] 24.68242 63.35 37.7125 [3,] 29.32195 80.70 42.5625 [4,] 30.94221 85.05 49.5000 [5,] 33.56678 90.20 54.5500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26.46682 70.80248 37.18614 [2,] 32.17708 90.59752 47.93886 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(21.7382480566266, 24.6824212402406, 29.3219488265318, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pdok1425897533.ps tmp/1pdok1425897533.png",intern=TRUE)) character(0) > try(system("convert tmp/2826p1425897533.ps tmp/2826p1425897533.png",intern=TRUE)) character(0) > try(system("convert tmp/3at451425897533.ps tmp/3at451425897533.png",intern=TRUE)) character(0) > try(system("convert tmp/42av81425897533.ps tmp/42av81425897533.png",intern=TRUE)) character(0) > try(system("convert tmp/5xf2u1425897533.ps tmp/5xf2u1425897533.png",intern=TRUE)) character(0) > try(system("convert tmp/60vga1425897533.ps tmp/60vga1425897533.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.035 0.306 2.374