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(102.42,102.46,102.76,102.4,102.47,102.27,102.17,101.84,102.13,103.34,103.43,103.59,104.21,105.42,105.95,106.28,106.49,106.49,106.49,107.38,108.69,108.76,108.84,108.67,108.79,109.96,110.86,111,111.84,112.21,112.4,113.76,114.85,115.23,115.39,115.29,115.53,116.26,116.85,117.37,118.03,118.49,119.32,119.4,122.26,122.91,123.78,123.99,124.7,125.89,127.57,128.97,130.65,130.73,130.95,131.36,132.85,133.08,133.13,133.27,133.9,134.85,135.49,136.21,136.31,136.22,136.22,135.51,137.3,138.42,138.92,138.67) > 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,] 102.42 104.21 108.79 115.53 124.70 133.90 NA [2,] 102.46 105.42 109.96 116.26 125.89 134.85 NA [3,] 102.76 105.95 110.86 116.85 127.57 135.49 NA [4,] 102.40 106.28 111.00 117.37 128.97 136.21 NA [5,] 102.47 106.49 111.84 118.03 130.65 136.31 NA [6,] 102.27 106.49 112.21 118.49 130.73 136.22 NA [7,] 102.17 106.49 112.40 119.32 130.95 136.22 NA [8,] 101.84 107.38 113.76 119.40 131.36 135.51 NA [9,] 102.13 108.69 114.85 122.26 132.85 137.30 NA [10,] 103.34 108.76 115.23 122.91 133.08 138.42 NA [11,] 103.43 108.84 115.39 123.78 133.13 138.92 NA [12,] 103.59 108.67 115.29 123.99 133.27 138.67 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/1vubg1367152832.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/2tw7u1367152832.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/3z9st1367152832.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/4mubi1367152832.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,] 102.42 102.46 102.760 102.400 102.470 102.27 102.17 101.84 102.130 103.34 [2,] 104.21 105.42 105.950 106.280 106.490 106.49 106.49 107.38 108.690 108.76 [3,] 112.16 113.11 113.855 114.185 114.935 115.35 115.86 116.58 118.555 119.07 [4,] 124.70 125.89 127.570 128.970 130.650 130.73 130.95 131.36 132.850 133.08 [5,] 133.90 134.85 135.490 136.210 136.310 136.22 136.22 135.51 137.300 138.42 [,11] [,12] [1,] 103.430 103.59 [2,] 108.840 108.67 [3,] 119.585 119.64 [4,] 133.130 133.27 [5,] 138.920 138.67 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.94329 99.90619 99.9094 99.54922 99.35102 99.71442 100.0825 [2,] 125.37671 126.31381 127.8006 128.82078 130.51898 130.98558 131.6375 [,8] [,9] [,10] [,11] [,12] [1,] 101.1121 102.971 103.3828 103.9172 103.7722 [2,] 132.0479 134.139 134.7572 135.2528 135.5078 $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(102.42, 104.21, 112.16, 124.7, 133.9, 102.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/55ysz1367152832.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,] 101.84 104.210 108.790 115.530 124.700 133.90 NA [2,] 102.22 106.115 110.930 117.110 128.270 135.50 NA [3,] 102.44 106.490 112.305 118.905 130.840 136.22 NA [4,] 103.05 108.680 115.040 122.585 132.965 137.86 NA [5,] 103.59 108.840 115.390 123.990 133.270 138.92 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.0614 105.3201 110.4304 116.4078 128.6986 135.1436 NA [2,] 102.8186 107.6599 114.1796 121.4022 132.9814 137.2964 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.84, 102.22, 102.44, 103.05, 103.59, 104.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ckpw1367152832.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,] 12.36763 31.480 16.92750 [2,] 13.00424 33.200 18.16125 [3,] 13.46606 33.895 19.70875 [4,] 13.73926 35.080 20.11750 [5,] 13.87793 35.490 20.62500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13.13082 33.03752 18.81649 [2,] 13.80131 34.75248 20.60101 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(12.3676331607952, 13.0042440692691, 13.466064878522, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vubg1367152832.ps tmp/1vubg1367152832.png",intern=TRUE)) character(0) > try(system("convert tmp/2tw7u1367152832.ps tmp/2tw7u1367152832.png",intern=TRUE)) character(0) > try(system("convert tmp/3z9st1367152832.ps tmp/3z9st1367152832.png",intern=TRUE)) character(0) > try(system("convert tmp/4mubi1367152832.ps tmp/4mubi1367152832.png",intern=TRUE)) character(0) > try(system("convert tmp/55ysz1367152832.ps tmp/55ysz1367152832.png",intern=TRUE)) character(0) > try(system("convert tmp/6ckpw1367152832.ps tmp/6ckpw1367152832.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.906 0.510 3.404