R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(91.99,92.17,92.19,92.24,92.19,92.21,92.22,92.14,92.43,92.93,93.01,93.07,93.08,93.11,93.21,93.49,93.48,93.51,93.52,93.49,93.76,94.25,94.42,94.45,94.45,94.53,94.78,95.05,95.21,95.23,95.23,95.34,95.93,96.75,97.15,97.21,97.21,97.35,97.44,97.34,97.44,97.43,97.43,97.47,97.69,98.54,98.64,98.72,98.72,98.73,98.68,98.75,98.73,98.74,98.75,98.85,99.14,99.83,99.93,100,100,100.08,100.25,100.4,100.33,100.29,100.29,100.32,100.82,101.42,101.46,101.55,101.56,101.56,101.6,101.66,101.82,101.94,101.95,101.93,102.26,102.65,102.9,102.94,99.14,99.18,99.23,99.32,99.46,99.5,99.95,100.13,100.43,101.09,101.27,101.29,101.04,101.14,101.11,101.01,101.08,101.06,101.26,101.32,101.4,101.85,102.12,102.15) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 91.99 93.08 94.45 97.21 98.72 100.00 101.56 99.14 101.04 NA [2,] 92.17 93.11 94.53 97.35 98.73 100.08 101.56 99.18 101.14 NA [3,] 92.19 93.21 94.78 97.44 98.68 100.25 101.60 99.23 101.11 NA [4,] 92.24 93.49 95.05 97.34 98.75 100.40 101.66 99.32 101.01 NA [5,] 92.19 93.48 95.21 97.44 98.73 100.33 101.82 99.46 101.08 NA [6,] 92.21 93.51 95.23 97.43 98.74 100.29 101.94 99.50 101.06 NA [7,] 92.22 93.52 95.23 97.43 98.75 100.29 101.95 99.95 101.26 NA [8,] 92.14 93.49 95.34 97.47 98.85 100.32 101.93 100.13 101.32 NA [9,] 92.43 93.76 95.93 97.69 99.14 100.82 102.26 100.43 101.40 NA [10,] 92.93 94.25 96.75 98.54 99.83 101.42 102.65 101.09 101.85 NA [11,] 93.01 94.42 97.15 98.64 99.93 101.46 102.90 101.27 102.12 NA [12,] 93.07 94.45 97.21 98.72 100.00 101.55 102.94 101.29 102.15 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/1gg9h1447877115.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/2bo9h1447877115.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/3j2yc1447877115.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/4d4oe1447877115.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,] 91.99 92.17 92.19 92.24 92.19 92.21 92.22 92.14 92.43 92.93 [2,] 94.45 94.53 94.78 95.05 95.21 95.23 95.23 95.34 95.93 96.75 [3,] 98.72 98.73 98.68 98.75 98.73 98.74 98.75 98.85 99.14 99.83 [4,] 100.00 100.08 100.25 100.40 100.33 100.29 100.29 100.32 100.82 101.42 [5,] 101.56 101.56 101.60 101.66 101.82 101.94 101.95 101.93 102.26 102.65 [,11] [,12] [1,] 93.01 93.07 [2,] 97.15 97.21 [3,] 99.93 100.00 [4,] 101.46 101.55 [5,] 102.90 102.94 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.797 95.807 95.79913 95.93233 96.03347 96.07507 96.08507 96.2272 [2,] 101.643 101.653 101.56087 101.56767 101.42653 101.40493 101.41493 101.4728 [,9] [,10] [,11] [,12] [1,] 96.5646 97.37047 97.66007 97.71427 [2,] 101.7154 102.28953 102.19993 102.28573 $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(91.99, 94.45, 98.72, 100, 101.56, 92.17, 94.53, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f84g1447877115.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] [,9] [,10] [1,] 91.990 93.080 94.450 97.210 98.680 100.000 101.560 99.140 101.010 NA [2,] 92.180 93.345 94.915 97.390 98.730 100.270 101.630 99.275 101.070 NA [3,] 92.215 93.500 95.230 97.440 98.750 100.325 101.935 99.725 101.200 NA [4,] 92.680 94.005 96.340 98.115 99.485 101.120 102.455 100.760 101.625 NA [5,] 93.070 94.450 97.210 98.720 100.000 101.550 102.940 101.290 102.150 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.98695 93.19897 94.58005 97.10932 98.40564 99.93731 101.5587 99.04768 [2,] 92.44305 93.80103 95.87995 97.77068 99.09436 100.71269 102.3113 100.40232 [,9] [,10] [1,] 100.9469 NA [2,] 101.4531 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(91.99, 92.18, 92.215, 92.68, 93.07, 93.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/604rz1447877115.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,] 3.397466 9.390 4.31 [2,] 3.444248 9.495 4.78 [3,] 3.485090 9.725 5.06 [4,] 3.493607 9.810 5.41 [5,] 3.518380 9.890 5.55 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.462578 9.581326 4.772653 [2,] 3.507603 9.868674 5.347347 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.39746637625419, 3.44424846522043, 3.4850904465507, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gg9h1447877115.ps tmp/1gg9h1447877115.png",intern=TRUE)) character(0) > try(system("convert tmp/2bo9h1447877115.ps tmp/2bo9h1447877115.png",intern=TRUE)) character(0) > try(system("convert tmp/3j2yc1447877115.ps tmp/3j2yc1447877115.png",intern=TRUE)) character(0) > try(system("convert tmp/4d4oe1447877115.ps tmp/4d4oe1447877115.png",intern=TRUE)) character(0) > try(system("convert tmp/5f84g1447877115.ps tmp/5f84g1447877115.png",intern=TRUE)) character(0) > try(system("convert tmp/604rz1447877115.ps tmp/604rz1447877115.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.329 0.402 2.754