R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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(96.24,95.56,95.56,95.56,95.96,95.96,95.96,95.96,95.61,95.30,95.68,97.94,97.32,97.32,97.45,98.08,98.25,98.25,97.95,97.81,97.68,98.03,98.03,98.03,98.11,98.11,98.11,97.95,97.95,97.95,97.95,97.95,97.95,97.89,97.16,97.16,97.16,97.18,97.18,96.47,97.47,97.47,97.47,97.47,96.63,96.78,96.25,96.25,96.28,95.62,95.62,96.85,96.85,96.85,96.85,96.85,96.85,96.85,96.75,97.15,98.28,98.28,98.28,98.51,98.51,98.51,96.03,96.03,96.77,96.92,96.92,96.92) > 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,] 96.24 97.32 98.11 97.16 96.28 98.28 NA [2,] 95.56 97.32 98.11 97.18 95.62 98.28 NA [3,] 95.56 97.45 98.11 97.18 95.62 98.28 NA [4,] 95.56 98.08 97.95 96.47 96.85 98.51 NA [5,] 95.96 98.25 97.95 97.47 96.85 98.51 NA [6,] 95.96 98.25 97.95 97.47 96.85 98.51 NA [7,] 95.96 97.95 97.95 97.47 96.85 96.03 NA [8,] 95.96 97.81 97.95 97.47 96.85 96.03 NA [9,] 95.61 97.68 97.95 96.63 96.85 96.77 NA [10,] 95.30 98.03 97.89 96.78 96.85 96.92 NA [11,] 95.68 98.03 97.16 96.25 96.75 96.92 NA [12,] 97.94 98.03 97.16 96.25 97.15 96.92 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/fisher/rcomp/tmp/1vj7t1354906011.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/fisher/rcomp/tmp/2048n1354906011.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/fisher/rcomp/tmp/3kbxt1354906011.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/fisher/rcomp/tmp/4on801354906011.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] [1,] 96.24 95.56 95.560 95.56 95.96 95.96 95.96 95.96 95.61 95.300 95.680 [2,] 96.28 95.62 95.620 96.47 96.85 96.85 96.03 96.03 96.63 96.780 96.250 [3,] 97.24 97.25 97.315 97.40 97.71 97.71 97.16 97.16 96.81 96.885 96.835 [4,] 98.11 98.11 98.110 98.08 98.25 98.25 97.95 97.81 97.68 97.890 97.160 [5,] 98.28 98.28 98.280 98.51 98.51 98.51 97.95 97.95 97.95 98.030 98.030 [,12] [1,] 96.250 [2,] 96.920 [3,] 97.155 [4,] 97.940 [5,] 98.030 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.05959 95.64387 95.70887 96.3615 96.80695 96.80695 95.92154 96.01184 [2,] 98.42041 98.85613 98.92113 98.4385 98.61305 98.61305 98.39846 98.30816 [,9] [,10] [,11] [,12] [1,] 96.13272 96.16901 96.24802 96.49707 [2,] 97.48728 97.60099 97.42198 97.81293 $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(96.24, 96.28, 97.24, 98.11, 98.28, 95.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5z5rr1354906011.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,] 95.30 97.320 97.89 96.25 96.280 96.030 NA [2,] 95.56 97.565 97.92 96.55 96.515 96.845 NA [3,] 95.82 97.990 97.95 97.17 96.850 97.600 NA [4,] 95.96 98.055 98.03 97.47 96.850 98.395 NA [5,] 96.24 98.250 98.11 97.47 97.150 98.510 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.63756 97.76651 97.89983 96.75038 96.6972 96.89303 NA [2,] 96.00244 98.21349 98.00017 97.58962 97.0028 98.30697 NA $out [1] 97.94 97.16 97.16 95.62 95.62 $group [1] 1 3 3 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(95.3, 95.56, 95.82, 95.96, 96.24, 97.32, 97.565, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6rd8u1354906011.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.6649937 1.780 0.72500 [2,] 0.8505990 2.015 0.82875 [3,] 0.9292959 2.450 1.29125 [4,] 1.0557240 2.720 1.54250 [5,] 1.1896834 2.950 1.93500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.8357371 2.128445 0.9657038 [2,] 1.0228548 2.771555 1.6167962 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.664993734306321, 0.850599001114424, 0.929295947255864, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vj7t1354906011.ps tmp/1vj7t1354906011.png",intern=TRUE)) character(0) > try(system("convert tmp/2048n1354906011.ps tmp/2048n1354906011.png",intern=TRUE)) character(0) > try(system("convert tmp/3kbxt1354906011.ps tmp/3kbxt1354906011.png",intern=TRUE)) character(0) > try(system("convert tmp/4on801354906011.ps tmp/4on801354906011.png",intern=TRUE)) character(0) > try(system("convert tmp/5z5rr1354906011.ps tmp/5z5rr1354906011.png",intern=TRUE)) character(0) > try(system("convert tmp/6rd8u1354906011.ps tmp/6rd8u1354906011.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.132 0.833 3.953