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(1.26,1.26,1.28,1.34,1.39,1.47,1.57,1.63,1.72,1.43,1.35,1.41,1.44,1.43,1.43,1.42,1.45,1.51,1.48,1.48,1.45,1.38,1.46,1.45,1.41,1.45,1.47,1.47,1.53,1.56,1.66,1.79,1.78,1.46,1.41,1.43,1.43,1.45,1.35,1.35,1.29,1.29,1.26,1.3,1.3,1.16,1.24,1.15,1.21,1.22,1.17,1.13,1.15,1.2,1.23,1.25,1.38,1.28,1.26,1.25,1.26,1.28,1.31,1.22,1.23,1.36,1.54,1.58,1.44,1.29,1.28,1.23) > 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,] 1.26 1.44 1.41 1.43 1.21 1.26 NA [2,] 1.26 1.43 1.45 1.45 1.22 1.28 NA [3,] 1.28 1.43 1.47 1.35 1.17 1.31 NA [4,] 1.34 1.42 1.47 1.35 1.13 1.22 NA [5,] 1.39 1.45 1.53 1.29 1.15 1.23 NA [6,] 1.47 1.51 1.56 1.29 1.20 1.36 NA [7,] 1.57 1.48 1.66 1.26 1.23 1.54 NA [8,] 1.63 1.48 1.79 1.30 1.25 1.58 NA [9,] 1.72 1.45 1.78 1.30 1.38 1.44 NA [10,] 1.43 1.38 1.46 1.16 1.28 1.29 NA [11,] 1.35 1.46 1.41 1.24 1.26 1.28 NA [12,] 1.41 1.45 1.43 1.15 1.25 1.23 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/1m3hq1367002493.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/2spl21367002493.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/3vyfc1367002493.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/4lhj41367002493.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.210 1.220 1.17 1.130 1.15 1.200 1.23 1.25 1.300 1.160 1.240 1.15 [2,] 1.260 1.260 1.28 1.220 1.23 1.290 1.26 1.30 1.380 1.280 1.260 1.23 [3,] 1.335 1.355 1.33 1.345 1.34 1.415 1.51 1.53 1.445 1.335 1.315 1.33 [4,] 1.430 1.450 1.43 1.420 1.45 1.510 1.57 1.63 1.720 1.430 1.410 1.43 [5,] 1.440 1.450 1.47 1.470 1.53 1.560 1.66 1.79 1.780 1.460 1.460 1.45 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.225345 1.232444 1.233245 1.215994 1.198093 1.273093 1.31004 1.317139 [2,] 1.444655 1.477556 1.426755 1.474006 1.481907 1.556907 1.70996 1.742861 [,9] [,10] [,11] [,12] [1,] 1.225689 1.238245 1.218245 1.200994 [2,] 1.664311 1.431755 1.411755 1.459006 $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(1.21, 1.26, 1.335, 1.43, 1.44, 1.22, 1.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sv1z1367002493.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,] 1.26 1.38 1.41 1.150 1.130 1.220 NA [2,] 1.31 1.43 1.44 1.250 1.185 1.245 NA [3,] 1.40 1.45 1.47 1.295 1.225 1.285 NA [4,] 1.52 1.47 1.61 1.350 1.255 1.400 NA [5,] 1.72 1.51 1.79 1.450 1.280 1.580 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.304218 1.431756 1.392462 1.249389 1.193073 1.214303 NA [2,] 1.495782 1.468244 1.547538 1.340611 1.256927 1.355697 NA $out [1] 1.38 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.26, 1.31, 1.4, 1.52, 1.72, 1.38, 1.43, 1.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64jf01367002493.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.08846845 0.220 0.12250 [2,] 0.10706261 0.265 0.14375 [3,] 0.12604845 0.320 0.18500 [4,] 0.15830541 0.405 0.22000 [5,] 0.20501219 0.540 0.27250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.1026763 0.2561451 0.1502219 [2,] 0.1494206 0.3838549 0.2197781 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0884684501201794, 0.107062606849009, 0.126048445278443, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1m3hq1367002493.ps tmp/1m3hq1367002493.png",intern=TRUE)) character(0) > try(system("convert tmp/2spl21367002493.ps tmp/2spl21367002493.png",intern=TRUE)) character(0) > try(system("convert tmp/3vyfc1367002493.ps tmp/3vyfc1367002493.png",intern=TRUE)) character(0) > try(system("convert tmp/4lhj41367002493.ps tmp/4lhj41367002493.png",intern=TRUE)) character(0) > try(system("convert tmp/5sv1z1367002493.ps tmp/5sv1z1367002493.png",intern=TRUE)) character(0) > try(system("convert tmp/64jf01367002493.ps tmp/64jf01367002493.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.740 1.552 9.263