R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(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) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.7 67.5 114.7 54.6 97.6 117.4 135.1 NA [2,] 75.7 72.7 118.0 52.9 94.2 123.6 142.6 NA [3,] 77.1 76.6 129.3 59.1 100.2 137.6 149.3 NA [4,] 86.1 82.4 137.0 63.3 106.7 147.4 143.5 NA [5,] 86.8 82.3 156.0 73.8 95.7 137.2 131.4 NA [6,] 86.3 86.3 166.2 87.6 94.6 133.8 114.7 NA [7,] 91.5 93.0 167.8 81.8 94.7 136.7 122.3 NA [8,] 90.7 88.8 144.3 90.7 96.2 127.3 133.4 NA [9,] 78.2 96.9 126.0 86.3 96.3 128.7 134.6 NA [10,] 73.0 103.9 90.4 93.6 103.3 127.0 130.9 NA [11,] 73.7 115.7 67.5 98.0 106.8 133.7 127.9 NA [12,] 77.3 112.8 52.4 94.3 113.7 132.0 128.0 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/1msdm1386169929.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/2xgrv1386169929.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/3bf1j1386169929.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/4zy2c1386169929.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.9 59.10 63.30 73.80 86.30 81.80 88.80 78.20 73.00 [2,] 73.10 74.2 76.85 84.25 84.55 86.95 92.25 90.70 91.30 92.00 [3,] 97.60 94.2 100.20 106.70 95.70 94.60 94.70 96.20 96.90 103.30 [4,] 116.05 120.8 133.45 140.25 134.30 124.25 129.50 130.35 127.35 115.45 [5,] 135.10 142.6 149.30 147.40 156.00 166.20 167.80 144.30 134.60 130.90 [,11] [,12] [1,] 67.50 52.40 [2,] 85.85 85.80 [3,] 106.80 112.80 [4,] 121.80 120.85 [5,] 133.70 132.00 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 71.95095 66.37123 66.39939 73.2577 65.9901 72.32504 72.4549 [2,] 123.24905 122.02877 134.00061 140.1423 125.4099 116.87496 116.9451 [,8] [,9] [,10] [,11] [,12] [1,] 72.52166 75.37152 89.29604 85.33124 91.86871 [2,] 119.87834 118.42848 117.30396 128.26876 133.73129 $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, 97.6, 116.05, 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/5sj201386169929.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] [1,] 73.00 67.50 52.40 52.90 94.20 117.40 114.70 NA [2,] 76.40 79.45 102.55 61.20 95.20 127.15 127.95 NA [3,] 78.45 87.55 127.65 84.05 96.95 132.85 132.40 NA [4,] 86.55 100.40 150.15 92.15 105.00 136.95 138.85 NA [5,] 91.50 115.70 167.80 98.00 113.70 147.40 149.30 NA $n [1] 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 NA [2,] 83.07948 97.10544 149.3607 98.1665 101.41985 137.3198 137.3716 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" 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/69thh1386169929.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,] 20.42163 55.50 23.450 [2,] 24.63305 62.05 36.000 [3,] 29.94883 80.20 38.475 [4,] 32.08341 85.05 48.175 [5,] 34.94222 90.20 56.600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26.55067 69.70955 32.9219 [2,] 33.34699 90.69045 44.0281 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(20.4216271913591, 24.633045632945, 29.9488278727049, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1msdm1386169929.ps tmp/1msdm1386169929.png",intern=TRUE)) character(0) > try(system("convert tmp/2xgrv1386169929.ps tmp/2xgrv1386169929.png",intern=TRUE)) character(0) > try(system("convert tmp/3bf1j1386169929.ps tmp/3bf1j1386169929.png",intern=TRUE)) character(0) > try(system("convert tmp/4zy2c1386169929.ps tmp/4zy2c1386169929.png",intern=TRUE)) character(0) > try(system("convert tmp/5sj201386169929.ps tmp/5sj201386169929.png",intern=TRUE)) character(0) > try(system("convert tmp/69thh1386169929.ps tmp/69thh1386169929.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.951 1.624 7.753