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(73.97,73.97,73.97,73.97,73.97,73.97,73.96,74.44,75.43,75.77,75.82,75.85,75.85,75.85,77.95,82.07,84.82,85.08,85.34,85.65,85.65,85.72,85.73,85.73,85.73,85.73,85.74,86.32,87.59,87.81,87.87,87.94,87.96,88.01,88.01,88.01,88.01,88.01,88.59,89.43,89.63,89.73,89.88,89.89,89.9,89.91,89.86,90.07,90.17,90.17,90.28,90.87,92.05,92.1,92.16,92.22,92.25,92.29,92.29,92.29,92.29,92.29,91.95,91.82,92.16,92.31,92.33,92.4,92.54,92.49,92.54,92.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,] 73.97 75.85 85.73 88.01 90.17 92.29 NA [2,] 73.97 75.85 85.73 88.01 90.17 92.29 NA [3,] 73.97 77.95 85.74 88.59 90.28 91.95 NA [4,] 73.97 82.07 86.32 89.43 90.87 91.82 NA [5,] 73.97 84.82 87.59 89.63 92.05 92.16 NA [6,] 73.97 85.08 87.81 89.73 92.10 92.31 NA [7,] 73.96 85.34 87.87 89.88 92.16 92.33 NA [8,] 74.44 85.65 87.94 89.89 92.22 92.40 NA [9,] 75.43 85.65 87.96 89.90 92.25 92.54 NA [10,] 75.77 85.72 88.01 89.91 92.29 92.49 NA [11,] 75.82 85.73 88.01 89.86 92.29 92.54 NA [12,] 75.85 85.73 88.01 90.07 92.29 92.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/1zr331355149239.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/2skv91355149239.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/3gzoz1355149239.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/4r9yy1355149239.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] [,11] [1,] 73.97 73.97 73.970 73.970 84.82 85.08 85.340 85.650 85.65 85.72 85.730 [2,] 75.85 75.85 77.950 82.070 84.82 85.08 85.340 85.650 85.65 85.72 85.730 [3,] 86.87 86.87 87.165 87.875 88.61 88.77 88.875 88.915 88.93 88.96 88.935 [4,] 90.17 90.17 90.280 90.870 92.05 92.10 92.160 92.220 92.25 92.29 92.290 [5,] 92.29 92.29 91.950 91.820 92.16 92.31 92.330 92.400 92.54 92.49 92.540 [,12] [1,] 85.73 [2,] 85.73 [3,] 89.04 [4,] 92.29 [5,] 92.58 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 77.63314 77.63314 79.21175 82.19872 83.94642 84.24187 84.47588 84.67714 [2,] 96.10686 96.10686 95.11825 93.55128 93.27358 93.29813 93.27412 93.15286 [,9] [,10] [,11] [,12] [1,] 84.67279 84.72214 84.70359 84.80859 [2,] 93.18721 93.19786 93.16641 93.27141 $out [1] 73.97 73.97 73.96 74.44 75.43 75.77 75.82 75.85 $group [1] 5 6 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(73.97, 75.85, 86.87, 90.17, 92.29, 73.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5bu671355149239.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,] 73.96 75.850 85.730 88.010 90.170 91.820 NA [2,] 73.97 80.010 86.030 89.010 90.575 92.225 NA [3,] 73.97 85.210 87.840 89.795 92.130 92.320 NA [4,] 75.60 85.685 87.985 89.895 92.270 92.515 NA [5,] 75.85 85.730 88.010 90.070 92.290 92.580 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 73.22655 82.62159 86.94831 89.39135 91.3569 92.18773 NA [2,] 74.71345 87.79841 88.73169 90.19865 92.9031 92.45227 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(73.96, 73.97, 73.97, 75.6, 75.85, 75.85, 80.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6kleh1355149239.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,] 6.223133 16.72 5.38250 [2,] 6.303144 16.92 5.42500 [3,] 6.801664 17.97 5.68125 [4,] 7.050951 18.32 8.66875 [5,] 7.644728 18.37 11.31000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.460584 17.33145 4.201754 [2,] 7.142744 18.60855 7.160746 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.22313345510122, 6.30314381687869, 6.80166384310261, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zr331355149239.ps tmp/1zr331355149239.png",intern=TRUE)) character(0) > try(system("convert tmp/2skv91355149239.ps tmp/2skv91355149239.png",intern=TRUE)) character(0) > try(system("convert tmp/3gzoz1355149239.ps tmp/3gzoz1355149239.png",intern=TRUE)) character(0) > try(system("convert tmp/4r9yy1355149239.ps tmp/4r9yy1355149239.png",intern=TRUE)) character(0) > try(system("convert tmp/5bu671355149239.ps tmp/5bu671355149239.png",intern=TRUE)) character(0) > try(system("convert tmp/6kleh1355149239.ps tmp/6kleh1355149239.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.198 0.843 4.038