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(80.44,80.9,81.03,81.6,81.56,82.08,83.44,83.55,82.63,82.43,82.42,82.48,82.51,83.23,83.41,83.88,83.96,84.32,85.82,85.72,84.36,84.36,84.36,85.08,84.95,85.62,86.22,86.4,86.71,87.51,89.22,89.43,88.24,88.9,88.78,89.25,88.8,89.46,89.66,90.29,90.08,90.42,92.14,92.09,91.35,91.22,90.99,91.48,90.98,91.52,91.62,92.12,92.26,92.18,94.12,93.82,93.2,93.34,93.11,93.63,93.29,93.69,94.19,94.82,94.52,94.94,96.87,96.6,95.43,95.56,95.37,96,95.6,96.17,96.26,97.2,97.23,97.74,99.37,99.37,98.22,98.27,97.98,98.53,97.98,98.63,98.74,99.37,99.51,99.66,101.62,101.71,100.49,100.81,100.48,101.01,100.62,101.12,101.45,101.34,101.39,101.93,102.42,102.18,102.72,102.43,102.35,102.69) > 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,] 80.44 82.51 84.95 88.80 90.98 93.29 95.60 97.98 100.62 NA [2,] 80.90 83.23 85.62 89.46 91.52 93.69 96.17 98.63 101.12 NA [3,] 81.03 83.41 86.22 89.66 91.62 94.19 96.26 98.74 101.45 NA [4,] 81.60 83.88 86.40 90.29 92.12 94.82 97.20 99.37 101.34 NA [5,] 81.56 83.96 86.71 90.08 92.26 94.52 97.23 99.51 101.39 NA [6,] 82.08 84.32 87.51 90.42 92.18 94.94 97.74 99.66 101.93 NA [7,] 83.44 85.82 89.22 92.14 94.12 96.87 99.37 101.62 102.42 NA [8,] 83.55 85.72 89.43 92.09 93.82 96.60 99.37 101.71 102.18 NA [9,] 82.63 84.36 88.24 91.35 93.20 95.43 98.22 100.49 102.72 NA [10,] 82.43 84.36 88.90 91.22 93.34 95.56 98.27 100.81 102.43 NA [11,] 82.42 84.36 88.78 90.99 93.11 95.37 97.98 100.48 102.35 NA [12,] 82.48 85.08 89.25 91.48 93.63 96.00 98.53 101.01 102.69 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/1ddnv1448540823.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/2sxjd1448540823.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/37d0l1448540823.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/4nt341448540823.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,] 80.44 80.90 81.03 81.60 81.56 82.08 83.44 83.55 82.63 82.43 [2,] 84.95 85.62 86.22 86.40 86.71 87.51 89.22 89.43 88.24 88.90 [3,] 90.98 91.52 91.62 92.12 92.26 92.18 94.12 93.82 93.20 93.34 [4,] 95.60 96.17 96.26 97.20 97.23 97.74 99.37 99.37 98.22 98.27 [5,] 100.62 101.12 101.45 101.34 101.39 101.93 102.42 102.18 102.72 102.43 [,11] [,12] [1,] 82.42 82.48 [2,] 88.78 89.25 [3,] 93.11 93.63 [4,] 97.98 98.53 [5,] 102.35 102.69 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.371 85.96367 86.33227 86.432 86.71947 86.7922 88.77433 88.58493 [2,] 96.589 97.07633 96.90773 97.808 97.80053 97.5678 99.46567 99.05507 [,9] [,10] [,11] [,12] [1,] 87.94387 88.40513 88.26467 88.74253 [2,] 98.45613 98.27487 97.95533 98.51747 $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(80.44, 84.95, 90.98, 95.6, 100.62, 80.9, 85.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59xb91448540823.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,] 80.440 82.510 84.950 88.800 90.980 93.290 95.60 97.980 100.620 NA [2,] 81.295 83.645 86.310 89.870 91.870 94.355 96.73 99.055 101.365 NA [3,] 82.250 84.340 87.875 90.705 92.685 95.155 97.86 100.070 102.055 NA [4,] 82.555 84.720 89.060 91.415 93.485 95.780 98.40 100.910 102.425 NA [5,] 83.550 85.820 89.430 92.140 94.120 96.870 99.37 101.710 102.720 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 81.67531 83.84969 86.62071 90.00032 91.94839 94.50505 97.0983 99.22392 [2,] 82.82469 84.83031 89.12929 91.40968 93.42161 95.80495 98.6217 100.91608 [,9] [,10] [1,] 101.5715 NA [2,] 102.5385 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(80.44, 81.295, 82.25, 82.555, 83.55, 82.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6tl281448540823.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.806948 19.740 9.200 [2,] 6.892808 19.785 9.655 [3,] 6.944112 19.965 10.095 [4,] 6.977952 20.195 10.535 [5,] 6.993962 20.420 10.800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.905278 19.778 9.693626 [2,] 6.982947 20.152 10.496374 $out [1] 6.74555 18.98000 18.63000 $group [1] 1 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.80694763540246, 6.89280750473501, 6.94411241471094, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ddnv1448540823.ps tmp/1ddnv1448540823.png",intern=TRUE)) character(0) > try(system("convert tmp/2sxjd1448540823.ps tmp/2sxjd1448540823.png",intern=TRUE)) character(0) > try(system("convert tmp/37d0l1448540823.ps tmp/37d0l1448540823.png",intern=TRUE)) character(0) > try(system("convert tmp/4nt341448540823.ps tmp/4nt341448540823.png",intern=TRUE)) character(0) > try(system("convert tmp/59xb91448540823.ps tmp/59xb91448540823.png",intern=TRUE)) character(0) > try(system("convert tmp/6tl281448540823.ps tmp/6tl281448540823.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.149 0.402 2.561