R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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 = '48' > par1 <- '48' > #'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] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 98.01 114.35 [2,] 99.20 112.77 [3,] 100.70 115.31 [4,] 106.41 114.93 [5,] 107.51 116.38 [6,] 107.10 115.07 [7,] 99.75 105.00 [8,] 98.96 103.43 [9,] 107.26 114.52 [10,] 107.11 115.04 [11,] 107.20 117.16 [12,] 107.65 115.00 [13,] 104.78 116.22 [14,] 105.56 112.92 [15,] 107.95 116.56 [16,] 107.11 114.32 [17,] 107.47 113.22 [18,] 107.06 111.56 [19,] 99.71 103.87 [20,] 99.60 102.85 [21,] 107.19 112.27 [22,] 107.26 112.76 [23,] 113.24 118.55 [24,] 113.52 122.73 [25,] 110.48 NA [26,] 111.41 NA [27,] 115.50 NA [28,] 118.32 NA [29,] 118.42 NA [30,] 117.50 NA [31,] 110.23 NA [32,] 109.19 NA [33,] 118.41 NA [34,] 118.30 NA [35,] 116.10 NA [36,] 114.11 NA [37,] 113.41 NA [38,] 114.33 NA [39,] 116.61 NA [40,] 123.64 NA [41,] 123.77 NA [42,] 123.39 NA [43,] 116.03 NA [44,] 114.95 NA [45,] 123.40 NA [46,] 123.53 NA [47,] 114.45 NA [48,] 114.26 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/1m2pu1354215657.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/28t8e1354215657.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/328uh1354215657.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/4wvg21354215657.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.01 99.200 100.700 106.41 107.510 107.100 99.750 98.960 107.26 [2,] 98.01 99.200 100.700 106.41 107.510 107.100 99.750 98.960 107.26 [3,] 106.18 105.985 108.005 110.67 111.945 111.085 102.375 101.195 110.89 [4,] 114.35 112.770 115.310 114.93 116.380 115.070 105.000 103.430 114.52 [5,] 114.35 112.770 115.310 114.93 116.380 115.070 105.000 103.430 114.52 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 107.110 107.20 107.650 104.78 105.56 107.950 107.110 107.470 107.06 99.71 [2,] 107.110 107.20 107.650 104.78 105.56 107.950 107.110 107.470 107.06 99.71 [3,] 111.075 112.18 111.325 110.50 109.24 112.255 110.715 110.345 109.31 101.79 [4,] 115.040 117.16 115.000 116.22 112.92 116.560 114.320 113.220 111.56 103.87 [5,] 115.040 117.16 115.000 116.22 112.92 116.560 114.320 113.220 111.56 103.87 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 99.600 107.19 107.26 113.240 113.520 110.48 111.41 115.5 118.32 118.42 [2,] 99.600 107.19 107.26 113.240 113.520 110.48 111.41 115.5 118.32 118.42 [3,] 101.225 109.73 110.01 115.895 118.125 110.48 111.41 115.5 118.32 118.42 [4,] 102.850 112.27 112.76 118.550 122.730 110.48 111.41 115.5 118.32 118.42 [5,] 102.850 112.27 112.76 118.550 122.730 110.48 111.41 115.5 118.32 118.42 [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [1,] 117.5 110.23 109.19 118.41 118.3 116.1 114.11 113.41 114.33 116.61 123.64 [2,] 117.5 110.23 109.19 118.41 118.3 116.1 114.11 113.41 114.33 116.61 123.64 [3,] 117.5 110.23 109.19 118.41 118.3 116.1 114.11 113.41 114.33 116.61 123.64 [4,] 117.5 110.23 109.19 118.41 118.3 116.1 114.11 113.41 114.33 116.61 123.64 [5,] 117.5 110.23 109.19 118.41 118.3 116.1 114.11 113.41 114.33 116.61 123.64 [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 123.77 123.39 116.03 114.95 123.4 123.53 114.45 114.26 [2,] 123.77 123.39 116.03 114.95 123.4 123.53 114.45 114.26 [3,] 123.77 123.39 116.03 114.95 123.4 123.53 114.45 114.26 [4,] 123.77 123.39 116.03 114.95 123.4 123.53 114.45 114.26 [5,] 123.77 123.39 116.03 114.95 123.4 123.53 114.45 114.26 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 87.92448 90.82421 91.68229 101.1512 102.0352 102.1807 96.50955 [2,] 124.43552 121.14579 124.32771 120.1888 121.8548 119.9893 108.24045 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 96.20099 102.7789 102.2154 101.0524 103.1134 97.7189 101.0172 102.6357 [2,] 106.18901 119.0011 119.9346 123.3076 119.5366 123.2811 117.4628 121.8743 [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 102.6598 103.9209 104.2825 97.14233 97.59401 104.0545 103.8652 109.9625 [2,] 118.7702 116.7691 114.3375 106.43767 104.85599 115.4055 116.1548 121.8275 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] 107.8353 110.48 111.41 115.5 118.32 118.42 117.5 110.23 109.19 118.41 [2,] 128.4147 110.48 111.41 115.5 118.32 118.42 117.5 110.23 109.19 118.41 [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [1,] 118.3 116.1 114.11 113.41 114.33 116.61 123.64 123.77 123.39 116.03 114.95 [2,] 118.3 116.1 114.11 113.41 114.33 116.61 123.64 123.77 123.39 116.03 114.95 [,45] [,46] [,47] [,48] [1,] 123.4 123.53 114.45 114.26 [2,] 123.4 123.53 114.45 114.26 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" Warning message: In bxp(list(stats = c(98.01, 98.01, 106.18, 114.35, 114.35, 99.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51fel1354215657.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] [1,] 98.010 111.560 [2,] 107.105 112.515 [3,] 110.355 114.435 [4,] 116.065 115.765 [5,] 123.770 118.550 $n [1] 48 24 $conf [,1] [,2] [1,] 108.3116 113.3868 [2,] 112.3984 115.4832 $out [1] 105.00 103.43 103.87 102.85 122.73 $group [1] 2 2 2 2 2 $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/667hf1354215657.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.298097 0.000 0.0000 [2,] 3.733524 0.000 0.0000 [3,] 5.200770 1.625 0.8125 [4,] 6.392245 7.355 3.6775 [5,] 10.330830 16.340 8.1700 $n [1] 24 48 48 $conf [,1] [,2] [,3] [1,] 4.343290 -0.05233244 -0.02616622 [2,] 6.058251 3.30233244 1.65116622 $out [1] 11.55412 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.29809703885628, 3.73352380466497, 5.20077037562706, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1m2pu1354215657.ps tmp/1m2pu1354215657.png",intern=TRUE)) character(0) > try(system("convert tmp/28t8e1354215657.ps tmp/28t8e1354215657.png",intern=TRUE)) character(0) > try(system("convert tmp/328uh1354215657.ps tmp/328uh1354215657.png",intern=TRUE)) character(0) > try(system("convert tmp/4wvg21354215657.ps tmp/4wvg21354215657.png",intern=TRUE)) character(0) > try(system("convert tmp/51fel1354215657.ps tmp/51fel1354215657.png",intern=TRUE)) character(0) > try(system("convert tmp/667hf1354215657.ps tmp/667hf1354215657.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.029 0.621 3.630