R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(100.64,100.93,101.41,102.07,102.42,102.53,102.43,102.6,102.65,102.74,102.82,103.2,102.75,103.09,103.71,104.3,104.58,104.71,104.44,104.57,104.95,105.49,106.03,106.48,106.25,106.7,107.6,108.05,108.72,109.17,109.08,109.04,109.34,109.37,108.96,108.77,108.11,108.67,109.05,109.43,109.62,109.85,109.34,109.65,109.69,109.91,110.09,110.44,109.9,110.25,111.26,111.74,111.91,111.95,111.63,111.85,112.16,112.49,112.66,113.39,112.92,113.44,114.68,115.38,115.48,115.41,114.92,115.16,115.89,116.25,116.43,116.83,116.17,116.78,117.98,118.53,118.43,118.29,117.85,118.27,119,119.33,119.17,119.57,118.62,119.09,120.19,120.17,120.29,120.35,119.88,120.04,120.52,120.43,120.34,120.75) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 100.64 102.75 106.25 108.11 109.90 112.92 116.17 118.62 NA [2,] 100.93 103.09 106.70 108.67 110.25 113.44 116.78 119.09 NA [3,] 101.41 103.71 107.60 109.05 111.26 114.68 117.98 120.19 NA [4,] 102.07 104.30 108.05 109.43 111.74 115.38 118.53 120.17 NA [5,] 102.42 104.58 108.72 109.62 111.91 115.48 118.43 120.29 NA [6,] 102.53 104.71 109.17 109.85 111.95 115.41 118.29 120.35 NA [7,] 102.43 104.44 109.08 109.34 111.63 114.92 117.85 119.88 NA [8,] 102.60 104.57 109.04 109.65 111.85 115.16 118.27 120.04 NA [9,] 102.65 104.95 109.34 109.69 112.16 115.89 119.00 120.52 NA [10,] 102.74 105.49 109.37 109.91 112.49 116.25 119.33 120.43 NA [11,] 102.82 106.03 108.96 110.09 112.66 116.43 119.17 120.34 NA [12,] 103.20 106.48 108.77 110.44 113.39 116.83 119.57 120.75 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/1qypa1426192510.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/2znkc1426192510.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/3ssn61426192510.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/4m3mp1426192510.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,] 100.640 100.930 101.410 102.070 102.420 102.53 102.430 102.600 102.650 [2,] 104.500 104.895 105.655 106.175 106.650 106.94 106.760 106.805 107.145 [3,] 109.005 109.460 110.155 110.585 110.765 110.90 110.485 110.750 110.925 [4,] 114.545 115.110 116.330 116.955 116.955 116.85 116.385 116.715 117.445 [5,] 118.620 119.090 120.190 120.170 120.290 120.35 119.880 120.040 120.520 [,10] [,11] [,12] [1,] 102.74 102.820 103.200 [2,] 107.43 107.495 107.625 [3,] 111.20 111.375 111.915 [4,] 117.79 117.800 118.200 [5,] 120.43 120.340 120.750 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.3937 103.7538 104.1918 104.5631 105.0085 105.3641 105.1083 105.2141 [2,] 114.6163 115.1662 116.1182 116.6069 116.5215 116.4359 115.8617 116.2859 [,9] [,10] [,11] [,12] [1,] 105.1713 105.4128 105.6185 106.0077 [2,] 116.6787 116.9872 117.1315 117.8223 $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(100.64, 104.5, 109.005, 114.545, 118.62, 100.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ns1e1426192510.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] [,8] [,9] [1,] 100.640 102.750 106.250 108.670 110.250 112.920 116.170 119.88 NA [2,] 101.740 104.005 107.825 109.195 111.445 114.800 117.915 119.96 NA [3,] 102.480 104.575 108.865 109.635 111.880 115.395 118.360 120.24 NA [4,] 102.695 105.220 109.125 109.880 112.325 116.070 119.085 120.39 NA [5,] 103.200 106.480 109.370 110.440 113.390 116.830 119.570 120.75 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.0444 104.0208 108.2721 109.3226 111.4786 114.8157 117.8264 120.0439 [2,] 102.9156 105.1292 109.4579 109.9474 112.2814 115.9743 118.8936 120.4361 [,9] [1,] NA [2,] NA $out [1] 108.11 109.90 118.62 119.09 $group [1] 4 5 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(100.64, 101.74, 102.48, 102.695, 103.2, 102.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66rqd1426192510.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.142970 17.440 7.73250 [2,] 6.258831 17.535 8.21625 [3,] 6.329841 17.845 8.50500 [4,] 6.374631 18.040 8.88250 [5,] 6.502477 18.780 9.31750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.277024 17.61467 8.201119 [2,] 6.382658 18.07533 8.808881 $out [1] 6.61923 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(6.14297028550289, 6.25883140149055, 6.32984075814568, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qypa1426192510.ps tmp/1qypa1426192510.png",intern=TRUE)) character(0) > try(system("convert tmp/2znkc1426192510.ps tmp/2znkc1426192510.png",intern=TRUE)) character(0) > try(system("convert tmp/3ssn61426192510.ps tmp/3ssn61426192510.png",intern=TRUE)) character(0) > try(system("convert tmp/4m3mp1426192510.ps tmp/4m3mp1426192510.png",intern=TRUE)) character(0) > try(system("convert tmp/5ns1e1426192510.ps tmp/5ns1e1426192510.png",intern=TRUE)) character(0) > try(system("convert tmp/66rqd1426192510.ps tmp/66rqd1426192510.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.165 0.352 2.546