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(109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.77,109.86,110.12,110.5,113.73,119.84,119.83,113.06,112.45,110.07,110.09,110.72,109.9,109.9,110.06,110.52,116.16,118.54,118.77,113.71,106.98,106.98,106.98,106.98,106.98,106.98,107.43,107.93,111.99,115.4,115.53,115.22,102.75,102.75,102.75,102.75,102.75,102.75,102.87,103.13,108.52,111.6,111.32,108.77,100.05,100.05,100.05,100.05,100.05,100.05,100.07,100.07,109.26,110,110,109.26,99.42,99.42,99.42,99.42,99.42) > 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,] 109.77 109.86 109.90 106.98 102.75 100.05 NA [2,] 109.77 110.12 110.06 107.43 102.87 100.07 NA [3,] 109.77 110.50 110.52 107.93 103.13 100.07 NA [4,] 109.77 113.73 116.16 111.99 108.52 109.26 NA [5,] 109.77 119.84 118.54 115.40 111.60 110.00 NA [6,] 109.77 119.83 118.77 115.53 111.32 110.00 NA [7,] 109.77 113.06 113.71 115.22 108.77 109.26 NA [8,] 109.77 112.45 106.98 102.75 100.05 99.42 NA [9,] 109.77 110.07 106.98 102.75 100.05 99.42 NA [10,] 109.77 110.09 106.98 102.75 100.05 99.42 NA [11,] 109.77 110.72 106.98 102.75 100.05 99.42 NA [12,] 109.77 109.90 106.98 102.75 100.05 99.42 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/1h00a1369305546.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/28udf1369305546.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/339yi1369305546.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/4xl451369305546.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] [1,] 100.050 100.07 100.07 108.52 109.77 109.770 108.770 99.420 99.420 [2,] 102.750 102.87 103.13 109.26 110.00 110.000 109.260 100.050 100.050 [3,] 108.375 108.60 108.85 110.88 113.50 113.425 111.415 104.865 104.865 [4,] 109.860 110.06 110.50 113.73 118.54 118.770 113.710 109.770 109.770 [5,] 109.900 110.12 110.52 116.16 119.84 119.830 115.220 112.450 110.070 [,10] [,11] [,12] [1,] 99.420 99.420 99.420 [2,] 100.050 100.050 100.050 [3,] 104.865 104.865 104.865 [4,] 109.770 109.770 109.770 [5,] 110.090 110.720 109.900 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.7888 103.9622 104.0961 107.9967 107.9914 107.7681 108.5446 98.59529 [2,] 112.9612 113.2378 113.6039 113.7633 119.0086 119.0819 114.2854 111.13471 [,9] [,10] [,11] [,12] [1,] 98.59529 98.59529 98.59529 98.59529 [2,] 111.13471 111.13471 111.13471 111.13471 $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(100.05, 102.75, 108.375, 109.86, 109.9, 100.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vg321369305546.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,] 109.77 109.860 106.980 102.750 100.050 99.42 NA [2,] 109.77 110.080 106.980 102.750 100.050 99.42 NA [3,] 109.77 110.610 109.980 107.205 102.810 100.06 NA [4,] 109.77 113.395 114.935 113.605 108.645 109.26 NA [5,] 109.77 113.730 118.770 115.530 111.600 110.00 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 109.77 109.098 106.3517 102.254 98.88976 95.57191 NA [2,] 109.77 112.122 113.6083 112.156 106.73024 104.54809 NA $out [1] 119.84 119.83 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(109.77, 109.77, 109.77, 109.77, 109.77, 109.86, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/62mpl1369305546.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,] 4.228992 9.85 3.9075 [2,] 4.254206 9.95 5.9825 [3,] 4.427992 10.26 7.4925 [4,] 4.754592 10.66 8.3475 [5,] 5.339310 11.30 8.3475 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.199762 9.936164 6.413808 [2,] 4.656221 10.583836 8.571192 $out [1] 2.959347 2.702424 7.640000 6.450000 13.030000 $group [1] 1 1 2 2 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.22899239378208, 4.25420645765066, 4.42799184218241, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h00a1369305546.ps tmp/1h00a1369305546.png",intern=TRUE)) character(0) > try(system("convert tmp/28udf1369305546.ps tmp/28udf1369305546.png",intern=TRUE)) character(0) > try(system("convert tmp/339yi1369305546.ps tmp/339yi1369305546.png",intern=TRUE)) character(0) > try(system("convert tmp/4xl451369305546.ps tmp/4xl451369305546.png",intern=TRUE)) character(0) > try(system("convert tmp/5vg321369305546.ps tmp/5vg321369305546.png",intern=TRUE)) character(0) > try(system("convert tmp/62mpl1369305546.ps tmp/62mpl1369305546.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.113 0.885 4.975