R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(70.3,90.2,107.3,104.6,102.7,124.5,117.8,104.2,99.9,91.5,95.7,91.4,86.2,91.5,115.5,113.9,131.9,121.2,105.2,107.5,113.8,100.5,104.8,103.8,93.1,106.2,117.5,109.9,123.6,139.3,111,122,110.9,108,103.7,107.3,92,83.4,110.7,109,121.3,121.4,129.9,109.7,113.1,109.4,101,109,92.8,91.1,114.5,118.6,120.2,135.9,122.8,106,118.1,108.9,97.3,113.9,88.3,88.3,114.6,118.8,111.9,130.1,124.3,112.2,110,105.8,105.1,106.7) > 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,] 70.3 86.2 93.1 92.0 92.8 88.3 NA [2,] 90.2 91.5 106.2 83.4 91.1 88.3 NA [3,] 107.3 115.5 117.5 110.7 114.5 114.6 NA [4,] 104.6 113.9 109.9 109.0 118.6 118.8 NA [5,] 102.7 131.9 123.6 121.3 120.2 111.9 NA [6,] 124.5 121.2 139.3 121.4 135.9 130.1 NA [7,] 117.8 105.2 111.0 129.9 122.8 124.3 NA [8,] 104.2 107.5 122.0 109.7 106.0 112.2 NA [9,] 99.9 113.8 110.9 113.1 118.1 110.0 NA [10,] 91.5 100.5 108.0 109.4 108.9 105.8 NA [11,] 95.7 104.8 103.7 101.0 97.3 105.1 NA [12,] 91.4 103.8 107.3 109.0 113.9 106.7 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/1ehsa1492785487.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/27j4x1492785487.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/39lfl1492785487.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/4ygns1492785487.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,] 86.20 88.30 107.30 104.6 102.70 121.2 105.2 104.2 110.0 91.5 95.70 103.8 [2,] 86.20 88.30 110.70 109.0 111.90 121.4 111.0 106.0 110.0 100.5 97.30 103.8 [3,] 90.15 90.65 114.55 111.9 120.75 127.3 120.3 108.6 112.0 106.9 102.35 107.0 [4,] 92.80 91.50 115.50 118.6 123.60 135.9 124.3 112.2 113.8 108.9 104.80 109.0 [5,] 93.10 91.50 117.50 118.8 131.90 139.3 129.9 112.2 118.1 109.4 105.10 113.9 $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.89279 88.5859 111.4538 105.7077 113.2031 117.947 111.7211 104.6008 [2,] 94.40721 92.7141 117.6462 118.0923 128.2969 136.653 128.8789 112.5992 [,9] [,10] [,11] [,12] [1,] 109.5489 101.4817 97.51226 103.6458 [2,] 114.4511 112.3183 107.18774 110.3542 $out [1] 70.3 106.2 83.4 122.0 99.9 91.4 $group [1] 1 2 2 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(86.2, 86.2, 90.15, 92.8, 93.1, 88.3, 88.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wkjh1492785487.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,] 70.30 86.20 93.10 92.00 91.10 105.10 NA [2,] 91.45 102.15 106.75 105.00 101.65 105.45 NA [3,] 101.30 106.35 110.40 109.55 114.20 110.95 NA [4,] 105.95 114.70 119.75 117.20 119.40 116.70 NA [5,] 124.50 131.90 123.60 129.90 135.90 130.10 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.68645 100.6259 104.4706 103.9855 106.1041 105.8188 NA [2,] 107.91355 112.0741 116.3294 115.1145 122.2959 116.0812 NA $out [1] 139.3 83.4 88.3 88.3 $group [1] 3 4 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(70.3, 91.45, 101.3, 105.95, 124.5, 86.2, 102.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ajf91492785487.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,] 3.697432 9.40 2.6250 [2,] 5.887583 16.00 3.8375 [3,] 7.272328 18.15 6.0875 [4,] 8.171300 22.80 8.6250 [5,] 10.093959 29.20 12.2750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 6.230710 15.04847 3.903889 [2,] 8.313947 21.25153 8.271111 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.69743154094839, 5.88758322609975, 7.27232801692229, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ehsa1492785487.ps tmp/1ehsa1492785487.png",intern=TRUE)) character(0) > try(system("convert tmp/27j4x1492785487.ps tmp/27j4x1492785487.png",intern=TRUE)) character(0) > try(system("convert tmp/39lfl1492785487.ps tmp/39lfl1492785487.png",intern=TRUE)) character(0) > try(system("convert tmp/4ygns1492785487.ps tmp/4ygns1492785487.png",intern=TRUE)) character(0) > try(system("convert tmp/5wkjh1492785487.ps tmp/5wkjh1492785487.png",intern=TRUE)) character(0) > try(system("convert tmp/6ajf91492785487.ps tmp/6ajf91492785487.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.595 0.355 4.181