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(93.58,95.79,94.77,94.2,96.23,92.3,88.86,86.44,86.21,88.57,90.69,89,86.88,90.65,90.68,89.64,102.62,101.84,92.51,94.29,94.68,96.94,94.03,89.65,84.9,89.07,89.8,93.22,92.23,98.41,96.63,89.8,90,92.13,93.27,90.81,85.42,88.28,88.73,90.18,92.74,96.13,94.85,94.25,96.94,101.22,98.71,95.51,93.91,98.17,97.59,99.64,107.88,108.49,100.25,99.27,101.73,101.25,97.09,94.74,94.53,93.48,96.05,106.22,98.33,99.86,93.78,88.96,83.77,89.46,86.78,88.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,] 93.58 86.88 84.90 85.42 93.91 94.53 NA [2,] 95.79 90.65 89.07 88.28 98.17 93.48 NA [3,] 94.77 90.68 89.80 88.73 97.59 96.05 NA [4,] 94.20 89.64 93.22 90.18 99.64 106.22 NA [5,] 96.23 102.62 92.23 92.74 107.88 98.33 NA [6,] 92.30 101.84 98.41 96.13 108.49 99.86 NA [7,] 88.86 92.51 96.63 94.85 100.25 93.78 NA [8,] 86.44 94.29 89.80 94.25 99.27 88.96 NA [9,] 86.21 94.68 90.00 96.94 101.73 83.77 NA [10,] 88.57 96.94 92.13 101.22 101.25 89.46 NA [11,] 90.69 94.03 93.27 98.71 97.09 86.78 NA [12,] 89.00 89.65 90.81 95.51 94.74 88.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/1hplu1447938472.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/2gum41447938472.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/3y11z1447938472.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/4v0721447938472.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,] 84.90 88.280 88.730 89.64 92.23 92.300 88.860 86.440 83.77 88.570 [2,] 85.42 89.070 89.800 90.18 92.74 96.130 92.510 88.960 86.21 89.460 [3,] 90.23 92.065 92.725 93.71 97.28 99.135 94.315 92.025 92.34 94.535 [4,] 93.91 95.790 96.050 99.64 102.62 101.840 96.630 94.290 96.94 101.220 [5,] 94.53 98.170 97.590 106.22 107.88 108.490 100.250 99.270 101.73 101.250 [,11] [,12] [1,] 86.78 88.40 [2,] 90.69 89.00 [3,] 93.65 90.23 [4,] 97.09 94.74 [5,] 98.71 95.51 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 84.75368 87.73038 88.69355 87.60799 90.90708 95.45187 91.65747 88.58698 [2,] 95.70632 96.39962 96.75645 99.81201 103.65292 102.81813 96.97253 95.46302 [,9] [,10] [,11] [,12] [1,] 85.4188 86.94942 89.52179 86.52751 [2,] 99.2612 102.12058 97.77821 93.93249 $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(84.9, 85.42, 90.23, 93.91, 94.53, 88.28, 89.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vgj31447938472.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,] 86.210 86.88 84.900 85.420 93.910 83.77 NA [2,] 88.715 90.15 89.800 89.455 97.340 88.68 NA [3,] 91.495 93.27 91.470 94.550 99.455 93.63 NA [4,] 94.485 95.81 93.245 96.535 101.490 97.19 NA [5,] 96.230 102.62 98.410 101.220 101.730 106.22 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 88.86326 90.68844 89.89871 91.32076 97.56216 89.74853 NA [2,] 94.12674 95.85156 93.04129 97.77924 101.34784 97.51147 NA $out [1] 107.88 108.49 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(86.21, 88.715, 91.495, 94.485, 96.23, 86.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v5nr1447938472.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.039878 7.110 3.35750 [2,] 3.884465 9.760 4.81750 [3,] 4.617583 12.305 5.72875 [4,] 5.864464 15.920 7.98875 [5,] 6.800310 17.960 10.02250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.714492 9.495383 4.282322 [2,] 5.520673 15.114617 7.175178 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.03987773876955, 3.88446523630247, 4.6175825002474, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hplu1447938472.ps tmp/1hplu1447938472.png",intern=TRUE)) character(0) > try(system("convert tmp/2gum41447938472.ps tmp/2gum41447938472.png",intern=TRUE)) character(0) > try(system("convert tmp/3y11z1447938472.ps tmp/3y11z1447938472.png",intern=TRUE)) character(0) > try(system("convert tmp/4v0721447938472.ps tmp/4v0721447938472.png",intern=TRUE)) character(0) > try(system("convert tmp/5vgj31447938472.ps tmp/5vgj31447938472.png",intern=TRUE)) character(0) > try(system("convert tmp/6v5nr1447938472.ps tmp/6v5nr1447938472.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.095 0.428 2.549