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.03,100.65,100.66,100.54,100.51,100.53,100.53,101.02,101.07,101.37,101.45,101.44,101.45,100.99,101.11,101.31,101.53,101.6,101.61,102.04,102.36,102.74,102.96,103.01,103.02,102.34,102.38,102.54,102.71,102.78,102.78,103.27,103.4,103.74,103.89,103.92,99.68,99.06,99.12,99.37,99.63,99.69,99.76,100.16,100.46,100.83,101.09,101.14,101.25,101.09,101.18,101.14,101.23,101.17,100.84,101.04,101.18,101.1,101.21,101.26,101.85,101.82,101.93,101.95,101.97,102.04,101.37,101.2,101.14,101.27,101.39,101.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,] 101.03 101.45 103.02 99.68 101.25 101.85 NA [2,] 100.65 100.99 102.34 99.06 101.09 101.82 NA [3,] 100.66 101.11 102.38 99.12 101.18 101.93 NA [4,] 100.54 101.31 102.54 99.37 101.14 101.95 NA [5,] 100.51 101.53 102.71 99.63 101.23 101.97 NA [6,] 100.53 101.60 102.78 99.69 101.17 102.04 NA [7,] 100.53 101.61 102.78 99.76 100.84 101.37 NA [8,] 101.02 102.04 103.27 100.16 101.04 101.20 NA [9,] 101.07 102.36 103.40 100.46 101.18 101.14 NA [10,] 101.37 102.74 103.74 100.83 101.10 101.27 NA [11,] 101.45 102.96 103.89 101.09 101.21 101.39 NA [12,] 101.44 103.01 103.92 101.14 101.26 101.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/169x81492945672.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/25kmx1492945672.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/38z0c1492945672.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/45r5d1492945672.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.03 99.06 99.120 99.370 99.63 99.690 99.760 100.16 100.46 100.83 [2,] 101.03 100.65 100.660 100.540 100.51 100.530 100.530 101.02 101.07 101.10 [3,] 101.35 101.04 101.145 101.225 101.38 101.385 101.105 101.12 101.16 101.32 [4,] 101.85 101.82 101.930 101.950 101.97 102.040 101.610 102.04 102.36 102.74 [5,] 103.02 102.34 102.380 102.540 102.71 102.780 102.780 103.27 103.40 103.74 [,11] [,12] [1,] 101.09 101.14 [2,] 101.21 101.26 [3,] 101.42 101.42 [4,] 102.96 103.01 [5,] 103.89 103.92 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.8211 100.2853 100.3258 100.3155 100.4383 100.411 100.4084 100.4621 [2,] 101.8789 101.7947 101.9642 102.1345 102.3217 102.359 101.8016 101.7779 [,9] [,10] [,11] [,12] [1,] 100.3279 100.2621 100.2912 100.2912 [2,] 101.9921 102.3779 102.5488 102.5488 $out [1] 99.68 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.03, 101.03, 101.35, 101.85, 103.02, 99.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yuu01492945672.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,] 100.510 100.990 102.340 99.060 101.040 101.14 NA [2,] 100.535 101.380 102.625 99.500 101.095 101.32 NA [3,] 100.840 101.605 102.900 99.725 101.175 101.61 NA [4,] 101.220 102.550 103.570 100.645 101.220 101.94 NA [5,] 101.450 103.010 103.920 101.140 101.260 102.04 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.5276 101.0714 102.469 99.20276 101.118 101.3272 NA [2,] 101.1524 102.1386 103.331 100.24724 101.232 101.8928 NA $out [1] 100.84 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100.51, 100.535, 100.84, 101.22, 101.45, 100.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q7nk1492945672.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.032423 2.780 0.66500 [2,] 1.080997 2.925 0.92250 [3,] 1.103065 3.085 1.03875 [4,] 1.138993 3.215 1.24750 [5,] 1.154338 3.340 1.32750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.076613 2.952729 0.8905153 [2,] 1.129518 3.217271 1.1869847 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.0324227170431, 1.08099677776395, 1.10306513916362, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/169x81492945672.ps tmp/169x81492945672.png",intern=TRUE)) character(0) > try(system("convert tmp/25kmx1492945672.ps tmp/25kmx1492945672.png",intern=TRUE)) character(0) > try(system("convert tmp/38z0c1492945672.ps tmp/38z0c1492945672.png",intern=TRUE)) character(0) > try(system("convert tmp/45r5d1492945672.ps tmp/45r5d1492945672.png",intern=TRUE)) character(0) > try(system("convert tmp/5yuu01492945672.ps tmp/5yuu01492945672.png",intern=TRUE)) character(0) > try(system("convert tmp/6q7nk1492945672.ps tmp/6q7nk1492945672.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.018 0.312 3.403