R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(1.38,1.96,1.36,1.24,1.35,1.23,1.09,1.08,1.33,1.35,1.38,1.5,1.47,2.09,1.52,1.29,1.52,1.27,1.35,1.29,1.41,1.39,1.45,1.53,1.45,2.11,1.53,1.38,1.54,1.35,1.29,1.33,1.47,1.47,1.54,1.59,1.5,2,1.51,1.4,1.62,1.44,1.29,1.28,1.4,1.39,1.46,1.49,1.45,2.05,1.59,1.42,1.73,1.39,1.23,1.37,1.51,1.47,1.5,1.54,1.54,2.15,1.62,1.4,1.65,1.49,1.45,1.45,1.51,1.48,1.56,1.57,1.57,2.28,1.7,1.56,1.8,1.56,1.51,1.46,1.51,1.55,1.57,1.64) > 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,] 1.38 1.47 1.45 1.50 1.45 1.54 1.57 NA [2,] 1.96 2.09 2.11 2.00 2.05 2.15 2.28 NA [3,] 1.36 1.52 1.53 1.51 1.59 1.62 1.70 NA [4,] 1.24 1.29 1.38 1.40 1.42 1.40 1.56 NA [5,] 1.35 1.52 1.54 1.62 1.73 1.65 1.80 NA [6,] 1.23 1.27 1.35 1.44 1.39 1.49 1.56 NA [7,] 1.09 1.35 1.29 1.29 1.23 1.45 1.51 NA [8,] 1.08 1.29 1.33 1.28 1.37 1.45 1.46 NA [9,] 1.33 1.41 1.47 1.40 1.51 1.51 1.51 NA [10,] 1.35 1.39 1.47 1.39 1.47 1.48 1.55 NA [11,] 1.38 1.45 1.54 1.46 1.50 1.56 1.57 NA [12,] 1.50 1.53 1.59 1.49 1.54 1.57 1.64 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/1usvt1386161522.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/2dwvt1386161522.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/3g9a31386161522.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/4stim1386161522.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] [,11] [,12] [1,] 1.38 1.960 1.510 1.240 1.35 1.230 1.09 1.280 1.330 1.350 1.380 1.490 [2,] 1.45 2.025 1.515 1.335 1.53 1.310 1.26 1.285 1.405 1.390 1.455 1.515 [3,] 1.47 2.090 1.530 1.400 1.62 1.390 1.29 1.330 1.470 1.470 1.500 1.540 [4,] 1.52 2.130 1.605 1.410 1.69 1.465 1.40 1.410 1.510 1.475 1.550 1.580 [5,] 1.57 2.280 1.700 1.420 1.80 1.560 1.51 1.460 1.510 1.550 1.570 1.640 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.428197 2.027296 1.476253 1.355211 1.524451 1.297437 1.206394 1.255352 [2,] 1.511803 2.152704 1.583747 1.444789 1.715549 1.482563 1.373606 1.404648 [,9] [,10] [,11] [,12] [1,] 1.407296 1.419239 1.443268 1.501183 [2,] 1.532704 1.520761 1.556732 1.578817 $out [1] 1.36 1.56 1.08 $group [1] 3 4 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.38, 1.45, 1.47, 1.52, 1.57, 1.96, 2.025, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55a261386161522.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,] 1.080 1.27 1.290 1.280 1.230 1.400 1.460 NA [2,] 1.235 1.32 1.365 1.395 1.405 1.465 1.530 NA [3,] 1.350 1.43 1.470 1.450 1.485 1.525 1.565 NA [4,] 1.380 1.52 1.540 1.505 1.565 1.595 1.670 NA [5,] 1.500 1.53 1.590 1.620 1.730 1.650 1.800 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.283865 1.338779 1.390181 1.399828 1.412023 1.465706 1.501145 NA [2,] 1.416135 1.521221 1.549819 1.500172 1.557977 1.584294 1.628855 NA $out [1] 1.96 2.09 2.11 2.00 2.05 2.15 2.28 $group [1] 1 2 3 4 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(1.08, 1.235, 1.35, 1.38, 1.5, 1.27, 1.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jvrc1386161522.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,] 0.05273474 0.15 0.0650 [2,] 0.06886833 0.19 0.0800 [3,] 0.10369068 0.32 0.1000 [4,] 0.12308008 0.36 0.1325 [5,] 0.14848441 0.45 0.1600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07896433 0.2424619 0.0760544 [2,] 0.12841702 0.3975381 0.1239456 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0527347359996462, 0.0688683264318059, 0.10369067658416, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1usvt1386161522.ps tmp/1usvt1386161522.png",intern=TRUE)) character(0) > try(system("convert tmp/2dwvt1386161522.ps tmp/2dwvt1386161522.png",intern=TRUE)) character(0) > try(system("convert tmp/3g9a31386161522.ps tmp/3g9a31386161522.png",intern=TRUE)) character(0) > try(system("convert tmp/4stim1386161522.ps tmp/4stim1386161522.png",intern=TRUE)) character(0) > try(system("convert tmp/55a261386161522.ps tmp/55a261386161522.png",intern=TRUE)) character(0) > try(system("convert tmp/6jvrc1386161522.ps tmp/6jvrc1386161522.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.199 1.114 6.454