R version 3.3.0 (2016-05-03) -- "Supposedly Educational" Copyright (C) 2016 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(84.51,84.54,84.27,84.47,84.25,84.33,84.29,84.53,84.01,84.18,84.08,83.44,83.61,83.89,83.4,82.96,82.76,83.35,87.78,88.99,88.92,88.91,89.79,90.54,93.15,92.79,93.21,95.35,100.91,103.69,104.04,104.16,104.71,105.18,104.92,104.83,104.9,105.05,104.6,103.21,102.52,101.09,101.19,102.34,102.62,102.47,101.82,101.86,101.54,101.98,101.23,100.4,99.94,99.94,100,98.8,99.07,99.46,99.18,98.47,97.12,96.91,96.09,97.17,96.8,97.13,99.9,100.56,100.84,99.81,100.44,100.07,101.32,103.98,104.81,106.23,106.48,107.59,107.16,107.54,107.1,106.38,106.64,106.13) > 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,] 84.51 83.61 93.15 104.90 101.54 97.12 101.32 NA [2,] 84.54 83.89 92.79 105.05 101.98 96.91 103.98 NA [3,] 84.27 83.40 93.21 104.60 101.23 96.09 104.81 NA [4,] 84.47 82.96 95.35 103.21 100.40 97.17 106.23 NA [5,] 84.25 82.76 100.91 102.52 99.94 96.80 106.48 NA [6,] 84.33 83.35 103.69 101.09 99.94 97.13 107.59 NA [7,] 84.29 87.78 104.04 101.19 100.00 99.90 107.16 NA [8,] 84.53 88.99 104.16 102.34 98.80 100.56 107.54 NA [9,] 84.01 88.92 104.71 102.62 99.07 100.84 107.10 NA [10,] 84.18 88.91 105.18 102.47 99.46 99.81 106.38 NA [11,] 84.08 89.79 104.92 101.82 99.18 100.44 106.64 NA [12,] 83.44 90.54 104.83 101.86 98.47 100.07 106.13 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/18qh81464107137.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/2fz6b1464107137.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/3j2xh1464107137.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/46yw41464107137.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] [1,] 83.61 83.890 83.400 82.960 82.760 83.35 84.290 84.530 84.010 [2,] 88.83 88.665 88.740 89.910 90.525 90.73 93.840 93.895 93.995 [3,] 97.12 96.910 96.090 97.170 99.940 99.94 100.000 100.560 100.840 [4,] 101.43 102.980 102.915 101.805 101.715 102.39 102.615 103.250 103.665 [5,] 104.90 105.050 104.810 106.230 106.480 107.59 107.160 107.540 107.100 [,10] [,11] [,12] [1,] 84.180 84.080 83.440 [2,] 94.185 94.485 94.505 [3,] 99.810 100.440 100.070 [4,] 103.825 103.370 103.345 [5,] 106.380 106.640 106.130 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.59548 88.36131 87.62492 90.0665 93.25751 92.97684 94.75971 [2,] 104.64452 105.45869 104.55508 104.2735 106.62249 106.90316 105.24029 [,8] [,9] [,10] [,11] [,12] [1,] 94.97334 95.06523 94.05315 95.13402 94.79089 [2,] 106.14666 106.61477 105.56685 105.74598 105.34911 $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(83.61, 88.83, 97.12, 101.43, 104.9, 83.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56dn31464107137.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,] 84.01 82.760 92.790 101.090 98.470 96.090 103.98 NA [2,] 84.13 83.375 94.280 101.840 99.125 97.015 105.47 NA [3,] 84.28 85.835 103.865 102.495 99.940 98.490 106.43 NA [4,] 84.49 88.955 104.770 103.905 100.815 100.255 107.13 NA [5,] 84.54 90.540 105.180 105.050 101.980 100.840 107.59 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 84.1158 83.28992 99.08044 101.5531 99.16918 97.01221 105.6729 NA [2,] 84.4442 88.38008 108.64956 103.4369 100.71082 99.96779 107.1871 NA $out [1] 83.44 101.32 $group [1] 1 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(84.01, 84.13, 84.28, 84.49, 84.54, 82.76, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6eotn1464107137.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,] 8.162252 21.160 8.7750 [2,] 8.357868 21.805 9.1200 [3,] 8.497626 22.780 10.4300 [4,] 8.946108 23.180 12.2475 [5,] 9.386509 24.240 14.3150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.229326 22.15285 9.003526 [2,] 8.765926 23.40715 11.856474 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.16225225686893, 8.35786781556757, 8.49762632883715, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18qh81464107137.ps tmp/18qh81464107137.png",intern=TRUE)) character(0) > try(system("convert tmp/2fz6b1464107137.ps tmp/2fz6b1464107137.png",intern=TRUE)) character(0) > try(system("convert tmp/3j2xh1464107137.ps tmp/3j2xh1464107137.png",intern=TRUE)) character(0) > try(system("convert tmp/46yw41464107137.ps tmp/46yw41464107137.png",intern=TRUE)) character(0) > try(system("convert tmp/56dn31464107137.ps tmp/56dn31464107137.png",intern=TRUE)) character(0) > try(system("convert tmp/6eotn1464107137.ps tmp/6eotn1464107137.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.066 0.398 2.479