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(79.92,80.26,80.69,84.5,85.45,85.87,85.98,86.06,86.19,86.37,86.4,86.43,86.43,86.73,86.84,90.99,92.61,93.27,93.47,93.83,94.01,94.2,94.3,94.53,94.59,94.67,94.69,96.55,97.14,97.32,97.97,98.49,98.76,99.09,99.11,99.17,99.17,99.2,99.54,99.59,99.61,99.68,99.68,99.96,100,100.12,100.38,100.39,100.39,100.75,100.79,100.99,101.03,101.22,101.37,101.38,101.45,101.52,101.84,101.99,104.05,104.49,104.5,104.59,104.61,104.61,104.71,104.8,104.81,104.83,105.06,105.4) > 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.92 86.43 94.59 99.17 100.39 104.05 NA [2,] 80.26 86.73 94.67 99.20 100.75 104.49 NA [3,] 80.69 86.84 94.69 99.54 100.79 104.50 NA [4,] 84.50 90.99 96.55 99.59 100.99 104.59 NA [5,] 85.45 92.61 97.14 99.61 101.03 104.61 NA [6,] 85.87 93.27 97.32 99.68 101.22 104.61 NA [7,] 85.98 93.47 97.97 99.68 101.37 104.71 NA [8,] 86.06 93.83 98.49 99.96 101.38 104.80 NA [9,] 86.19 94.01 98.76 100.00 101.45 104.81 NA [10,] 86.37 94.20 99.09 100.12 101.52 104.83 NA [11,] 86.40 94.30 99.11 100.38 101.84 105.06 NA [12,] 86.43 94.53 99.17 100.39 101.99 105.40 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/1m7cf1492861839.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/2m46p1492861839.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/383pr1492861839.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/4uchs1492861839.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,] 79.92 80.260 80.690 84.50 85.450 85.87 85.980 86.060 86.19 [2,] 86.43 86.730 86.840 90.99 92.610 93.27 93.470 93.830 94.01 [3,] 96.88 96.935 97.115 98.07 98.375 98.50 98.825 99.225 99.38 [4,] 100.39 100.750 100.790 100.99 101.030 101.22 101.370 101.380 101.45 [5,] 104.05 104.490 104.500 104.59 104.610 104.61 104.710 104.800 104.81 [,10] [,11] [,12] [1,] 86.370 86.400 86.43 [2,] 94.200 94.300 94.53 [3,] 99.605 99.745 99.78 [4,] 101.520 101.840 101.99 [5,] 104.830 105.060 105.40 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 87.87535 87.89165 88.1168 91.61968 92.94383 93.37199 93.72924 [2,] 105.88465 105.97835 106.1132 104.52032 103.80617 103.62801 103.92076 [,8] [,9] [,10] [,11] [,12] [1,] 94.35501 94.58096 94.88336 94.88146 94.96806 [2,] 104.09499 104.17904 104.32664 104.60854 104.59194 $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(79.92, 86.43, 96.88, 100.39, 104.05, 80.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yzul1492861839.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,] 79.920 86.430 94.590 99.170 100.390 104.490 NA [2,] 82.595 88.915 95.620 99.565 100.890 104.545 NA [3,] 85.925 93.370 97.645 99.680 101.295 104.660 NA [4,] 86.280 94.105 98.925 100.060 101.485 104.820 NA [5,] 86.430 94.530 99.170 100.390 101.990 105.060 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 84.24425 91.00281 96.13757 99.45423 101.0236 104.5346 NA [2,] 87.60575 95.73719 99.15243 99.90577 101.5664 104.7854 NA $out [1] 104.05 105.40 $group [1] 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(79.92, 82.595, 85.925, 86.28, 86.43, 86.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g04g1492861839.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,] 6.539662 18.460 5.74750 [2,] 6.627804 18.695 5.93625 [3,] 6.666752 18.855 6.45250 [4,] 8.219206 21.950 9.93750 [5,] 9.213170 24.230 11.67500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.940903 17.37037 4.627503 [2,] 7.392601 20.33963 8.277497 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.53966181592494, 6.62780415717169, 6.6667523197236, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1m7cf1492861839.ps tmp/1m7cf1492861839.png",intern=TRUE)) character(0) > try(system("convert tmp/2m46p1492861839.ps tmp/2m46p1492861839.png",intern=TRUE)) character(0) > try(system("convert tmp/383pr1492861839.ps tmp/383pr1492861839.png",intern=TRUE)) character(0) > try(system("convert tmp/4uchs1492861839.ps tmp/4uchs1492861839.png",intern=TRUE)) character(0) > try(system("convert tmp/5yzul1492861839.ps tmp/5yzul1492861839.png",intern=TRUE)) character(0) > try(system("convert tmp/6g04g1492861839.ps tmp/6g04g1492861839.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.219 0.252 2.517