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(16.68,16.68,16.69,16.61,16.58,16.6,16.6,16.62,16.62,16.6,16.63,16.66,16.66,16.65,16.5,16.39,16.34,16.35,16.35,16.38,16.36,16.38,16.39,16.41,16.41,16.41,16.45,16.41,16.44,16.47,16.47,16.49,16.54,16.62,16.69,16.72,16.72,16.71,16.89,16.93,16.91,16.93,16.93,16.93,16.95,16.93,16.95,16.95,16.95,16.95,16.92,16.91,16.9,16.96,16.96,16.95,16.92,16.87,16.87,16.88,16.88,16.86,16.88,16.88,16.88,16.88,16.88,16.87,16.92,16.94,17.03,17.02,17.02,17.02,16.99,17.03,16.98,16.89,16.89,16.9,16.89,16.96,16.97,16.97) > 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,] 16.68 16.66 16.41 16.72 16.95 16.88 17.02 NA [2,] 16.68 16.65 16.41 16.71 16.95 16.86 17.02 NA [3,] 16.69 16.50 16.45 16.89 16.92 16.88 16.99 NA [4,] 16.61 16.39 16.41 16.93 16.91 16.88 17.03 NA [5,] 16.58 16.34 16.44 16.91 16.90 16.88 16.98 NA [6,] 16.60 16.35 16.47 16.93 16.96 16.88 16.89 NA [7,] 16.60 16.35 16.47 16.93 16.96 16.88 16.89 NA [8,] 16.62 16.38 16.49 16.93 16.95 16.87 16.90 NA [9,] 16.62 16.36 16.54 16.95 16.92 16.92 16.89 NA [10,] 16.60 16.38 16.62 16.93 16.87 16.94 16.96 NA [11,] 16.63 16.39 16.69 16.95 16.87 17.03 16.97 NA [12,] 16.66 16.41 16.72 16.95 16.88 17.02 16.97 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/191ux1386254522.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/20yjb1386254522.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/335281386254522.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/44khr1386254522.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,] 16.410 16.410 16.450 16.39 16.340 16.350 16.350 16.380 16.36 16.380 16.39 [2,] 16.670 16.665 16.595 16.51 16.510 16.535 16.535 16.555 16.58 16.610 16.66 [3,] 16.720 16.710 16.880 16.88 16.880 16.880 16.880 16.870 16.89 16.870 16.87 [4,] 16.915 16.905 16.905 16.92 16.905 16.910 16.910 16.915 16.92 16.935 16.96 [5,] 17.020 17.020 16.990 17.03 16.980 16.960 16.960 16.950 16.95 16.960 17.03 [,12] [1,] 16.41 [2,] 16.69 [3,] 16.88 [4,] 16.96 [5,] 17.02 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.57369 16.56668 16.69487 16.63515 16.64411 16.65606 16.65606 16.65501 [2,] 16.86631 16.85332 17.06513 17.12485 17.11589 17.10394 17.10394 17.08499 [,9] [,10] [,11] [,12] [1,] 16.68696 16.67592 16.69084 16.71876 [2,] 17.09304 17.06408 17.04916 17.04124 $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(16.41, 16.67, 16.72, 16.915, 17.02, 16.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5joeg1386254522.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,] 16.58 16.340 16.410 16.89 16.87 16.86 16.890 NA [2,] 16.60 16.355 16.425 16.90 16.89 16.88 16.895 NA [3,] 16.62 16.385 16.470 16.93 16.92 16.88 16.970 NA [4,] 16.67 16.455 16.580 16.94 16.95 16.93 17.005 NA [5,] 16.69 16.500 16.720 16.95 16.96 16.94 17.030 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 16.58807 16.33939 16.3993 16.91176 16.89263 16.85719 16.91983 NA [2,] 16.65193 16.43061 16.5407 16.94824 16.94737 16.90281 17.02017 NA $out [1] 16.66 16.65 16.72 16.71 17.03 17.02 $group [1] 2 2 4 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(16.58, 16.6, 16.62, 16.67, 16.69, 16.34, 16.355, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6h9i71386254522.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.2069506 0.540 0.2400 [2,] 0.2165391 0.585 0.2850 [3,] 0.2321137 0.610 0.3325 [4,] 0.2482510 0.625 0.3750 [5,] 0.2636105 0.640 0.4100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.2176497 0.5917557 0.2914504 [2,] 0.2465777 0.6282443 0.3735496 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.206950649741844, 0.216539127077351, 0.232113734082812, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/191ux1386254522.ps tmp/191ux1386254522.png",intern=TRUE)) character(0) > try(system("convert tmp/20yjb1386254522.ps tmp/20yjb1386254522.png",intern=TRUE)) character(0) > try(system("convert tmp/335281386254522.ps tmp/335281386254522.png",intern=TRUE)) character(0) > try(system("convert tmp/44khr1386254522.ps tmp/44khr1386254522.png",intern=TRUE)) character(0) > try(system("convert tmp/5joeg1386254522.ps tmp/5joeg1386254522.png",intern=TRUE)) character(0) > try(system("convert tmp/6h9i71386254522.ps tmp/6h9i71386254522.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.699 1.009 5.709