R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(68.906,39.556,50.669,36.432,40.891,48.428,36.222,33.425,39.401,37.967,34.801,12.657,69.116,41.519,51.321,38.529,41.547,52.073,38.401,40.898,40.439,41.888,37.898,8.771,68.184,50.530,47.221,41.756,45.633,48.138,39.486,39.341,41.117,41.629,29.722,7.054,56.676,34.870,35.117,30.169,30.936,35.699,33.228,27.733,33.666,35.429,27.438,8.170,63.410,38.040,45.389,37.353,37.024,50.957,37.994,36.454,46.080,43.373,37.395,10.963,76.058,50.179,57.452,47.568,50.050,50.856,41.992,39.284,44.521,43.832,41.153,17.100) > 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,] 68.906 69.116 68.184 56.676 63.410 76.058 NA [2,] 39.556 41.519 50.530 34.870 38.040 50.179 NA [3,] 50.669 51.321 47.221 35.117 45.389 57.452 NA [4,] 36.432 38.529 41.756 30.169 37.353 47.568 NA [5,] 40.891 41.547 45.633 30.936 37.024 50.050 NA [6,] 48.428 52.073 48.138 35.699 50.957 50.856 NA [7,] 36.222 38.401 39.486 33.228 37.994 41.992 NA [8,] 33.425 40.898 39.341 27.733 36.454 39.284 NA [9,] 39.401 40.439 41.117 33.666 46.080 44.521 NA [10,] 37.967 41.888 41.629 35.429 43.373 43.832 NA [11,] 34.801 37.898 29.722 27.438 37.395 41.153 NA [12,] 12.657 8.771 7.054 8.170 10.963 17.100 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/fisher/rcomp/tmp/12rbq1366991843.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/fisher/rcomp/tmp/2ma9u1366991843.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/fisher/rcomp/tmp/3tqeg1366991843.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/fisher/rcomp/tmp/49yn91366991843.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,] 56.676 34.8700 45.389 30.169 30.936 48.138 33.2280 27.733 33.666 35.4290 [2,] 63.410 38.0400 45.389 36.432 37.024 48.138 36.2220 33.425 39.401 37.9670 [3,] 68.545 40.5375 48.945 37.941 41.219 49.642 38.1975 37.869 40.778 41.7585 [4,] 69.116 50.1790 51.321 41.756 45.633 50.957 39.4860 39.341 44.521 43.3730 [5,] 76.058 50.5300 57.452 47.568 50.050 52.073 41.9920 40.898 46.080 43.8320 [,11] [,12] [1,] 27.438 7.054 [2,] 29.722 8.170 [3,] 36.098 9.867 [4,] 37.898 12.657 [5,] 41.153 17.100 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 64.86445 32.70745 45.11867 34.50685 35.66592 47.82365 36.09211 34.05299 [2,] 72.22555 48.36755 52.77133 41.37515 46.77208 51.46035 40.30289 41.68501 [,9] [,10] [,11] [,12] [1,] 37.47543 38.27146 30.82422 6.97274 [2,] 44.08057 45.24554 41.37178 12.76126 $out [1] 35.117 35.699 $group [1] 3 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(56.676, 63.41, 68.545, 69.116, 76.058, 34.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5t8vh1366991843.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,] 33.4250 37.8980 29.7220 27.438 36.4540 39.2840 NA [2,] 35.5115 38.4650 39.4135 28.951 37.1885 41.5725 NA [3,] 38.6840 41.2085 41.6925 33.447 38.0170 46.0445 NA [4,] 44.6595 46.6045 47.6795 35.273 45.7345 50.5175 NA [5,] 50.6690 52.0730 50.5300 35.699 50.9570 57.4520 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 34.51154 37.49602 37.92232 30.56349 34.11911 41.96463 NA [2,] 42.85646 44.92098 45.46268 36.33051 41.91489 50.12437 NA $out [1] 68.906 12.657 69.116 8.771 68.184 7.054 56.676 8.170 63.410 10.963 [11] 76.058 17.100 $group [1] 1 1 2 2 3 3 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(33.425, 35.5115, 38.684, 44.6595, 50.669, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6154r1366991843.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.971935 8.4030 2.549750 [2,] 4.023907 11.2300 3.961375 [3,] 5.509782 14.6875 4.373500 [4,] 6.497557 18.2565 5.965875 [5,] 7.493646 22.3350 6.780500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.381533 11.48267 3.459234 [2,] 6.638030 17.89233 5.287766 $out [1] 9.595 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.97193461682229, 4.02390690975115, 5.5097819722015, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12rbq1366991843.ps tmp/12rbq1366991843.png",intern=TRUE)) character(0) > try(system("convert tmp/2ma9u1366991843.ps tmp/2ma9u1366991843.png",intern=TRUE)) character(0) > try(system("convert tmp/3tqeg1366991843.ps tmp/3tqeg1366991843.png",intern=TRUE)) character(0) > try(system("convert tmp/49yn91366991843.ps tmp/49yn91366991843.png",intern=TRUE)) character(0) > try(system("convert tmp/5t8vh1366991843.ps tmp/5t8vh1366991843.png",intern=TRUE)) character(0) > try(system("convert tmp/6154r1366991843.ps tmp/6154r1366991843.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.014 0.612 3.603