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(99.23,101.14,100.8,98.93,100.97,101.69,102.14,102.52,103.4,105.83,104.35,106.61,105.63,106.73,106.19,107.26,106.27,107.45,107.63,107.45,107.74,108.15,108.99,108.83,110.78,110.66,108.51,108.29,109.33,107.06,108.02,109.43,109.85,110.5,109.9,110.92,108.36,109.01,108.03,106.28,106.6,108.06,107.42,107.58,107.59,109.66,107.85,110.74,108.8,109.18,108.38,108.59,109.52,108.71,109.78,109.77,109.34,111.86,110.74,110.67,111.36,112.21,110.2,110.99,110.43,110.72,111.19,111.52,111.99,111.65,114.45,115.58) > 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,] 99.23 105.63 110.78 108.36 108.80 111.36 NA [2,] 101.14 106.73 110.66 109.01 109.18 112.21 NA [3,] 100.80 106.19 108.51 108.03 108.38 110.20 NA [4,] 98.93 107.26 108.29 106.28 108.59 110.99 NA [5,] 100.97 106.27 109.33 106.60 109.52 110.43 NA [6,] 101.69 107.45 107.06 108.06 108.71 110.72 NA [7,] 102.14 107.63 108.02 107.42 109.78 111.19 NA [8,] 102.52 107.45 109.43 107.58 109.77 111.52 NA [9,] 103.40 107.74 109.85 107.59 109.34 111.99 NA [10,] 105.83 108.15 110.50 109.66 111.86 111.65 NA [11,] 104.35 108.99 109.90 107.85 110.74 114.45 NA [12,] 106.61 108.83 110.92 110.74 110.67 115.58 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/1yt5v1367003767.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/258id1367003767.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/32bsb1367003767.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/4g3s51367003767.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,] 99.23 101.140 106.190 106.280 106.270 107.060 107.420 107.450 107.59 [2,] 105.63 106.730 106.190 106.280 106.270 107.060 107.420 107.450 107.59 [3,] 108.58 109.095 108.205 107.775 107.965 107.755 107.825 108.505 108.54 [4,] 110.78 110.660 108.510 108.590 109.520 108.710 109.780 109.770 109.85 [5,] 111.36 112.210 110.200 110.990 110.430 110.720 111.190 111.520 111.99 [,10] [,11] [,12] [1,] 105.83 104.350 106.610 [2,] 108.15 107.850 108.830 [3,] 110.08 109.445 110.705 [4,] 111.65 110.740 110.920 [5,] 111.86 114.450 110.920 $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.2581 106.56 106.7085 106.285 105.8686 106.6907 106.3027 107.0085 [2,] 111.9019 111.63 109.7015 109.265 110.0614 108.8193 109.3473 110.0015 [,9] [,10] [,11] [,12] [1,] 107.0822 107.8224 107.5809 109.3569 [2,] 109.9978 112.3376 111.3091 112.0531 $out [1] 100.80 98.93 100.97 101.69 102.14 102.52 103.40 115.58 $group [1] 3 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(99.23, 105.63, 108.58, 110.78, 111.36, 101.14, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5akiu1367003767.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.930 105.630 107.06 106.280 108.380 110.200 NA [2,] 100.885 106.500 108.40 107.500 108.755 110.855 NA [3,] 101.915 107.450 109.64 107.940 109.430 111.440 NA [4,] 103.875 107.945 110.58 108.685 110.225 112.100 NA [5,] 106.610 108.990 110.92 109.660 111.860 112.210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.5512 106.7909 108.6457 107.3995 108.7595 110.8721 NA [2,] 103.2788 108.1091 110.6343 108.4805 110.1005 112.0079 NA $out [1] 110.74 114.45 115.58 $group [1] 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.93, 100.885, 101.915, 103.875, 106.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/616bz1367003767.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.299508 8.590 1.39000 [2,] 2.996210 8.985 1.84750 [3,] 3.202208 9.225 2.14875 [4,] 3.683684 10.585 2.91250 [5,] 4.469000 12.130 3.97250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.888646 8.495229 1.662996 [2,] 3.515770 9.954771 2.634504 $out [1] 6.03 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.29950791837442, 2.99620950203086, 3.20220826460492, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yt5v1367003767.ps tmp/1yt5v1367003767.png",intern=TRUE)) character(0) > try(system("convert tmp/258id1367003767.ps tmp/258id1367003767.png",intern=TRUE)) character(0) > try(system("convert tmp/32bsb1367003767.ps tmp/32bsb1367003767.png",intern=TRUE)) character(0) > try(system("convert tmp/4g3s51367003767.ps tmp/4g3s51367003767.png",intern=TRUE)) character(0) > try(system("convert tmp/5akiu1367003767.ps tmp/5akiu1367003767.png",intern=TRUE)) character(0) > try(system("convert tmp/616bz1367003767.ps tmp/616bz1367003767.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.893 0.529 3.410