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(105.28,107,106.29,108.07,105.41,104.4,102.77,102.44,103.43,102.95,103.52,105.2,105.88,104.88,106.59,107.8,106.31,106.53,106.25,105.87,107.83,108.01,107.9,108.55,108.83,109.39,108.65,108.33,109.76,110.07,109.23,108.4,108.9,109.14,109.27,109.38,109.66,109.87,109.98,111.24,110.03,111.43,110.28,109.53,111.97,111.89,112.93,113.11,112.95,114.08,115.27,114.73,114.97,113.78,113.7,113.91,114.22,115.32,113.5,115.35,113.23,113.65,114.82,113.54,113.97,113.79,113.27,114.35,113.68,115.3,113.69,115.31) > 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,] 105.28 105.88 108.83 109.66 112.95 113.23 NA [2,] 107.00 104.88 109.39 109.87 114.08 113.65 NA [3,] 106.29 106.59 108.65 109.98 115.27 114.82 NA [4,] 108.07 107.80 108.33 111.24 114.73 113.54 NA [5,] 105.41 106.31 109.76 110.03 114.97 113.97 NA [6,] 104.40 106.53 110.07 111.43 113.78 113.79 NA [7,] 102.77 106.25 109.23 110.28 113.70 113.27 NA [8,] 102.44 105.87 108.40 109.53 113.91 114.35 NA [9,] 103.43 107.83 108.90 111.97 114.22 113.68 NA [10,] 102.95 108.01 109.14 111.89 115.32 115.30 NA [11,] 103.52 107.90 109.27 112.93 113.50 113.69 NA [12,] 105.20 108.55 109.38 113.11 115.35 115.31 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/10u681366617305.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/2e46f1366617305.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/36z8q1366617305.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/40hcp1366617305.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,] 105.280 104.88 106.290 107.800 105.410 104.40 102.770 102.440 103.430 [2,] 105.880 107.00 106.590 108.070 106.310 106.53 106.250 105.870 107.830 [3,] 109.245 109.63 109.315 109.785 109.895 110.75 109.755 108.965 110.435 [4,] 112.950 113.65 114.820 113.540 113.970 113.78 113.270 113.910 113.680 [5,] 113.230 114.08 115.270 114.730 114.970 113.79 113.700 114.350 114.220 [,10] [,11] [,12] [1,] 102.950 103.52 105.200 [2,] 108.010 107.90 108.550 [3,] 110.515 111.10 111.245 [4,] 115.300 113.50 115.310 [5,] 115.320 113.69 115.350 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.6846 105.3405 104.0064 106.2567 104.9541 106.0735 105.2269 103.7789 [2,] 113.8054 113.9195 114.6236 113.3133 114.8359 115.4265 114.2831 114.1511 [,9] [,10] [,11] [,12] [1,] 106.6616 105.8127 107.4878 106.8846 [2,] 114.2084 115.2173 114.7122 115.6054 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(105.28, 105.88, 109.245, 112.95, 113.23, 104.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51ovs1366617305.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,] 102.44 104.880 108.330 109.530 112.95 113.230 NA [2,] 103.19 106.065 108.740 109.925 113.74 113.595 NA [3,] 104.80 106.560 109.185 110.760 114.15 113.740 NA [4,] 105.85 107.865 109.385 111.930 115.12 114.585 NA [5,] 108.07 108.550 110.070 113.110 115.35 115.310 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 103.5868 105.739 108.8908 109.8455 113.5206 113.2885 NA [2,] 106.0132 107.381 109.4792 111.6745 114.7794 114.1915 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(102.44, 103.19, 104.8, 105.85, 108.07, 104.88, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6x8021366617305.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,] 3.375635 6.930 4.83000 [2,] 3.732633 9.090 5.13500 [3,] 3.988103 9.855 5.65250 [4,] 4.151025 10.860 6.07875 [5,] 4.758810 12.370 6.50500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.797271 9.047691 5.222049 [2,] 4.178934 10.662309 6.082951 $out [1] 3.016683 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.37563475512384, 3.73263311801376, 3.98810273756239, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10u681366617305.ps tmp/10u681366617305.png",intern=TRUE)) character(0) > try(system("convert tmp/2e46f1366617305.ps tmp/2e46f1366617305.png",intern=TRUE)) character(0) > try(system("convert tmp/36z8q1366617305.ps tmp/36z8q1366617305.png",intern=TRUE)) character(0) > try(system("convert tmp/40hcp1366617305.ps tmp/40hcp1366617305.png",intern=TRUE)) character(0) > try(system("convert tmp/51ovs1366617305.ps tmp/51ovs1366617305.png",intern=TRUE)) character(0) > try(system("convert tmp/6x8021366617305.ps tmp/6x8021366617305.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.082 1.699 9.754