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(0.62,0.7,1.65,1.79,2.28,2.46,2.57,2.32,2.91,3.01,2.87,3.11,3.22,3.38,3.52,3.41,3.35,3.68,3.75,3.6,3.56,3.57,3.85,3.48,3.65,3.66,3.36,3.19,2.81,2.25,2.32,2.85,2.75,2.78,2.26,2.23,1.46,1.19,1.11,1,1.18,1.59,1.51,1.01,0.9,0.63,0.81,0.97,1.14,0.97,0.89,0.62,0.36,0.27,0.34,0.02,-0.12,0.09,-0.11,-0.38) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.62 3.22 3.65 1.46 1.14 NA [2,] 0.70 3.38 3.66 1.19 0.97 NA [3,] 1.65 3.52 3.36 1.11 0.89 NA [4,] 1.79 3.41 3.19 1.00 0.62 NA [5,] 2.28 3.35 2.81 1.18 0.36 NA [6,] 2.46 3.68 2.25 1.59 0.27 NA [7,] 2.57 3.75 2.32 1.51 0.34 NA [8,] 2.32 3.60 2.85 1.01 0.02 NA [9,] 2.91 3.56 2.75 0.90 -0.12 NA [10,] 3.01 3.57 2.78 0.63 0.09 NA [11,] 2.87 3.85 2.26 0.81 -0.11 NA [12,] 3.11 3.48 2.23 0.97 -0.38 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/1f5ia1448018373.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/2g58z1448018373.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/3tpaw1448018373.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/4ksuz1448018373.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] [,11] [,12] [1,] 0.62 0.70 0.89 0.62 0.36 1.59 0.34 0.02 -0.12 0.09 -0.11 -0.38 [2,] 1.14 0.97 1.11 1.00 1.18 1.59 1.51 1.01 0.90 0.63 0.81 0.97 [3,] 1.46 1.19 1.65 1.79 2.28 2.25 2.32 2.32 2.75 2.78 2.26 2.23 [4,] 3.22 3.38 3.36 3.19 2.81 2.46 2.57 2.85 2.91 3.01 2.87 3.11 [5,] 3.65 3.66 3.52 3.41 3.35 3.68 3.75 3.60 3.56 3.57 3.85 3.48 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.00972276 -0.5128999 0.06015567 0.2425515 1.128246 1.63526 1.571007 [2,] 2.92972276 2.8928999 3.23984433 3.3374485 3.431754 2.86474 3.068993 [,8] [,9] [,10] [,11] [,12] [1,] 1.019861 1.329739 1.098298 0.8044092 0.7178814 [2,] 3.620139 4.170261 4.461702 3.7155908 3.7421186 $out [1] 0.27 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.62, 1.14, 1.46, 3.22, 3.65, 0.7, 0.97, 1.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o0w41448018373.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] [1,] 0.62 3.220 2.230 0.630 -0.380 NA [2,] 1.72 3.395 2.290 0.935 -0.045 NA [3,] 2.39 3.540 2.795 1.060 0.305 NA [4,] 2.89 3.640 3.275 1.325 0.755 NA [5,] 3.11 3.850 3.660 1.590 1.140 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.856355 3.428254 2.345735 0.8821184 -0.05988537 NA [2,] 2.923645 3.651746 3.244265 1.2378816 0.66988537 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(0.62, 1.72, 2.39, 2.89, 3.11, 3.22, 3.395, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j7he1448018373.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.216442 2.630 1.060 [2,] 1.255139 2.975 1.735 [3,] 1.378221 3.410 2.070 [4,] 1.546998 3.630 2.220 [5,] 1.591468 3.960 2.410 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.245103 3.11125 1.848788 [2,] 1.511340 3.70875 2.291212 $out [1] 0.87 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.21644153168165, 1.25513908454792, 1.37822129962137, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1f5ia1448018373.ps tmp/1f5ia1448018373.png",intern=TRUE)) character(0) > try(system("convert tmp/2g58z1448018373.ps tmp/2g58z1448018373.png",intern=TRUE)) character(0) > try(system("convert tmp/3tpaw1448018373.ps tmp/3tpaw1448018373.png",intern=TRUE)) character(0) > try(system("convert tmp/4ksuz1448018373.ps tmp/4ksuz1448018373.png",intern=TRUE)) character(0) > try(system("convert tmp/5o0w41448018373.ps tmp/5o0w41448018373.png",intern=TRUE)) character(0) > try(system("convert tmp/6j7he1448018373.ps tmp/6j7he1448018373.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.232 0.385 2.634