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(19064,18993,18921,18772,20246,20168,19064,18330,18401,18401,18480,18622,18843,18843,18701,18330,20246,20538,20097,19064,19506,18843,19142,19285,19434,19064,19142,18622,20246,20759,20318,19506,20389,19434,20318,20246,20467,19655,20538,20467,21792,21493,20318,19726,20538,19434,20246,20389,20688,20026,20389,20610,21422,20759,19876,18921,19805,17375,18551,19213,19876,18921,18921,18921,19434,18701,17739,16934,17518,15238,16635,17447,17596,16784,16855,16635,17375,16855,15830,15089,16342,13621,15388,16193,16193,15238,14355,14284,15089,14355,12959,11997,13030,10601,12809,13984,14355,13543,12517,13251,13543,13322,11113,10088,10821,8613,10893,11705,12367,11263,10230,10821,11113,10529,8321,7359,8242,5813,8463,10088) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 19064 18843 19434 20467 20688 19876 17596 16193 14355 12367 NA [2,] 18993 18843 19064 19655 20026 18921 16784 15238 13543 11263 NA [3,] 18921 18701 19142 20538 20389 18921 16855 14355 12517 10230 NA [4,] 18772 18330 18622 20467 20610 18921 16635 14284 13251 10821 NA [5,] 20246 20246 20246 21792 21422 19434 17375 15089 13543 11113 NA [6,] 20168 20538 20759 21493 20759 18701 16855 14355 13322 10529 NA [7,] 19064 20097 20318 20318 19876 17739 15830 12959 11113 8321 NA [8,] 18330 19064 19506 19726 18921 16934 15089 11997 10088 7359 NA [9,] 18401 19506 20389 20538 19805 17518 16342 13030 10821 8242 NA [10,] 18401 18843 19434 19434 17375 15238 13621 10601 8613 5813 NA [11,] 18480 19142 20318 20246 18551 16635 15388 12809 10893 8463 NA [12,] 18622 19285 20246 20389 19213 17447 16193 13984 11705 10088 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/1acvr1407172749.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/225wl1407172749.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/3l1q01407172749.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/45udr1407172749.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,] 12367.0 11263 10230 10821 11113 10529.0 8321.0 7359 8242.0 5813.0 [2,] 16193.0 15238 14355 14284 15089 14355.0 12959.0 11997 13030.0 10601.0 [3,] 18953.5 18882 18811 18476 19840 19434.5 18401.5 17632 17959.5 16306.5 [4,] 19876.0 19064 19142 18921 20246 20759.0 20097.0 19064 19805.0 18843.0 [5,] 20688.0 20026 20538 20610 21792 21493.0 20318.0 19726 20538.0 19434.0 [,11] [,12] [1,] 8463.0 10088.0 [2,] 12809.0 13984.0 [3,] 17557.5 18034.5 [4,] 19142.0 19285.0 [5,] 20318.0 20389.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 17113.33 16970.38 16419.22 16159.17 17263.36 16234.81 14835.07 14101.05 [2,] 20793.67 20793.62 21202.78 20792.83 22416.64 22634.19 21967.93 21162.95 [,9] [,10] [,11] [,12] [1,] 14574.44 12188.47 14393.28 15385.91 [2,] 21344.56 20424.53 20721.72 20683.09 $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(12367, 16193, 18953.5, 19876, 20688, 11263, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ddkw1407172749.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] [,10] [1,] 18330.0 18330.0 18622 19434 17375 15238.0 15089.0 10601 8613.0 5813.0 [2,] 18440.5 18843.0 19288 19986 19067 17190.5 15609.0 12884 10857.0 8281.5 [3,] 18846.5 19103.0 19876 20428 19951 18220.0 16488.5 14134 12111.0 10159.0 [4,] 19064.0 19801.5 20318 20538 20649 18921.0 16855.0 14722 13432.5 10967.0 [5,] 19064.0 20538.0 20759 20538 21422 19876.0 17596.0 16193 14355.0 12367.0 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 18562.12 18665.82 19406.21 20176.23 19229.44 17430.71 15920.19 13295.68 [2,] 19130.88 19540.18 20345.79 20679.77 20672.56 19009.29 17056.81 14972.32 [,9] [,10] [,11] [1,] 10936.3 8934.125 NA [2,] 13285.7 11383.875 NA $out [1] 20246 20168 21792 21493 13621 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(18330, 18440.5, 18846.5, 19064, 19064, 18330, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gq521407172749.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,] 2769.884 8321.0 3221.750 [2,] 3394.890 10045.0 4059.375 [3,] 3729.242 10821.5 5135.625 [4,] 4339.696 12146.5 6065.250 [5,] 4911.561 13621.0 7376.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3298.309 9862.992 4220.732 [2,] 4160.174 11780.008 6050.518 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2769.88407499103, 3394.88989779969, 3729.24166341692, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1acvr1407172749.ps tmp/1acvr1407172749.png",intern=TRUE)) character(0) > try(system("convert tmp/225wl1407172749.ps tmp/225wl1407172749.png",intern=TRUE)) character(0) > try(system("convert tmp/3l1q01407172749.ps tmp/3l1q01407172749.png",intern=TRUE)) character(0) > try(system("convert tmp/45udr1407172749.ps tmp/45udr1407172749.png",intern=TRUE)) character(0) > try(system("convert tmp/5ddkw1407172749.ps tmp/5ddkw1407172749.png",intern=TRUE)) character(0) > try(system("convert tmp/6gq521407172749.ps tmp/6gq521407172749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.122 0.358 2.504