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(1.26,1.26,1.28,1.34,1.39,1.47,1.57,1.63,1.72,1.43,1.35,1.41,1.44,1.43,1.43,1.42,1.45,1.51,1.48,1.48,1.45,1.38,1.46,1.45,1.41,1.45,1.47,1.47,1.53,1.56,1.66,1.79,1.78,1.46,1.41,1.43,1.43,1.45,1.35,1.35,1.29,1.29,1.26,1.3,1.3,1.16,1.24,1.15,1.21,1.22,1.17,1.13,1.15,1.2,1.23,1.25,1.38,1.28,1.26,1.25,1.26,1.28,1.31,1.22,1.23,1.36,1.54,1.58,1.44,1.29,1.28,1.23,1.2,1.22,1.19,1.17,1.22,1.29,1.39,1.53,1.82,1.77,1.63,1.57) > 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,] 1.26 1.44 1.41 1.43 1.21 1.26 1.20 NA [2,] 1.26 1.43 1.45 1.45 1.22 1.28 1.22 NA [3,] 1.28 1.43 1.47 1.35 1.17 1.31 1.19 NA [4,] 1.34 1.42 1.47 1.35 1.13 1.22 1.17 NA [5,] 1.39 1.45 1.53 1.29 1.15 1.23 1.22 NA [6,] 1.47 1.51 1.56 1.29 1.20 1.36 1.29 NA [7,] 1.57 1.48 1.66 1.26 1.23 1.54 1.39 NA [8,] 1.63 1.48 1.79 1.30 1.25 1.58 1.53 NA [9,] 1.72 1.45 1.78 1.30 1.38 1.44 1.82 NA [10,] 1.43 1.38 1.46 1.16 1.28 1.29 1.77 NA [11,] 1.35 1.46 1.41 1.24 1.26 1.28 1.63 NA [12,] 1.41 1.45 1.43 1.15 1.25 1.23 1.57 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/198vn1388655977.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/26s1y1388655977.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/31sii1388655977.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/46zcl1388655977.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,] 1.200 1.22 1.170 1.130 1.150 1.20 1.230 1.250 1.30 1.160 1.240 1.15 [2,] 1.235 1.24 1.235 1.195 1.225 1.29 1.325 1.390 1.41 1.285 1.270 1.24 [3,] 1.260 1.28 1.310 1.340 1.290 1.36 1.480 1.530 1.45 1.380 1.350 1.41 [4,] 1.420 1.44 1.390 1.385 1.420 1.49 1.555 1.605 1.75 1.445 1.435 1.44 [5,] 1.440 1.45 1.470 1.470 1.530 1.56 1.660 1.790 1.82 1.460 1.630 1.57 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.149521 1.160563 1.217437 1.226535 1.173549 1.240563 1.342648 1.401605 [2,] 1.370479 1.399437 1.402563 1.453465 1.406451 1.479437 1.617352 1.658395 [,9] [,10] [,11] [,12] [1,] 1.246957 1.284451 1.251465 1.290563 [2,] 1.653043 1.475549 1.448535 1.529437 $out [1] 1.77 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.2, 1.235, 1.26, 1.42, 1.44, 1.22, 1.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xt7t1388655977.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,] 1.26 1.38 1.41 1.150 1.130 1.220 1.17 NA [2,] 1.31 1.43 1.44 1.250 1.185 1.245 1.21 NA [3,] 1.40 1.45 1.47 1.295 1.225 1.285 1.34 NA [4,] 1.52 1.47 1.61 1.350 1.255 1.400 1.60 NA [5,] 1.72 1.51 1.79 1.450 1.280 1.580 1.82 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.304218 1.431756 1.392462 1.249389 1.193073 1.214303 1.162118 NA [2,] 1.495782 1.468244 1.547538 1.340611 1.256927 1.355697 1.517882 NA $out [1] 1.38 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.26, 1.31, 1.4, 1.52, 1.72, 1.38, 1.43, 1.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66hy31388655977.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,] 0.1065922 0.230 0.1550 [2,] 0.1208310 0.320 0.1750 [3,] 0.1379352 0.385 0.1975 [4,] 0.1741984 0.475 0.2075 [5,] 0.2113336 0.610 0.2300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1135940 0.3143035 0.1826765 [2,] 0.1622765 0.4556965 0.2123235 $out [1] 0.34 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.106592235936323, 0.120830978981146, 0.137935230565305, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/198vn1388655977.ps tmp/198vn1388655977.png",intern=TRUE)) character(0) > try(system("convert tmp/26s1y1388655977.ps tmp/26s1y1388655977.png",intern=TRUE)) character(0) > try(system("convert tmp/31sii1388655977.ps tmp/31sii1388655977.png",intern=TRUE)) character(0) > try(system("convert tmp/46zcl1388655977.ps tmp/46zcl1388655977.png",intern=TRUE)) character(0) > try(system("convert tmp/5xt7t1388655977.ps tmp/5xt7t1388655977.png",intern=TRUE)) character(0) > try(system("convert tmp/66hy31388655977.ps tmp/66hy31388655977.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.170 0.867 5.018