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(31.5,31.29,31.3,31.06,31.09,31.11,31.13,31.1,31.03,30.74,30.83,30.82,30.8,30.74,30.71,30.58,30.71,30.7,30.7,30.72,30.68,30.78,30.84,30.8,30.8,30.88,30.87,30.92,30.82,30.75,30.75,30.75,30.63,30.52,30.58,30.6,30.6,30.63,30.56,30.61,30.53,30.6,30.6,30.63,30.66,30.34,30.32,30.3,30.3,30.08,29.96,29.91,29.83,29.89,29.85,30.06,29.83,29.95,30.02,30.03,30.03,29.96,29.85,30.12,29.91,29.9,29.92,29.89,29.96,29.72,29.6,29.54,29.54,29.54,29.48,29.55,29.58,29.6,29.6,29.56,29.7,29.76,29.24,29.28) > 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,] 31.50 30.80 30.80 30.60 30.30 30.03 29.54 NA [2,] 31.29 30.74 30.88 30.63 30.08 29.96 29.54 NA [3,] 31.30 30.71 30.87 30.56 29.96 29.85 29.48 NA [4,] 31.06 30.58 30.92 30.61 29.91 30.12 29.55 NA [5,] 31.09 30.71 30.82 30.53 29.83 29.91 29.58 NA [6,] 31.11 30.70 30.75 30.60 29.89 29.90 29.60 NA [7,] 31.13 30.70 30.75 30.60 29.85 29.92 29.60 NA [8,] 31.10 30.72 30.75 30.63 30.06 29.89 29.56 NA [9,] 31.03 30.68 30.63 30.66 29.83 29.96 29.70 NA [10,] 30.74 30.78 30.52 30.34 29.95 29.72 29.76 NA [11,] 30.83 30.84 30.58 30.32 30.02 29.60 29.24 NA [12,] 30.82 30.80 30.60 30.30 30.03 29.54 29.28 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/1rlwr1385997957.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/23om01385997957.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/3bcql1385997957.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/4qtn21385997957.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,] 29.540 29.54 29.480 29.550 29.580 29.600 29.600 29.560 29.700 29.720 [2,] 30.165 30.02 29.905 30.015 29.870 29.895 29.885 29.975 29.895 29.855 [3,] 30.600 30.63 30.560 30.580 30.530 30.600 30.600 30.630 30.630 30.340 [4,] 30.800 30.81 30.790 30.765 30.765 30.725 30.725 30.735 30.670 30.630 [5,] 31.500 31.29 31.300 31.060 31.090 31.110 31.130 31.100 31.030 30.780 [,11] [,12] [1,] 29.240 29.280 [2,] 29.810 29.785 [3,] 30.320 30.300 [4,] 30.705 30.700 [5,] 30.840 30.820 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 30.22079 30.15822 30.03149 30.13211 29.99552 30.10434 30.09837 30.17614 [2,] 30.97921 31.10178 31.08851 31.02789 31.06448 31.09566 31.10163 31.08386 [,9] [,10] [,11] [,12] [1,] 30.16718 29.87718 29.78552 29.75358 [2,] 31.09282 30.80282 30.85448 30.84642 $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(29.54, 30.165, 30.6, 30.8, 31.5, 29.54, 30.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5px0f1385997957.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,] 30.740 30.580 30.520 30.300 29.830 29.540 29.480 NA [2,] 30.930 30.700 30.615 30.435 29.870 29.785 29.510 NA [3,] 31.095 30.715 30.750 30.600 29.955 29.905 29.555 NA [4,] 31.210 30.790 30.845 30.620 30.045 29.960 29.600 NA [5,] 31.500 30.840 30.920 30.660 30.300 30.120 29.700 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 30.96729 30.67395 30.6451 30.51562 29.87518 29.82518 29.51395 NA [2,] 31.22271 30.75605 30.8549 30.68438 30.03482 29.98482 29.59605 NA $out [1] 29.76 29.24 29.28 $group [1] 7 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(30.74, 30.93, 31.095, 31.21, 31.5, 30.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ndmb1385997957.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.5148740 1.330 0.6350 [2,] 0.5531006 1.510 0.7675 [3,] 0.5727581 1.535 0.8100 [4,] 0.6126569 1.675 0.8900 [5,] 0.6447739 1.820 0.9150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5455942 1.459742 0.7541269 [2,] 0.5999221 1.610258 0.8658731 $out [1] 0.4495342 1.9600000 1.0600000 $group [1] 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.514874002155128, 0.553100641063695, 0.572758145627399, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rlwr1385997957.ps tmp/1rlwr1385997957.png",intern=TRUE)) character(0) > try(system("convert tmp/23om01385997957.ps tmp/23om01385997957.png",intern=TRUE)) character(0) > try(system("convert tmp/3bcql1385997957.ps tmp/3bcql1385997957.png",intern=TRUE)) character(0) > try(system("convert tmp/4qtn21385997957.ps tmp/4qtn21385997957.png",intern=TRUE)) character(0) > try(system("convert tmp/5px0f1385997957.ps tmp/5px0f1385997957.png",intern=TRUE)) character(0) > try(system("convert tmp/6ndmb1385997957.ps tmp/6ndmb1385997957.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.544 1.234 6.741