R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(74.74,74.80,74.46,74.03,74.45,74.74,74.74,74.78,74.25,74.14,74.41,74.51,74.51,74.64,74.52,74.51,74.39,74.11,74.11,74.20,73.84,73.89,74.31,73.56,73.56,73.99,73.63,73.51,73.60,73.03,73.03,72.61,72.30,72.56,72.76,72.92,72.92,72.93,73.13,73.31,73.34,74.31,74.31,74.65,74.78,74.73,74.71,74.63,74.63,74.95,75.17,75.49,74.54,75.59,75.59,76.06,76.06,76.39,76.39,76.93,76.93,77.39,77.65,78.04,77.66,77.31,77.31,77.33,78.01,78.31,78.61,78.94,78.94,79.84,78.76,78.62,78.36,78.53,78.53,78.76,78.76,79.37,79.83,79.89) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 74.74 74.51 73.56 72.92 74.63 76.93 78.94 NA [2,] 74.80 74.64 73.99 72.93 74.95 77.39 79.84 NA [3,] 74.46 74.52 73.63 73.13 75.17 77.65 78.76 NA [4,] 74.03 74.51 73.51 73.31 75.49 78.04 78.62 NA [5,] 74.45 74.39 73.60 73.34 74.54 77.66 78.36 NA [6,] 74.74 74.11 73.03 74.31 75.59 77.31 78.53 NA [7,] 74.74 74.11 73.03 74.31 75.59 77.31 78.53 NA [8,] 74.78 74.20 72.61 74.65 76.06 77.33 78.76 NA [9,] 74.25 73.84 72.30 74.78 76.06 78.01 78.76 NA [10,] 74.14 73.89 72.56 74.73 76.39 78.31 79.37 NA [11,] 74.41 74.31 72.76 74.71 76.39 78.61 79.83 NA [12,] 74.51 73.56 72.92 74.63 76.93 78.94 79.89 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/1cuqj1398622868.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/2kqq51398622868.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/3v7qt1398622868.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/4qqfl1398622868.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] [1,] 72.920 72.930 73.130 73.310 73.340 73.03 73.03 72.610 72.300 72.560 72.76 [2,] 74.035 74.315 74.045 73.770 73.995 74.21 74.21 74.425 74.045 74.015 74.36 [3,] 74.630 74.800 74.520 74.510 74.450 74.74 74.74 74.780 74.780 74.730 74.71 [4,] 75.835 76.170 76.410 76.765 76.100 76.45 76.45 76.695 77.035 77.350 77.50 [5,] 76.930 77.390 78.760 78.620 78.360 78.53 78.53 78.760 78.760 79.370 79.83 [,12] [1,] 72.920 [2,] 74.035 [3,] 74.630 [4,] 77.935 [5,] 79.890 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.55507 73.69222 73.10766 72.72143 73.19293 73.40231 73.40231 73.42439 [2,] 75.70493 75.90778 75.93234 76.29857 75.70707 76.07769 76.07769 76.13561 [,9] [,10] [,11] [,12] [1,] 72.99442 72.73839 72.83484 72.30098 [2,] 76.56558 76.72161 76.58516 76.95902 $out [1] 78.94 79.84 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(72.92, 74.035, 74.63, 75.835, 76.93, 72.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56y8b1398622868.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] [1,] 74.030 73.560 72.300 72.92 74.540 76.930 78.360 NA [2,] 74.330 74.000 72.685 73.22 75.060 77.320 78.575 NA [3,] 74.485 74.255 73.030 74.31 75.590 77.655 78.760 NA [4,] 74.740 74.510 73.580 74.68 76.225 78.175 79.600 NA [5,] 74.800 74.640 73.990 74.78 76.930 78.940 79.890 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 74.298 74.02239 72.62178 73.64408 75.05864 77.26503 78.29249 NA [2,] 74.672 74.48761 73.43822 74.97592 76.12136 78.04497 79.22751 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(74.03, 74.33, 74.485, 74.74, 74.8, 73.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68h9j1398622868.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.931371 5.020 1.8000 [2,] 2.026168 5.500 2.1725 [3,] 2.126166 6.085 2.3175 [4,] 2.414977 6.860 3.0675 [5,] 2.711786 7.070 3.9000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.948827 5.464695 1.909284 [2,] 2.303504 6.705305 2.725716 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.93137133614829, 2.02616806001593, 2.12616568019993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cuqj1398622868.ps tmp/1cuqj1398622868.png",intern=TRUE)) character(0) > try(system("convert tmp/2kqq51398622868.ps tmp/2kqq51398622868.png",intern=TRUE)) character(0) > try(system("convert tmp/3v7qt1398622868.ps tmp/3v7qt1398622868.png",intern=TRUE)) character(0) > try(system("convert tmp/4qqfl1398622868.ps tmp/4qqfl1398622868.png",intern=TRUE)) character(0) > try(system("convert tmp/56y8b1398622868.ps tmp/56y8b1398622868.png",intern=TRUE)) character(0) > try(system("convert tmp/68h9j1398622868.ps tmp/68h9j1398622868.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.116 0.799 4.926