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(105.71,105.82,105.82,105.72,105.76,105.80,105.09,105.06,105.16,105.20,105.21,105.23,105.19,105.16,104.88,104.52,104.09,104.35,104.48,104.47,104.55,104.59,104.59,104.72,104.65,104.72,104.92,105.05,103.74,103.81,103.79,104.28,103.80,103.80,104.02,104.02,104.91,104.97,103.86,104.17,103.21,103.21,101.91,101.84,101.91,101.79,101.79,101.79,102.09,102.18,102.20,101.97,102.05,102.04,101.78,101.79,101.80,101.83,101.83,101.88,101.90,101.91,101.17,101.17,101.23,101.26,101.49,101.51,101.61,101.39,101.43,101.44) > 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,] 105.71 105.19 104.65 104.91 102.09 101.90 NA [2,] 105.82 105.16 104.72 104.97 102.18 101.91 NA [3,] 105.82 104.88 104.92 103.86 102.20 101.17 NA [4,] 105.72 104.52 105.05 104.17 101.97 101.17 NA [5,] 105.76 104.09 103.74 103.21 102.05 101.23 NA [6,] 105.80 104.35 103.81 103.21 102.04 101.26 NA [7,] 105.09 104.48 103.79 101.91 101.78 101.49 NA [8,] 105.06 104.47 104.28 101.84 101.79 101.51 NA [9,] 105.16 104.55 103.80 101.91 101.80 101.61 NA [10,] 105.20 104.59 103.80 101.79 101.83 101.39 NA [11,] 105.21 104.59 104.02 101.79 101.83 101.43 NA [12,] 105.23 104.72 104.02 101.79 101.88 101.44 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/1nbv01366880509.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/2nvk31366880509.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/3igqc1366880509.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/4ee8i1366880509.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,] 101.90 101.910 101.17 101.170 101.230 101.26 101.49 101.51 101.610 101.390 [2,] 102.09 102.180 102.20 101.970 102.050 102.04 101.78 101.79 101.800 101.790 [3,] 104.78 104.845 104.37 104.345 103.475 103.51 102.85 103.06 102.855 102.815 [4,] 105.19 105.160 104.92 105.050 104.090 104.35 104.48 104.47 104.550 104.590 [5,] 105.71 105.820 105.82 105.720 105.760 105.80 105.09 105.06 105.160 105.200 [,11] [,12] [1,] 101.430 101.44 [2,] 101.790 101.79 [3,] 102.925 102.95 [4,] 104.590 104.72 [5,] 105.210 105.23 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 102.7804 102.9228 102.6155 102.3583 102.1591 102.02 101.1084 101.3313 [2,] 106.7796 106.7672 106.1245 106.3317 104.7909 105.00 104.5916 104.7887 [,9] [,10] [,11] [,12] [1,] 101.0812 101.0089 101.1189 101.0601 [2,] 104.6288 104.6211 104.7311 104.8399 $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(101.9, 102.09, 104.78, 105.19, 105.71, 101.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hw901366880509.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,] 105.06 104.090 103.740 101.790 101.780 101.170 NA [2,] 105.18 104.475 103.800 101.815 101.815 101.245 NA [3,] 105.47 104.570 104.020 102.560 101.925 101.435 NA [4,] 105.78 104.800 104.685 104.015 102.070 101.560 NA [5,] 105.82 105.190 105.050 104.970 102.200 101.910 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 105.1963 104.4218 103.6163 101.5566 101.8087 101.2913 NA [2,] 105.7437 104.7182 104.4237 103.5634 102.0413 101.5787 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(105.06, 105.18, 105.47, 105.78, 105.82, 104.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hinp1366880509.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,] 1.555031 3.550 1.88250 [2,] 1.601049 3.690 2.29625 [3,] 1.642797 3.810 2.44625 [4,] 1.662241 4.535 2.60625 [5,] 1.669096 4.650 2.73250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.614886 3.42459 2.304857 [2,] 1.670707 4.19541 2.587643 $out [1] 1.787808 1.797962 1.662500 $group [1] 1 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.55503054632377, 1.60104916573454, 1.64279663135509, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nbv01366880509.ps tmp/1nbv01366880509.png",intern=TRUE)) character(0) > try(system("convert tmp/2nvk31366880509.ps tmp/2nvk31366880509.png",intern=TRUE)) character(0) > try(system("convert tmp/3igqc1366880509.ps tmp/3igqc1366880509.png",intern=TRUE)) character(0) > try(system("convert tmp/4ee8i1366880509.ps tmp/4ee8i1366880509.png",intern=TRUE)) character(0) > try(system("convert tmp/5hw901366880509.ps tmp/5hw901366880509.png",intern=TRUE)) character(0) > try(system("convert tmp/6hinp1366880509.ps tmp/6hinp1366880509.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.201 0.870 5.070