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(88,90,82,75,79,70,71,75,89,92,94,90,102,98,100,98,100,91,93,92,106,109,108,108,118,119,124,118,119,113,114,115,125,125,118,122,132,133,136,128,126,114,108,107,117,119,113,114,124,125,124,118,111,99,94,93,107,107,103,97,103,107,104,101,92,85,83,77,90,87,87,78) > 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,] 88 102 118 132 124 103 NA [2,] 90 98 119 133 125 107 NA [3,] 82 100 124 136 124 104 NA [4,] 75 98 118 128 118 101 NA [5,] 79 100 119 126 111 92 NA [6,] 70 91 113 114 99 85 NA [7,] 71 93 114 108 94 83 NA [8,] 75 92 115 107 93 77 NA [9,] 89 106 125 117 107 90 NA [10,] 92 109 125 119 107 87 NA [11,] 94 108 118 113 103 87 NA [12,] 90 108 122 114 97 78 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/1vjoy1493154302.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/2jvfg1493154302.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/3aa9a1493154302.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/44lip1493154302.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,] 88.0 90 82 75.0 79.0 70 71.0 75.0 89.0 87 87.0 78.0 [2,] 102.0 98 100 98.0 92.0 85 83.0 77.0 90.0 92 94.0 90.0 [3,] 110.5 113 114 109.5 105.5 95 93.5 92.5 106.5 108 105.5 102.5 [4,] 124.0 125 124 118.0 119.0 113 108.0 107.0 117.0 119 113.0 114.0 [5,] 132.0 133 136 128.0 126.0 114 114.0 115.0 125.0 125 118.0 122.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.30929 95.58413 98.51922 96.59935 88.08413 76.9391 77.37419 [2,] 124.69071 130.41587 129.48078 122.40065 122.91587 113.0609 109.62581 [,8] [,9] [,10] [,11] [,12] [1,] 73.14903 89.08413 90.58413 93.24439 87.01922 [2,] 111.85097 123.91587 125.41587 117.75561 117.98078 $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(88, 102, 110.5, 124, 132, 90, 98, 113, 125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5scls1493154302.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 91.0 113.0 107.0 93 77.0 NA [2,] 75 95.5 116.5 113.5 98 84.0 NA [3,] 85 100.0 118.5 118.0 107 88.5 NA [4,] 90 107.0 123.0 130.0 121 102.0 NA [5,] 94 109.0 125.0 136.0 125 107.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 78.1584 94.75477 115.5353 110.4742 96.50955 80.29008 NA [2,] 91.8416 105.24523 121.4647 125.5258 117.49045 96.70992 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(70, 75, 85, 90, 94, 91, 95.5, 100, 107, 109, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uxvs1493154302.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,] 14.33411 31.0 15.50 [2,] 15.29669 39.0 19.75 [3,] 16.29824 43.5 20.75 [4,] 17.26845 45.5 23.00 [5,] 19.85615 54.0 23.25 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 15.39890 40.53531 19.26765 [2,] 17.19757 46.46469 22.23235 $out [1] 11.68617 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(14.3341085061704, 15.2966873651111, 16.298236514643, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vjoy1493154302.ps tmp/1vjoy1493154302.png",intern=TRUE)) character(0) > try(system("convert tmp/2jvfg1493154302.ps tmp/2jvfg1493154302.png",intern=TRUE)) character(0) > try(system("convert tmp/3aa9a1493154302.ps tmp/3aa9a1493154302.png",intern=TRUE)) character(0) > try(system("convert tmp/44lip1493154302.ps tmp/44lip1493154302.png",intern=TRUE)) character(0) > try(system("convert tmp/5scls1493154302.ps tmp/5scls1493154302.png",intern=TRUE)) character(0) > try(system("convert tmp/6uxvs1493154302.ps tmp/6uxvs1493154302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.502 0.468 5.819