R version 3.2.4 Revised (2016-03-16 r70336) -- "Very Secure Dishes" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(90.4,89.5,88.9,88.4,87.6,87.1,86.5,85.7,85.3,84.9,84.5,84.4,84.3,84.2,84.1,83.8,83.5,83.2,82.8,82.2,81.5,80.8,80.3,79.8,79.2,78.8,78.1,77.8,77.3,76.7,76.2,76.1,76.3,76.2,76.2,76.6,75.5,75.4,75.5,75.5,75.2,74.9,74.6,74.4,74,73.3,72.7,72,71.2,70.9,70.4,70,69.7,69.2,68.7,68.6,68.4,67.9,67.4,66.5,65.6,64.6,63.8,63,62.1,61.7,61.4,61.1,61.1,61,60.5,60.2,59.9,59.4,59.6,59.5,59.3,59.3,59.1,58.8) > 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] 80 > (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] 7 7 7 7 7 7 7 7 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.4 84.3 79.2 75.5 71.2 65.6 59.9 [2,] 89.5 84.2 78.8 75.4 70.9 64.6 59.4 [3,] 88.9 84.1 78.1 75.5 70.4 63.8 59.6 [4,] 88.4 83.8 77.8 75.5 70.0 63.0 59.5 [5,] 87.6 83.5 77.3 75.2 69.7 62.1 59.3 [6,] 87.1 83.2 76.7 74.9 69.2 61.7 59.3 [7,] 86.5 82.8 76.2 74.6 68.7 61.4 59.1 [8,] 85.7 82.2 76.1 74.4 68.6 61.1 58.8 [9,] 85.3 81.5 76.3 74.0 68.4 61.1 NA [10,] 84.9 80.8 76.2 73.3 67.9 61.0 NA [11,] 84.5 80.3 76.2 72.7 67.4 60.5 NA [12,] 84.4 79.8 76.6 72.0 66.5 60.2 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/102nk1458675603.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/2lx8b1458675603.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/3fm5m1458675603.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/4w24t1458675603.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,] 59.90 59.40 59.6 59.5 59.3 59.30 59.10 58.80 61.10 61.00 60.50 60.2 [2,] 68.40 67.75 67.1 66.5 65.9 65.45 65.05 64.85 68.40 67.90 67.40 66.5 [3,] 75.50 75.40 75.5 75.5 75.2 74.90 74.60 74.40 75.15 74.75 74.45 74.3 [4,] 81.75 81.50 81.1 80.8 80.4 79.95 79.50 79.15 81.50 80.80 80.30 79.8 [5,] 90.40 89.50 88.9 88.4 87.6 87.10 86.50 85.70 85.30 84.90 84.50 84.4 $n [1] 7 7 7 7 7 7 7 7 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67.5276 67.18872 67.13943 66.96027 66.54083 66.24083 65.97069 65.86027 [2,] 83.4724 83.61128 83.86057 84.03973 83.85917 83.55917 83.22931 82.93973 [,9] [,10] [,11] [,12] [1,] 66.70008 66.42908 66.12908 65.72107 [2,] 83.59992 83.07092 82.77092 82.87893 $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(59.9, 68.4, 75.5, 81.75, 90.4, 59.4, 67.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/54nf41458675603.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.40 79.80 76.10 72.00 66.50 60.20 58.80 [2,] 85.10 81.15 76.20 73.65 68.15 61.05 59.20 [3,] 86.80 83.00 76.65 74.75 68.95 61.55 59.35 [4,] 88.65 83.95 77.95 75.45 70.20 63.40 59.55 [5,] 90.40 84.30 79.20 75.50 71.20 65.60 59.90 $n [1] 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.18082 81.7229 75.85181 73.92901 68.01498 60.47815 59.15448 [2,] 88.41918 84.2771 77.44819 75.57099 69.88502 62.62185 59.54552 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(84.4, 85.1, 86.8, 88.65, 90.4, 79.8, 81.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6bukx1458675603.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,] 8.678575 23.9 10.4000 [2,] 8.841472 24.2 10.8375 [3,] 10.354959 27.6 13.8750 [4,] 10.543391 29.1 14.3750 [5,] 10.623312 30.5 14.5000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.578703 25.36508 12.26152 [2,] 11.131216 29.83492 15.48848 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.67857515187065, 8.84147239865683, 10.3549591712479, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/102nk1458675603.ps tmp/102nk1458675603.png",intern=TRUE)) character(0) > try(system("convert tmp/2lx8b1458675603.ps tmp/2lx8b1458675603.png",intern=TRUE)) character(0) > try(system("convert tmp/3fm5m1458675603.ps tmp/3fm5m1458675603.png",intern=TRUE)) character(0) > try(system("convert tmp/4w24t1458675603.ps tmp/4w24t1458675603.png",intern=TRUE)) character(0) > try(system("convert tmp/54nf41458675603.ps tmp/54nf41458675603.png",intern=TRUE)) character(0) > try(system("convert tmp/6bukx1458675603.ps tmp/6bukx1458675603.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.289 0.418 2.731