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(109.03,110.43,111.01,111.01,110.76,111.13,111.07,111.09,110.96,110.64,110.62,110.59,111.33,113.94,114.61,114.64,114.62,114.71,114.72,114.66,114.76,114.68,114.75,114.74,116.36,117.53,118.82,119.83,119.97,121.29,120.94,121.02,120.98,121.02,120.89,120.76,123.28,123.98,125.91,125.84,125.98,127.24,127.23,127.82,127.59,127.74,127.44,127.35,128.54,129.3,130.67,130.76,131.34,130.69,130.96,130.68,130.61,130.59,130.44,129.04,131.46,132.77,134.48,134.52,136.11,136.12,136.03,135.84,137.75,137.45,136.84,136.79,140.12,140.68,140.35,140.42,140.19,140.14,140.13,139.45,139.59,139.44,139.53,139.28) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 109.03 111.33 116.36 123.28 128.54 131.46 140.12 NA [2,] 110.43 113.94 117.53 123.98 129.30 132.77 140.68 NA [3,] 111.01 114.61 118.82 125.91 130.67 134.48 140.35 NA [4,] 111.01 114.64 119.83 125.84 130.76 134.52 140.42 NA [5,] 110.76 114.62 119.97 125.98 131.34 136.11 140.19 NA [6,] 111.13 114.71 121.29 127.24 130.69 136.12 140.14 NA [7,] 111.07 114.72 120.94 127.23 130.96 136.03 140.13 NA [8,] 111.09 114.66 121.02 127.82 130.68 135.84 139.45 NA [9,] 110.96 114.76 120.98 127.59 130.61 137.75 139.59 NA [10,] 110.64 114.68 121.02 127.74 130.59 137.45 139.44 NA [11,] 110.62 114.75 120.89 127.44 130.44 136.84 139.53 NA [12,] 110.59 114.74 120.76 127.35 129.04 136.79 139.28 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/1jsdt1416752534.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/244vz1416752534.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/3gnl11416752534.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/4xezb1416752534.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,] 109.030 110.430 111.010 111.010 110.760 111.130 111.070 111.09 110.96 [2,] 113.845 115.735 116.715 117.235 117.295 118.000 117.830 117.84 117.87 [3,] 123.280 123.980 125.910 125.840 125.980 127.240 127.230 127.82 127.59 [4,] 130.000 131.035 132.575 132.640 133.725 133.405 133.495 133.26 134.18 [5,] 140.120 140.680 140.350 140.420 140.190 140.140 140.130 139.45 139.59 [,10] [,11] [,12] [1,] 110.64 110.62 110.590 [2,] 117.85 117.82 117.750 [3,] 127.74 127.44 127.350 [4,] 134.02 133.64 132.915 [5,] 139.44 139.53 139.280 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 113.6325 114.8431 116.4387 116.6404 116.1683 118.0404 117.8751 118.6114 [2,] 132.9275 133.1169 135.3813 135.0396 135.7917 136.4396 136.5849 137.0286 [,9] [,10] [,11] [,12] [1,] 117.8499 118.0835 117.9926 118.2937 [2,] 137.3301 137.3965 136.8874 136.4063 $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(109.03, 113.845, 123.28, 130, 140.12, 110.43, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ih2f1416752534.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] [1,] 110.430 114.610 117.530 123.980 129.040 131.460 139.280 NA [2,] 110.605 114.615 119.325 125.875 129.870 134.500 139.490 NA [3,] 110.860 114.670 120.825 127.235 130.640 136.070 140.125 NA [4,] 111.040 114.730 121.000 127.515 130.725 136.815 140.270 NA [5,] 111.130 114.760 121.290 127.820 131.340 137.750 140.680 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.6616 114.6175 120.061 126.487 130.25 135.0141 139.7692 NA [2,] 111.0584 114.7225 121.589 127.983 131.03 137.1259 140.4808 NA $out [1] 109.03 111.33 113.94 116.36 123.28 128.54 $group [1] 1 2 2 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(110.43, 110.605, 110.86, 111.04, 111.13, 114.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dblq1416752534.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,] 10.63290 28.360 15.1650 [2,] 10.76431 28.745 15.4050 [3,] 10.84883 29.035 15.7425 [4,] 10.98840 29.420 16.1625 [5,] 11.02191 30.250 16.4300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10.74662 28.72713 15.397 [2,] 10.95103 29.34287 16.088 $out [1] 11.33405 31.09000 $group [1] 1 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(10.6328952738547, 10.7643119784814, 10.8488258008387, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jsdt1416752534.ps tmp/1jsdt1416752534.png",intern=TRUE)) character(0) > try(system("convert tmp/244vz1416752534.ps tmp/244vz1416752534.png",intern=TRUE)) character(0) > try(system("convert tmp/3gnl11416752534.ps tmp/3gnl11416752534.png",intern=TRUE)) character(0) > try(system("convert tmp/4xezb1416752534.ps tmp/4xezb1416752534.png",intern=TRUE)) character(0) > try(system("convert tmp/5ih2f1416752534.ps tmp/5ih2f1416752534.png",intern=TRUE)) character(0) > try(system("convert tmp/6dblq1416752534.ps tmp/6dblq1416752534.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.092 0.382 2.501