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(79.26,79.38,79.35,78.91,79.11,79.22,79.22,79.21,79.26,79.82,80.04,80.2,80.2,80.27,80.37,80.57,79.99,79.86,79.86,79.81,79.88,80.2,80.53,80.52,80.52,80.48,80.29,79.54,79.39,79.3,79.3,79.49,79.63,79.74,80.17,80.06,80.06,80.22,80.5,80.58,80.24,80.34,80.34,80.41,80.59,80.77,80.94,80.8,80.8,80.76,80.94,81.03,81.35,81.41,81.41,81.44,81.55,81.8,81.97,81.99,79.36,79.44,79.46,79.77,79.49,79.42,80.32,80.48,80.6,80.53,80.84,80.68) > 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,] 79.26 80.20 80.52 80.06 80.80 79.36 NA [2,] 79.38 80.27 80.48 80.22 80.76 79.44 NA [3,] 79.35 80.37 80.29 80.50 80.94 79.46 NA [4,] 78.91 80.57 79.54 80.58 81.03 79.77 NA [5,] 79.11 79.99 79.39 80.24 81.35 79.49 NA [6,] 79.22 79.86 79.30 80.34 81.41 79.42 NA [7,] 79.22 79.86 79.30 80.34 81.41 80.32 NA [8,] 79.21 79.81 79.49 80.41 81.44 80.48 NA [9,] 79.26 79.88 79.63 80.59 81.55 80.60 NA [10,] 79.82 80.20 79.74 80.77 81.80 80.53 NA [11,] 80.04 80.53 80.17 80.94 81.97 80.84 NA [12,] 80.20 80.52 80.06 80.80 81.99 80.68 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/1ojlh1416577367.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/207d21416577367.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/3z53p1416577367.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/4y4zk1416577367.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] [1,] 79.26 79.380 79.35 78.91 79.11 79.22 79.22 79.21 79.260 79.740 80.040 [2,] 79.36 79.440 79.46 79.54 79.39 79.30 79.30 79.49 79.630 79.820 80.170 [3,] 80.13 80.245 80.33 80.17 79.74 79.64 80.09 80.11 80.235 80.365 80.685 [4,] 80.52 80.480 80.50 80.58 80.24 80.34 80.34 80.48 80.600 80.770 80.940 [5,] 80.80 80.760 80.94 81.03 81.35 81.41 81.41 81.44 81.550 81.800 81.970 [,12] [1,] 80.06 [2,] 80.20 [3,] 80.60 [4,] 80.80 [5,] 80.80 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 79.38176 79.57417 79.65917 79.49917 79.19172 78.96917 79.41917 79.47142 [2,] 80.87824 80.91583 81.00083 80.84083 80.28828 80.31083 80.76083 80.74858 [,9] [,10] [,11] [,12] [1,] 79.60932 79.75222 80.18833 80.21298 [2,] 80.86068 80.97778 81.18167 80.98702 $out [1] 81.99 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(79.26, 79.36, 80.13, 80.52, 80.8, 79.38, 79.44, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b4bt1416577367.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,] 78.910 79.810 79.300 80.060 80.760 79.360 NA [2,] 79.215 79.870 79.440 80.290 80.985 79.450 NA [3,] 79.260 80.200 79.685 80.455 81.410 80.045 NA [4,] 79.600 80.445 80.230 80.680 81.675 80.565 NA [5,] 80.040 80.570 80.520 80.940 81.990 80.840 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.0844 79.93774 79.32468 80.27712 81.09529 79.53644 NA [2,] 79.4356 80.46226 80.04532 80.63288 81.72471 80.55356 NA $out [1] 80.2 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(78.91, 79.215, 79.26, 79.6, 80.04, 79.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xxea1416577367.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.5615841 1.38 0.6550 [2,] 0.6546532 1.76 0.7775 [3,] 0.7769117 2.09 0.8450 [4,] 0.8102556 2.21 0.9000 [5,] 0.8395654 2.29 0.9800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.7059404 1.884752 0.7891269 [2,] 0.8478830 2.295248 0.9008731 $out [1] 0.49 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.561584069099783, 0.654653207177156, 0.776911720419763, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ojlh1416577367.ps tmp/1ojlh1416577367.png",intern=TRUE)) character(0) > try(system("convert tmp/207d21416577367.ps tmp/207d21416577367.png",intern=TRUE)) character(0) > try(system("convert tmp/3z53p1416577367.ps tmp/3z53p1416577367.png",intern=TRUE)) character(0) > try(system("convert tmp/4y4zk1416577367.ps tmp/4y4zk1416577367.png",intern=TRUE)) character(0) > try(system("convert tmp/5b4bt1416577367.ps tmp/5b4bt1416577367.png",intern=TRUE)) character(0) > try(system("convert tmp/6xxea1416577367.ps tmp/6xxea1416577367.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.165 0.396 2.573