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(2.57,2.58,2.58,2.58,2.57,2.57,2.57,2.57,2.59,2.62,2.66,2.67,2.67,2.69,2.69,2.69,2.69,2.71,2.71,2.71,2.74,2.77,2.82,2.82,2.82,2.8,2.82,2.82,2.82,2.82,2.82,2.82,2.85,2.93,2.94,2.94,2.95,2.95,2.96,2.96,2.97,2.97,2.97,2.97,2.98,3.03,3.03,3.03,3.03,3.04,3.05,3.06,3.06,3.07,3.07,3.07,3.04,3.06,3.09,3.09,3.09,3.09,3.1,3.1,3.1,3.1,3.1,3.11,3.11,3.17,3.19,3.19,3.19,3.19,3.19,3.19,3.19,3.19,3.19,3.19,3.25,3.23,3.24,3.24) > 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,] 2.57 2.67 2.82 2.95 3.03 3.09 3.19 NA [2,] 2.58 2.69 2.80 2.95 3.04 3.09 3.19 NA [3,] 2.58 2.69 2.82 2.96 3.05 3.10 3.19 NA [4,] 2.58 2.69 2.82 2.96 3.06 3.10 3.19 NA [5,] 2.57 2.69 2.82 2.97 3.06 3.10 3.19 NA [6,] 2.57 2.71 2.82 2.97 3.07 3.10 3.19 NA [7,] 2.57 2.71 2.82 2.97 3.07 3.10 3.19 NA [8,] 2.57 2.71 2.82 2.97 3.07 3.11 3.19 NA [9,] 2.59 2.74 2.85 2.98 3.04 3.11 3.25 NA [10,] 2.62 2.77 2.93 3.03 3.06 3.17 3.23 NA [11,] 2.66 2.82 2.94 3.03 3.09 3.19 3.24 NA [12,] 2.67 2.82 2.94 3.03 3.09 3.19 3.24 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/13x4p1386189817.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/2jhzs1386189817.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/32rlt1386189817.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/495hl1386189817.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,] 2.570 2.580 2.580 2.580 2.570 2.570 2.570 2.570 2.590 2.620 2.66 2.67 [2,] 2.745 2.745 2.755 2.755 2.755 2.765 2.765 2.765 2.795 2.850 2.88 2.88 [3,] 2.950 2.950 2.960 2.960 2.970 2.970 2.970 2.970 2.980 3.030 3.03 3.03 [4,] 3.060 3.065 3.075 3.080 3.080 3.085 3.085 3.090 3.075 3.115 3.14 3.14 [5,] 3.190 3.190 3.190 3.190 3.190 3.190 3.190 3.190 3.250 3.230 3.24 3.24 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.761887 2.758901 2.768901 2.765915 2.775915 2.778901 2.778901 2.775915 [2,] 3.138113 3.141099 3.151099 3.154085 3.164085 3.161099 3.161099 3.164085 [,9] [,10] [,11] [,12] [1,] 2.812789 2.871746 2.874732 2.874732 [2,] 3.147211 3.188254 3.185268 3.185268 $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(2.57, 2.745, 2.95, 3.06, 3.19, 2.58, 2.745, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5isab1386189817.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,] 2.570 2.670 2.80 2.950 3.030 3.09 3.190 NA [2,] 2.570 2.690 2.82 2.960 3.045 3.10 3.190 NA [3,] 2.580 2.710 2.82 2.970 3.060 3.10 3.190 NA [4,] 2.605 2.755 2.89 3.005 3.070 3.14 3.235 NA [5,] 2.620 2.820 2.94 3.030 3.090 3.19 3.250 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.564036 2.680353 2.788073 2.949475 3.048597 3.081756 3.169475 NA [2,] 2.595964 2.739647 2.851927 2.990525 3.071403 3.118244 3.210525 NA $out [1] 2.66 2.67 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(2.57, 2.57, 2.58, 2.605, 2.62, 2.67, 2.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jrbw1386189817.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.2173104 0.610 0.2600 [2,] 0.2201921 0.610 0.2725 [3,] 0.2257682 0.615 0.3200 [4,] 0.2263636 0.620 0.3225 [5,] 0.2282438 0.620 0.3250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.2229533 0.6104389 0.2971947 [2,] 0.2285830 0.6195611 0.3428053 $out [1] 0.2058201 0.2031185 0.6600000 0.5800000 0.5700000 $group [1] 1 1 2 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.21731039902363, 0.220192082158212, 0.225768191545434, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13x4p1386189817.ps tmp/13x4p1386189817.png",intern=TRUE)) character(0) > try(system("convert tmp/2jhzs1386189817.ps tmp/2jhzs1386189817.png",intern=TRUE)) character(0) > try(system("convert tmp/32rlt1386189817.ps tmp/32rlt1386189817.png",intern=TRUE)) character(0) > try(system("convert tmp/495hl1386189817.ps tmp/495hl1386189817.png",intern=TRUE)) character(0) > try(system("convert tmp/5isab1386189817.ps tmp/5isab1386189817.png",intern=TRUE)) character(0) > try(system("convert tmp/6jrbw1386189817.ps tmp/6jrbw1386189817.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.847 1.117 5.955