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(104.78,105.56,107.95,107.11,107.47,107.06,99.71,99.6,107.19,107.26,113.24,113.52,110.48,111.41,115.5,118.32,118.42,117.5,110.23,109.19,118.41,118.3,116.1,114.11,113.41,114.33,116.61,123.64,123.77,123.39,116.03,114.95,123.4,123.53,114.45,114.26,114.35,112.77,115.31,114.93,116.38,115.07,105,103.43,114.52,115.04,117.16,115,116.22,112.92,116.56,114.32,113.22,111.56,103.87,102.85,112.27,112.76,118.55,122.73,115.44,116.97,119.84,116.37,117.23,115.58,109.82,108.46,116.54,117.49,122.87,127.1) > 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,] 104.78 110.48 113.41 114.35 116.22 115.44 NA [2,] 105.56 111.41 114.33 112.77 112.92 116.97 NA [3,] 107.95 115.50 116.61 115.31 116.56 119.84 NA [4,] 107.11 118.32 123.64 114.93 114.32 116.37 NA [5,] 107.47 118.42 123.77 116.38 113.22 117.23 NA [6,] 107.06 117.50 123.39 115.07 111.56 115.58 NA [7,] 99.71 110.23 116.03 105.00 103.87 109.82 NA [8,] 99.60 109.19 114.95 103.43 102.85 108.46 NA [9,] 107.19 118.41 123.40 114.52 112.27 116.54 NA [10,] 107.26 118.30 123.53 115.04 112.76 117.49 NA [11,] 113.24 116.10 114.45 117.16 118.55 122.87 NA [12,] 113.52 114.11 114.26 115.00 122.73 127.10 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/fisher/rcomp/tmp/17yl31386268131.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/fisher/rcomp/tmp/24e9g1386268131.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/fisher/rcomp/tmp/3wc491386268131.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/fisher/rcomp/tmp/42jat1386268131.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,] 104.78 111.410 115.31 114.32 107.470 107.060 99.71 99.600 107.19 107.260 [2,] 110.48 111.410 115.31 114.32 113.220 111.560 103.87 102.850 112.27 112.760 [3,] 113.88 112.845 116.03 115.65 116.805 115.325 107.41 105.945 115.53 116.265 [4,] 115.44 114.330 116.61 118.32 118.420 117.500 110.23 109.190 118.41 118.300 [5,] 116.22 116.970 116.61 123.64 123.770 123.390 116.03 114.950 123.40 123.530 [,11] [,12] [1,] 113.24 113.52 [2,] 114.45 114.11 [3,] 116.63 114.63 [4,] 118.55 122.73 [5,] 122.87 127.10 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.6806 110.9615 115.1915 113.0699 113.4508 111.4935 103.3076 101.8555 [2,] 117.0794 114.7285 116.8685 118.2301 120.1592 119.1565 111.5124 110.0345 [,9] [,10] [,11] [,12] [1,] 111.5695 112.6915 113.9854 109.0698 [2,] 119.4905 119.8385 119.2746 120.1902 $out [1] 105.56 107.95 119.84 107.11 $group [1] 2 3 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(104.78, 110.48, 113.88, 115.44, 116.22, 111.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5x7sc1386268131.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,] 104.78 109.190 113.410 112.770 111.560 115.440 NA [2,] 105.17 110.945 114.390 113.560 111.915 115.510 NA [3,] 107.15 115.800 116.320 114.965 113.070 116.755 NA [4,] 107.71 118.310 123.465 115.190 116.390 118.665 NA [5,] 107.95 118.420 123.770 117.160 122.730 122.870 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 105.9915 112.4408 112.1808 114.2215 111.0289 115.316 NA [2,] 108.3085 119.1592 120.4592 115.7085 115.1111 118.194 NA $out [1] 99.71 99.60 113.24 113.52 105.00 103.43 103.87 102.85 109.82 108.46 [11] 127.10 $group [1] 1 1 1 1 4 4 5 5 6 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(104.78, 105.17, 107.15, 107.71, 107.95, 109.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/667fh1386268131.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,] 3.415034 9.630 1.2400 [2,] 4.100523 11.665 3.3500 [3,] 5.476381 15.780 4.3475 [4,] 5.523827 16.310 5.5425 [5,] 5.756526 16.530 6.6500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.827203 13.66138 3.347486 [2,] 6.125560 17.89862 5.347514 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.41503391881643, 4.10052260469472, 5.47638117940044, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17yl31386268131.ps tmp/17yl31386268131.png",intern=TRUE)) character(0) > try(system("convert tmp/24e9g1386268131.ps tmp/24e9g1386268131.png",intern=TRUE)) character(0) > try(system("convert tmp/3wc491386268131.ps tmp/3wc491386268131.png",intern=TRUE)) character(0) > try(system("convert tmp/42jat1386268131.ps tmp/42jat1386268131.png",intern=TRUE)) character(0) > try(system("convert tmp/5x7sc1386268131.ps tmp/5x7sc1386268131.png",intern=TRUE)) character(0) > try(system("convert tmp/667fh1386268131.ps tmp/667fh1386268131.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.345 1.184 5.464