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(227.81,227.81,227.01,227.26,227.1,227.59,227.59,227.7,227.75,226.33,225.95,226.33,226.33,226.22,224.84,221.88,222.37,221.8,221.8,221.8,221.9,220.2,219.95,220.05,220.05,220.05,220.62,221.53,221.61,221.5,221.5,221.87,222.27,220.86,221.49,221.67,221.67,221.72,221.67,220.29,220.75,219.59,219.59,219.59,219.82,221.59,220.9,221.01,221.01,219.69,221,219.82,218.04,217.97,217.97,217.53,217,217.18,217.68,217.71,217.71,218.5,218.8,218.94,220,219.89,219.89,220.08,220.16,221,222.16,221.5,221.5,221.6,221.85,223.11,222.79,222.45,222.45,222.4,223.15,224.4,224.24,223.92) > 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,] 227.81 226.33 220.05 221.67 221.01 217.71 221.50 NA [2,] 227.81 226.22 220.05 221.72 219.69 218.50 221.60 NA [3,] 227.01 224.84 220.62 221.67 221.00 218.80 221.85 NA [4,] 227.26 221.88 221.53 220.29 219.82 218.94 223.11 NA [5,] 227.10 222.37 221.61 220.75 218.04 220.00 222.79 NA [6,] 227.59 221.80 221.50 219.59 217.97 219.89 222.45 NA [7,] 227.59 221.80 221.50 219.59 217.97 219.89 222.45 NA [8,] 227.70 221.80 221.87 219.59 217.53 220.08 222.40 NA [9,] 227.75 221.90 222.27 219.82 217.00 220.16 223.15 NA [10,] 226.33 220.20 220.86 221.59 217.18 221.00 224.40 NA [11,] 225.95 219.95 221.49 220.90 217.68 222.16 224.24 NA [12,] 226.33 220.05 221.67 221.01 217.71 221.50 223.92 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/1jkx31398697411.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/2az001398697411.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/3jabe1398697411.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/4brnq1398697411.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] [1,] 217.71 218.50 218.800 218.940 218.040 217.970 217.970 217.530 217.00 [2,] 220.53 219.87 220.810 220.055 220.375 219.740 219.740 219.835 219.99 [3,] 221.50 221.60 221.670 221.530 221.610 221.500 221.500 221.800 221.90 [4,] 224.00 223.97 223.345 222.495 222.580 222.125 222.125 222.135 222.71 [5,] 227.81 227.81 227.010 223.110 222.790 222.450 222.450 222.400 223.15 [,10] [,11] [,12] [1,] 217.180 217.680 217.710 [2,] 220.530 220.425 220.530 [3,] 221.000 221.490 221.500 [4,] 222.995 223.200 222.795 [5,] 226.330 225.950 223.920 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 219.4278 219.1515 220.1561 220.0729 220.2932 220.0757 220.0757 220.4265 [2,] 223.5722 224.0485 223.1839 222.9871 222.9268 222.9243 222.9243 223.1735 [,9] [,10] [,11] [,12] [1,] 220.2757 219.5279 219.8328 220.1474 [2,] 223.5243 222.4721 223.1472 222.8526 $out [1] 227.26 227.10 227.59 227.59 227.70 227.75 226.33 $group [1] 4 5 6 7 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(217.71, 220.53, 221.5, 224, 227.81, 218.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dx1a1398697411.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,] 225.950 219.950 220.05 219.590 217.000 217.710 221.500 NA [2,] 226.670 221.000 220.74 219.705 217.605 218.870 222.125 NA [3,] 227.425 221.840 221.50 220.825 217.970 219.945 222.620 NA [4,] 227.725 223.605 221.64 221.630 219.755 220.580 223.535 NA [5,] 227.810 226.330 222.27 221.720 221.010 222.160 224.400 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 226.9438 220.6518 221.0895 219.947 216.9894 219.1651 221.9769 NA [2,] 227.9062 223.0282 221.9105 221.703 218.9506 220.7249 223.2631 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(225.95, 226.67, 227.425, 227.725, 227.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/616kf1398697411.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.726449 8.21 2.2050 [2,] 2.768323 8.47 2.3425 [3,] 3.018393 9.23 2.4525 [4,] 3.264180 9.86 2.7475 [5,] 3.545714 10.75 2.7750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.792229 8.596012 2.267777 [2,] 3.244557 9.863988 2.637223 $out [1] 3.47 4.10 $group [1] 3 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.72644893763368, 2.76832251006974, 3.01839341284377, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jkx31398697411.ps tmp/1jkx31398697411.png",intern=TRUE)) character(0) > try(system("convert tmp/2az001398697411.ps tmp/2az001398697411.png",intern=TRUE)) character(0) > try(system("convert tmp/3jabe1398697411.ps tmp/3jabe1398697411.png",intern=TRUE)) character(0) > try(system("convert tmp/4brnq1398697411.ps tmp/4brnq1398697411.png",intern=TRUE)) character(0) > try(system("convert tmp/5dx1a1398697411.ps tmp/5dx1a1398697411.png",intern=TRUE)) character(0) > try(system("convert tmp/616kf1398697411.ps tmp/616kf1398697411.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.346 0.816 5.184