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(103.43,103.49,103.5,103.5,103.5,103.5,103.54,103.71,103.76,103.76,103.76,103.82,105.11,105.58,105.91,105.92,105.92,105.92,105.96,105.98,105.98,105.98,106.01,106.01,106.91,107.11,107.18,107.2,107.35,107.35,107.35,107.52,107.56,107.55,107.6,107.6,110.04,110.27,110.33,110.33,110.33,110.33,110.33,110.35,110.38,110.54,110.54,110.54,110.54,106.74,106.78,106.75,106.75,106.75,106.82,107.08,107.25,107.28,107.28,107.28,108.44,109.33,109.44,109.44,109.45,109.45,109.45,109.45,109.46,109.46,109.46,109.46,110.95,110.95,110.95,110.95,110.95,110.95,110.95,110.95,110.97,110.97,110.97,111) > 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,] 103.43 105.11 106.91 110.04 110.54 108.44 110.95 NA [2,] 103.49 105.58 107.11 110.27 106.74 109.33 110.95 NA [3,] 103.50 105.91 107.18 110.33 106.78 109.44 110.95 NA [4,] 103.50 105.92 107.20 110.33 106.75 109.44 110.95 NA [5,] 103.50 105.92 107.35 110.33 106.75 109.45 110.95 NA [6,] 103.50 105.92 107.35 110.33 106.75 109.45 110.95 NA [7,] 103.54 105.96 107.35 110.33 106.82 109.45 110.95 NA [8,] 103.71 105.98 107.52 110.35 107.08 109.45 110.95 NA [9,] 103.76 105.98 107.56 110.38 107.25 109.46 110.97 NA [10,] 103.76 105.98 107.55 110.54 107.28 109.46 110.97 NA [11,] 103.76 106.01 107.60 110.54 107.28 109.46 110.97 NA [12,] 103.82 106.01 107.60 110.54 107.28 109.46 111.00 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/1jfod1389526340.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/2i7641389526340.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/3incd1389526340.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/4edsp1389526340.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,] 103.43 103.49 103.500 103.500 103.500 103.500 103.54 103.71 103.760 103.76 [2,] 106.01 106.16 106.345 106.335 106.335 106.335 106.39 106.53 106.615 106.63 [3,] 108.44 107.11 107.180 107.200 107.350 107.350 107.35 107.52 107.560 107.55 [4,] 110.29 109.80 109.885 109.885 109.890 109.890 109.89 109.90 109.920 110.00 [5,] 110.95 110.95 110.950 110.950 110.950 110.950 110.95 110.95 110.970 110.97 [,11] [,12] [1,] 103.760 103.820 [2,] 106.645 106.645 [3,] 107.600 107.600 [4,] 110.000 110.000 [5,] 110.970 111.000 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.8841 104.9363 105.066 105.08 105.227 105.227 105.2599 105.5075 [2,] 110.9959 109.2837 109.294 109.32 109.473 109.473 109.4401 109.5325 [,9] [,10] [,11] [,12] [1,] 105.5863 105.5375 105.5964 105.5964 [2,] 109.5337 109.5625 109.6036 109.6036 $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(103.43, 106.01, 108.44, 110.29, 110.95, 103.49, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/515j41389526340.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,] 103.43 105.910 106.910 110.27 106.74 109.44 110.95 NA [2,] 103.50 105.915 107.190 110.33 106.75 109.44 110.95 NA [3,] 103.52 105.940 107.350 110.33 106.95 109.45 110.95 NA [4,] 103.76 105.980 107.555 110.46 107.28 109.46 110.97 NA [5,] 103.82 106.010 107.600 110.54 107.28 109.46 111.00 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.4014 105.9104 107.1835 110.2707 106.7083 109.4409 110.9409 NA [2,] 103.6386 105.9696 107.5165 110.3893 107.1917 109.4591 110.9591 NA $out [1] 105.11 105.58 110.04 110.54 108.44 109.33 $group [1] 2 2 4 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(103.43, 103.5, 103.52, 103.76, 103.82, 105.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fvlq1389526340.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,] 2.561656 7.18 3.3050 [2,] 2.578057 7.21 3.3625 [3,] 2.647215 7.43 3.5200 [4,] 2.660286 7.45 3.5550 [5,] 2.685954 7.52 3.6400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.609709 7.320534 3.432199 [2,] 2.684720 7.539466 3.607801 $out [1] 2.883468 4.280000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.56165590046379, 2.57805692437427, 2.64721453201225, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jfod1389526340.ps tmp/1jfod1389526340.png",intern=TRUE)) character(0) > try(system("convert tmp/2i7641389526340.ps tmp/2i7641389526340.png",intern=TRUE)) character(0) > try(system("convert tmp/3incd1389526340.ps tmp/3incd1389526340.png",intern=TRUE)) character(0) > try(system("convert tmp/4edsp1389526340.ps tmp/4edsp1389526340.png",intern=TRUE)) character(0) > try(system("convert tmp/515j41389526340.ps tmp/515j41389526340.png",intern=TRUE)) character(0) > try(system("convert tmp/6fvlq1389526340.ps tmp/6fvlq1389526340.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.458 0.905 5.335