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(85.3,85.65,85.15,84.94,85.15,85.15,85.15,85.14,85.37,85.61,85.59,85.54,85.54,85.5,85.78,86.16,86.38,86.49,86.49,86,85.9,85.66,85.64,85.6,85.6,85.57,85.81,86.29,86.37,86.41,86.41,86.38,86.62,87.08,87.19,87.21,87.21,87.24,87.16,87.05,87.04,86.98,86.98,86.94,86.96,86.98,86.86,86.82,86.82,86.84,86.91,86.85,86.61,86.65,86.65,86.36,86.33,86.43,86.36,86.29,86.29,86.44,86.51,86.72,86.93,86.79,86.79,86.8,86.41,86.26,86.19,86.28) > 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,] 85.30 85.54 85.60 87.21 86.82 86.29 NA [2,] 85.65 85.50 85.57 87.24 86.84 86.44 NA [3,] 85.15 85.78 85.81 87.16 86.91 86.51 NA [4,] 84.94 86.16 86.29 87.05 86.85 86.72 NA [5,] 85.15 86.38 86.37 87.04 86.61 86.93 NA [6,] 85.15 86.49 86.41 86.98 86.65 86.79 NA [7,] 85.15 86.49 86.41 86.98 86.65 86.79 NA [8,] 85.14 86.00 86.38 86.94 86.36 86.80 NA [9,] 85.37 85.90 86.62 86.96 86.33 86.41 NA [10,] 85.61 85.66 87.08 86.98 86.43 86.26 NA [11,] 85.59 85.64 87.19 86.86 86.36 86.19 NA [12,] 85.54 85.60 87.21 86.82 86.29 86.28 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/13j501369315245.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/2vaqi1369315245.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/3y0b31369315245.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/4007h1369315245.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,] 85.300 85.500 85.15 86.160 86.370 86.41 86.41 85.14 85.37 85.610 85.590 [2,] 85.540 85.570 85.78 86.160 86.370 86.41 86.41 86.00 85.90 85.660 85.640 [3,] 85.945 86.045 86.16 86.505 86.495 86.57 86.57 86.37 86.37 86.345 86.275 [4,] 86.820 86.840 86.91 86.850 86.930 86.79 86.79 86.80 86.62 86.980 86.860 [5,] 87.210 87.240 87.16 87.050 87.040 86.98 86.98 86.94 86.96 87.080 87.190 [,12] [1,] 85.540 [2,] 85.600 [3,] 86.285 [4,] 86.820 [5,] 87.210 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.11936 85.22581 85.43111 86.05993 86.13378 86.32489 86.32489 85.85397 [2,] 86.77064 86.86419 86.88889 86.95007 86.85622 86.81511 86.81511 86.88603 [,9] [,10] [,11] [,12] [1,] 85.90558 85.49356 85.48806 85.49806 [2,] 86.83442 87.19644 87.06194 87.07194 $out [1] 84.94 85.15 85.15 85.15 $group [1] 4 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(85.3, 85.54, 85.945, 86.82, 87.21, 85.5, 85.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/524751369315245.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,] 84.940 85.50 85.570 86.820 86.29 86.190 NA [2,] 85.150 85.62 86.050 86.950 86.36 86.285 NA [3,] 85.225 85.84 86.395 86.980 86.63 86.475 NA [4,] 85.565 86.27 86.850 87.105 86.83 86.790 NA [5,] 85.650 86.49 87.210 87.240 86.91 86.930 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.03572 85.54353 86.03011 86.9093 86.41563 86.24467 NA [2,] 85.41428 86.13647 86.75989 87.0507 86.84437 86.70533 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(84.94, 85.15, 85.225, 85.565, 85.65, 85.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6z29e1369315245.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.5600982 1.470 0.32500 [2,] 0.6450317 1.635 0.51875 [3,] 0.6547339 1.815 0.77125 [4,] 0.7510040 1.900 1.02750 [5,] 0.7727785 2.110 1.15000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.6063992 1.694132 0.5392057 [2,] 0.7030686 1.935868 1.0032943 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.56009820567468, 0.645031728668917, 0.654733886715241, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13j501369315245.ps tmp/13j501369315245.png",intern=TRUE)) character(0) > try(system("convert tmp/2vaqi1369315245.ps tmp/2vaqi1369315245.png",intern=TRUE)) character(0) > try(system("convert tmp/3y0b31369315245.ps tmp/3y0b31369315245.png",intern=TRUE)) character(0) > try(system("convert tmp/4007h1369315245.ps tmp/4007h1369315245.png",intern=TRUE)) character(0) > try(system("convert tmp/524751369315245.ps tmp/524751369315245.png",intern=TRUE)) character(0) > try(system("convert tmp/6z29e1369315245.ps tmp/6z29e1369315245.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.484 0.744 4.210