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(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,87.19,92.23,95.99,104.75,105.63,108.71,96.4,93.31,93.77,98.7,95.04,95.61) > 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,] 86.88 84.90 85.42 93.91 94.53 87.19 NA [2,] 90.65 89.07 88.28 98.17 93.48 92.23 NA [3,] 90.68 89.80 88.73 97.59 96.05 95.99 NA [4,] 89.64 93.22 90.18 99.64 106.22 104.75 NA [5,] 102.62 92.23 92.74 107.88 98.33 105.63 NA [6,] 101.84 98.41 96.13 108.49 99.86 108.71 NA [7,] 92.51 96.63 94.85 100.25 93.78 96.40 NA [8,] 94.29 89.80 94.25 99.27 88.96 93.31 NA [9,] 94.68 90.00 96.94 101.73 83.77 93.77 NA [10,] 96.94 92.13 101.22 101.25 89.46 98.70 NA [11,] 94.03 93.27 98.71 97.09 86.78 95.04 NA [12,] 89.65 90.81 95.51 94.74 88.40 95.61 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/10pvz1492783791.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/26b491492783791.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/3j3i11492783791.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/4rq5t1492783791.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.900 88.28 88.730 89.64 92.230 96.13 92.510 88.96 83.770 89.46 [2,] 85.420 89.07 89.800 90.18 92.740 98.41 93.780 89.80 90.000 92.13 [3,] 87.035 91.44 93.335 96.43 100.475 100.85 95.625 93.78 94.225 97.82 [4,] 93.910 93.48 96.050 104.75 105.630 108.49 96.630 94.29 96.940 101.22 [5,] 94.530 98.17 97.590 106.22 107.880 108.71 100.250 99.27 101.730 101.25 [,11] [,12] [1,] 93.270 88.400 [2,] 93.270 89.650 [3,] 94.535 92.775 [4,] 97.090 95.510 [5,] 98.710 95.610 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 81.55868 88.59541 89.30355 87.03188 92.16053 94.34807 93.78666 90.8838 [2,] 92.51132 94.28459 97.36645 105.82812 108.78947 107.35193 97.46334 96.6762 [,9] [,10] [,11] [,12] [1,] 89.74848 91.95666 92.07098 88.99511 [2,] 98.70152 103.68334 96.99902 96.55489 $out [1] 86.78 $group [1] 11 $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, 87.035, 93.91, 94.53, 88.28, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f5461492783791.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.88 84.900 85.420 93.910 83.77 87.190 NA [2,] 90.15 89.800 89.455 97.340 88.68 93.540 NA [3,] 93.27 91.470 94.550 99.455 93.63 95.800 NA [4,] 95.81 93.245 96.535 101.490 97.19 101.725 NA [5,] 102.62 98.410 101.220 101.730 106.22 108.710 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.68844 89.89871 91.32076 97.56216 89.74853 92.06677 NA [2,] 95.85156 93.04129 97.77924 101.34784 97.51147 99.53323 NA $out [1] 107.88 108.49 $group [1] 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(86.88, 90.15, 93.27, 95.81, 102.62, 84.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68rhn1492783791.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,] 2.706819 7.210 2.52500 [2,] 3.648738 9.245 3.65250 [3,] 4.208713 11.050 5.72375 [4,] 5.699458 14.115 7.65625 [5,] 7.301468 17.960 12.53250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.273366 8.82876 3.897613 [2,] 5.144060 13.27124 7.549887 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.70681855074674, 3.64873805305113, 4.20871279020716, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10pvz1492783791.ps tmp/10pvz1492783791.png",intern=TRUE)) character(0) > try(system("convert tmp/26b491492783791.ps tmp/26b491492783791.png",intern=TRUE)) character(0) > try(system("convert tmp/3j3i11492783791.ps tmp/3j3i11492783791.png",intern=TRUE)) character(0) > try(system("convert tmp/4rq5t1492783791.ps tmp/4rq5t1492783791.png",intern=TRUE)) character(0) > try(system("convert tmp/5f5461492783791.ps tmp/5f5461492783791.png",intern=TRUE)) character(0) > try(system("convert tmp/68rhn1492783791.ps tmp/68rhn1492783791.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.118 0.352 3.586