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(0.9,0.9,0.9,0.9,0.9,0.91,0.91,0.91,0.91,0.91,0.92,0.92,0.92,0.92,0.92,0.93,0.93,0.93,0.93,0.93,0.92,0.93,0.93,0.93,0.94,0.95,0.95,0.96,0.97,0.97,0.97,0.98,0.98,0.98,0.98,0.98,0.98,1,1.01,1.01,1.02,1.02,1.02,1.02,1.03,1.03,1.03,1.03,1.03,1.04,1.05,1.05,1.05,1.05,1.06,1.06,1.06,1.06,1.06,1.06,1.06,1.07,1.08,1.09,1.09,1.09,1.09,1.09,1.09,1.09,1.09,1.09) > 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,] 0.90 0.92 0.94 0.98 1.03 1.06 NA [2,] 0.90 0.92 0.95 1.00 1.04 1.07 NA [3,] 0.90 0.92 0.95 1.01 1.05 1.08 NA [4,] 0.90 0.93 0.96 1.01 1.05 1.09 NA [5,] 0.90 0.93 0.97 1.02 1.05 1.09 NA [6,] 0.91 0.93 0.97 1.02 1.05 1.09 NA [7,] 0.91 0.93 0.97 1.02 1.06 1.09 NA [8,] 0.91 0.93 0.98 1.02 1.06 1.09 NA [9,] 0.91 0.92 0.98 1.03 1.06 1.09 NA [10,] 0.91 0.93 0.98 1.03 1.06 1.09 NA [11,] 0.92 0.93 0.98 1.03 1.06 1.09 NA [12,] 0.92 0.93 0.98 1.03 1.06 1.09 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/10dpr1353928297.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/2b3sv1353928297.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/3t9ap1353928297.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/4zvkm1353928297.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,] 0.90 0.900 0.90 0.900 0.900 0.910 0.910 0.91 0.910 0.910 0.920 0.920 [2,] 0.92 0.920 0.92 0.930 0.930 0.930 0.930 0.93 0.920 0.930 0.930 0.930 [3,] 0.96 0.975 0.98 0.985 0.995 0.995 0.995 1.00 1.005 1.005 1.005 1.005 [4,] 1.03 1.040 1.05 1.050 1.050 1.050 1.060 1.06 1.060 1.060 1.060 1.060 [5,] 1.06 1.070 1.08 1.090 1.090 1.090 1.090 1.09 1.090 1.090 1.090 1.090 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.8890464 0.8975961 0.8961458 0.9075961 0.9175961 0.9175961 0.9111458 [2,] 1.0309536 1.0524039 1.0638542 1.0624039 1.0724039 1.0724039 1.0788542 [,8] [,9] [,10] [,11] [,12] [1,] 0.9161458 0.9146955 0.9211458 0.9211458 0.9211458 [2,] 1.0838542 1.0953045 1.0888542 1.0888542 1.0888542 $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(0.9, 0.92, 0.96, 1.03, 1.06, 0.9, 0.92, 0.975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p7c51353928297.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,] 0.90 0.92 0.940 0.98 1.040 1.080 NA [2,] 0.90 0.92 0.955 1.01 1.050 1.085 NA [3,] 0.91 0.93 0.970 1.02 1.055 1.090 NA [4,] 0.91 0.93 0.980 1.03 1.060 1.090 NA [5,] 0.92 0.93 0.980 1.03 1.060 1.090 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9054389 0.9254389 0.9585973 1.010878 1.050439 1.087719 NA [2,] 0.9145611 0.9345611 0.9814027 1.029122 1.059561 1.092281 NA $out [1] 1.03 1.06 1.07 $group [1] 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(0.9, 0.9, 0.91, 0.91, 0.92, 0.92, 0.92, 0.93, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zcd11353928297.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.06782330 0.16 0.09250 [2,] 0.06968979 0.17 0.10250 [3,] 0.07170473 0.18 0.10875 [4,] 0.07285831 0.18 0.11000 [5,] 0.07413951 0.19 0.11750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.07025955 0.1754389 0.1053292 [2,] 0.07314991 0.1845611 0.1121708 $out [1] 0.06337718 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.0678232998312527, 0.0696897888263888, 0.0717047293035083, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10dpr1353928297.ps tmp/10dpr1353928297.png",intern=TRUE)) character(0) > try(system("convert tmp/2b3sv1353928297.ps tmp/2b3sv1353928297.png",intern=TRUE)) character(0) > try(system("convert tmp/3t9ap1353928297.ps tmp/3t9ap1353928297.png",intern=TRUE)) character(0) > try(system("convert tmp/4zvkm1353928297.ps tmp/4zvkm1353928297.png",intern=TRUE)) character(0) > try(system("convert tmp/5p7c51353928297.ps tmp/5p7c51353928297.png",intern=TRUE)) character(0) > try(system("convert tmp/6zcd11353928297.ps tmp/6zcd11353928297.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.914 0.600 3.632