R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(101.68,101.25,101.24,101.11,101.08,101.09,101.09,101.62,101.66,101.96,102.04,102.02,102.02,101.51,101.62,101.83,102.06,102.14,102.14,102.59,102.92,103.31,103.54,103.58,103.58,102.83,102.86,103.03,103.2,103.28,103.28,103.79,103.92,104.26,104.41,104.45,99.92,99.18,99.18,99.35,99.62,99.67,99.72,100.08,100.39,100.77,101.03,101.07,101.29,101.1,101.2,101.15,101.24,101.16,100.81,101.02,101.15,101.06,101.17,101.22,101.84,101.79,101.88,101.9,101.91,101.96,101.26,101.06,100.98,101.12,101.24,101.25) > 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,] 101.68 102.02 103.58 99.92 101.29 101.84 NA [2,] 101.25 101.51 102.83 99.18 101.10 101.79 NA [3,] 101.24 101.62 102.86 99.18 101.20 101.88 NA [4,] 101.11 101.83 103.03 99.35 101.15 101.90 NA [5,] 101.08 102.06 103.20 99.62 101.24 101.91 NA [6,] 101.09 102.14 103.28 99.67 101.16 101.96 NA [7,] 101.09 102.14 103.28 99.72 100.81 101.26 NA [8,] 101.62 102.59 103.79 100.08 101.02 101.06 NA [9,] 101.66 102.92 103.92 100.39 101.15 100.98 NA [10,] 101.96 103.31 104.26 100.77 101.06 101.12 NA [11,] 102.04 103.54 104.41 101.03 101.17 101.24 NA [12,] 102.02 103.58 104.45 101.07 101.22 101.25 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/11fc21493070819.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/23wkr1493070819.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/3xl6a1493070819.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/4d45s1493070819.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,] 101.29 101.10 101.20 101.11 99.620 99.67 99.720 100.08 100.390 100.77 [2,] 101.29 101.10 101.20 101.11 101.080 101.09 100.810 101.02 100.980 101.06 [3,] 101.76 101.38 101.43 101.49 101.575 101.56 101.175 101.34 101.405 101.54 [4,] 102.02 101.79 101.88 101.90 102.060 102.14 102.140 102.59 102.920 103.31 [5,] 102.02 101.79 102.86 103.03 103.200 103.28 103.280 103.79 103.920 104.26 [,11] [,12] [1,] 101.03 101.070 [2,] 101.17 101.220 [3,] 101.64 101.635 [4,] 103.54 103.580 [5,] 104.41 104.450 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.2891 100.9349 100.9914 100.9804 100.9429 100.8827 100.3171 100.3273 [2,] 102.2309 101.8251 101.8686 101.9996 102.2071 102.2373 102.0329 102.3527 [,9] [,10] [,11] [,12] [1,] 100.1536 100.0887 100.1113 100.1127 [2,] 102.6564 102.9913 103.1687 103.1573 $out [1] 103.58 99.92 102.83 99.18 99.18 99.35 $group [1] 1 1 2 2 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.29, 101.29, 101.76, 102.02, 102.02, 101.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lsgt1493070819.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,] 101.080 101.510 102.830 99.180 101.020 100.980 NA [2,] 101.100 101.925 103.115 99.485 101.080 101.180 NA [3,] 101.435 102.140 103.430 99.820 101.155 101.525 NA [4,] 101.820 103.115 104.090 100.580 101.210 101.890 NA [5,] 102.040 103.580 104.450 101.070 101.290 101.960 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 101.1066 101.5972 102.9853 99.32056 101.0957 101.2012 NA [2,] 101.7634 102.6828 103.8747 100.31944 101.2143 101.8488 NA $out [1] 100.81 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.08, 101.1, 101.435, 101.82, 102.04, 101.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67fpa1493070819.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,] 1.182411 3.380 0.58250 [2,] 1.205177 3.510 0.68375 [3,] 1.218521 3.595 1.01375 [4,] 1.370569 3.670 1.74000 [5,] 1.422234 3.710 1.97750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.143084 3.522023 0.5319873 [2,] 1.293957 3.667977 1.4955127 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.18241137793353, 1.20517730755461, 1.2185208676023, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11fc21493070819.ps tmp/11fc21493070819.png",intern=TRUE)) character(0) > try(system("convert tmp/23wkr1493070819.ps tmp/23wkr1493070819.png",intern=TRUE)) character(0) > try(system("convert tmp/3xl6a1493070819.ps tmp/3xl6a1493070819.png",intern=TRUE)) character(0) > try(system("convert tmp/4d45s1493070819.ps tmp/4d45s1493070819.png",intern=TRUE)) character(0) > try(system("convert tmp/5lsgt1493070819.ps tmp/5lsgt1493070819.png",intern=TRUE)) character(0) > try(system("convert tmp/67fpa1493070819.ps tmp/67fpa1493070819.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.595 0.265 2.919