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(98.01,99.2,100.7,106.41,107.51,107.1,99.75,98.96,107.26,107.11,107.2,107.65,104.78,105.56,107.95,107.11,107.47,107.06,99.71,99.6,107.19,107.26,113.24,113.52,110.48,111.41,115.5,118.32,118.42,117.5,110.23,109.19,118.41,118.3,116.1,114.11,113.41,114.33,116.61,123.64,123.77,123.39,116.03,114.95,123.4,123.53,114.45,114.26,114.35,112.77,115.31,114.93,116.38,115.07,105,103.43,114.52,115.04,117.16,115,116.22,112.92,116.56,114.32,113.22,111.56,103.87,102.85,112.27,112.76,118.55,122.73) > 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,] 98.01 104.78 110.48 113.41 114.35 116.22 NA [2,] 99.20 105.56 111.41 114.33 112.77 112.92 NA [3,] 100.70 107.95 115.50 116.61 115.31 116.56 NA [4,] 106.41 107.11 118.32 123.64 114.93 114.32 NA [5,] 107.51 107.47 118.42 123.77 116.38 113.22 NA [6,] 107.10 107.06 117.50 123.39 115.07 111.56 NA [7,] 99.75 99.71 110.23 116.03 105.00 103.87 NA [8,] 98.96 99.60 109.19 114.95 103.43 102.85 NA [9,] 107.26 107.19 118.41 123.40 114.52 112.27 NA [10,] 107.11 107.26 118.30 123.53 115.04 112.76 NA [11,] 107.20 113.24 116.10 114.45 117.16 118.55 NA [12,] 107.65 113.52 114.11 114.26 115.00 122.73 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/1pnjt1369229254.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/23zck1369229254.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/3dkw31369229254.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/4lqh91369229254.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,] 98.010 99.20 100.700 106.410 107.47 107.060 99.710 98.96 107.190 [2,] 104.780 105.56 107.950 107.110 107.51 107.100 99.750 99.60 107.260 [3,] 111.945 112.09 115.405 114.625 114.80 113.315 104.435 103.14 113.395 [4,] 114.350 112.92 116.560 118.320 118.42 117.500 110.230 109.19 118.410 [5,] 116.220 114.33 116.610 123.640 123.77 123.390 116.030 114.95 123.400 [,10] [,11] [,12] [1,] 107.11 113.240 113.520 [2,] 107.26 113.240 113.520 [3,] 113.90 115.275 114.185 [4,] 118.30 117.160 115.000 [5,] 123.53 118.550 115.000 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.772 107.3426 109.8513 107.3942 107.7627 106.6067 97.67506 96.95414 [2,] 118.118 116.8374 120.9587 121.8558 121.8373 120.0233 111.19494 109.32586 [,9] [,10] [,11] [,12] [1,] 106.2029 106.7788 112.7465 113.2304 [2,] 120.5871 121.0212 117.8035 115.1396 $out [1] 107.20 107.65 122.73 $group [1] 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.01, 104.78, 111.945, 114.35, 116.22, 99.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/59wbz1369229254.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,] 98.010 104.78 109.190 113.410 112.770 111.560 NA [2,] 99.475 105.17 110.945 114.390 113.560 111.915 NA [3,] 106.755 107.15 115.800 116.320 114.965 113.070 NA [4,] 107.230 107.71 118.310 123.465 115.190 116.390 NA [5,] 107.650 107.95 118.420 123.770 117.160 122.730 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.2179 105.9915 112.4408 112.1808 114.2215 111.0289 NA [2,] 110.2921 108.3085 119.1592 120.4592 115.7085 115.1111 NA $out [1] 99.71 99.60 113.24 113.52 105.00 103.43 103.87 102.85 $group [1] 2 2 2 2 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.01, 99.475, 106.755, 107.23, 107.65, 104.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6lk0a1369229254.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,] 5.845863 15.080 3.35250 [2,] 5.997945 15.520 6.18250 [3,] 6.364918 16.255 8.02625 [4,] 6.435029 16.375 8.76375 [5,] 6.916899 17.230 8.97250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.165561 15.86503 6.848925 [2,] 6.564274 16.64497 9.203575 $out [1] 4.022517 4.817953 18.210000 11.350000 1.147500 $group [1] 1 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(5.84586263950839, 5.99794514086135, 6.3649175207444, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1pnjt1369229254.ps tmp/1pnjt1369229254.png",intern=TRUE)) character(0) > try(system("convert tmp/23zck1369229254.ps tmp/23zck1369229254.png",intern=TRUE)) character(0) > try(system("convert tmp/3dkw31369229254.ps tmp/3dkw31369229254.png",intern=TRUE)) character(0) > try(system("convert tmp/4lqh91369229254.ps tmp/4lqh91369229254.png",intern=TRUE)) character(0) > try(system("convert tmp/59wbz1369229254.ps tmp/59wbz1369229254.png",intern=TRUE)) character(0) > try(system("convert tmp/6lk0a1369229254.ps tmp/6lk0a1369229254.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.863 0.900 5.752