R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing 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(107.00,116.14,117.18,102.28,109.43,114.28,117.39,116.66,114.29,114.18,114.12,122.62,115.70,127.91,119.55,115.08,116.63,121.38,123.41,120.70,119.40,116.83,116.40,121.67,116.54,129.61,119.93,117.64,121.01,124.20,125.23,123.24,121.58,120.89,117.77,110.91,124.23,127.70,129.45,120.13,122.02,126.59,126.34,125.15,125.02,124.40,127.55,126.63,130.18,136.95,136.81,129.59,133.37,140.02,139.67,139.99,134.57,134.41,134.99,135.70) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 107.00 115.70 116.54 124.23 130.18 NA [2,] 116.14 127.91 129.61 127.70 136.95 NA [3,] 117.18 119.55 119.93 129.45 136.81 NA [4,] 102.28 115.08 117.64 120.13 129.59 NA [5,] 109.43 116.63 121.01 122.02 133.37 NA [6,] 114.28 121.38 124.20 126.59 140.02 NA [7,] 117.39 123.41 125.23 126.34 139.67 NA [8,] 116.66 120.70 123.24 125.15 139.99 NA [9,] 114.29 119.40 121.58 125.02 134.57 NA [10,] 114.18 116.83 120.89 124.40 134.41 NA [11,] 114.12 116.40 117.77 127.55 134.99 NA [12,] 122.62 121.67 110.91 126.63 135.70 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/1c0p61398332757.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/252681398332757.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/3pkcd1398332757.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/4b86l1398332757.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] [1,] 107.00 127.70 117.18 115.08 109.43 114.28 123.41 116.66 114.29 114.18 [2,] 115.70 127.70 119.55 115.08 116.63 121.38 123.41 120.70 119.40 116.83 [3,] 116.54 127.91 119.93 117.64 121.01 124.20 125.23 123.24 121.58 120.89 [4,] 124.23 129.61 129.45 120.13 122.02 126.59 126.34 125.15 125.02 124.40 [5,] 130.18 129.61 136.81 120.13 122.02 126.59 126.34 125.15 125.02 134.41 [,11] [,12] [1,] 114.12 121.67 [2,] 116.40 121.67 [3,] 117.77 122.62 [4,] 127.55 126.63 [5,] 134.99 126.63 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 110.5127 126.5604 112.9347 114.0717 117.2014 120.5186 123.1597 120.0956 [2,] 122.5673 129.2596 126.9253 121.2083 124.8186 127.8814 127.3003 126.3844 [,9] [,10] [,11] [,12] [1,] 117.6089 115.5411 109.8914 119.1153 [2,] 125.5511 126.2389 125.6486 126.1247 $out [1] 116.14 136.95 102.28 129.59 133.37 140.02 117.39 139.67 139.99 134.57 [11] 110.91 135.70 $group [1] 2 2 4 4 5 6 7 7 8 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(107, 115.7, 116.54, 124.23, 130.18, 127.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5tjx01398332757.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] [1,] 107.000 115.080 110.910 122.020 129.590 NA [2,] 111.775 116.515 117.705 124.315 133.890 NA [3,] 114.285 119.475 120.950 125.745 135.345 NA [4,] 116.920 121.525 123.720 127.090 138.310 NA [5,] 122.620 127.910 129.610 129.450 140.020 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 111.9383 117.1899 118.2065 124.4793 133.329 NA [2,] 116.6317 121.7601 123.6935 127.0107 137.361 NA $out [1] 102.28 120.13 $group [1] 1 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(107, 111.775, 114.285, 116.92, 122.62, 115.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60w0o1398332757.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,] 7.464601 19.630 1.910 [2,] 8.032704 20.545 4.705 [3,] 8.778317 22.730 5.300 [4,] 8.923372 24.365 8.050 [5,] 9.862349 27.310 11.150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.372077 20.98767 3.774323 [2,] 9.184556 24.47233 6.825677 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(7.4646011279907, 8.03270424967502, 8.77831680320166, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1c0p61398332757.ps tmp/1c0p61398332757.png",intern=TRUE)) character(0) > try(system("convert tmp/252681398332757.ps tmp/252681398332757.png",intern=TRUE)) character(0) > try(system("convert tmp/3pkcd1398332757.ps tmp/3pkcd1398332757.png",intern=TRUE)) character(0) > try(system("convert tmp/4b86l1398332757.ps tmp/4b86l1398332757.png",intern=TRUE)) character(0) > try(system("convert tmp/5tjx01398332757.ps tmp/5tjx01398332757.png",intern=TRUE)) character(0) > try(system("convert tmp/60w0o1398332757.ps tmp/60w0o1398332757.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.036 0.766 4.814