R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(11,13,15,29,31,22,36,39,30,20,18,13,11,16,20,29,31,24,40,41,25,19,19,18,10,17,25,30,32,24,38,36,26,25,26,16,12,15,21,33,32,24,41,38,28,24,30,18) > 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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 11 11 10 12 NA [2,] 13 16 17 15 NA [3,] 15 20 25 21 NA [4,] 29 29 30 33 NA [5,] 31 31 32 32 NA [6,] 22 24 24 24 NA [7,] 36 40 38 41 NA [8,] 39 41 36 38 NA [9,] 30 25 26 28 NA [10,] 20 19 25 24 NA [11,] 18 19 26 30 NA [12,] 13 18 16 18 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/16kdr1479553782.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/2wdzp1479553782.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/3yj9c1479553782.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/4473x1479553782.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,] 10.0 13.0 15.0 29.0 31.0 22 36.0 36.0 25.0 19.0 18.0 13.0 [2,] 10.5 14.0 17.5 29.0 31.0 23 37.0 37.0 25.5 19.5 18.5 14.5 [3,] 11.0 15.5 20.5 29.5 31.5 24 39.0 38.5 27.0 22.0 22.5 17.0 [4,] 11.5 16.5 23.0 31.5 32.0 24 40.5 40.0 29.0 24.5 28.0 18.0 [5,] 12.0 17.0 25.0 33.0 32.0 24 41.0 41.0 30.0 25.0 30.0 18.0 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 10.21 13.525 16.155 27.525 30.71 23.21 36.235 36.13 24.235 18.05 14.995 [2,] 11.79 17.475 24.845 31.475 32.29 24.79 41.765 40.87 29.765 25.95 30.005 [,12] [1,] 14.235 [2,] 19.765 $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(10, 10.5, 11, 11.5, 12, 13, 14, 15.5, 16.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zmk51479553782.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] [1,] 11.0 11.0 10.0 12.0 NA [2,] 14.0 18.5 20.5 19.5 NA [3,] 21.0 22.0 25.5 26.0 NA [4,] 30.5 30.0 31.0 32.5 NA [5,] 39.0 41.0 38.0 41.0 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 13.47424 16.75477 20.71088 20.07061 NA [2,] 28.52576 27.24523 30.28912 31.92939 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(11, 14, 21, 30.5, 39, 11, 18.5, 22, 30, 41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vfpx1479553782.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.5773503 1.0 0.500 [2,] 1.3539126 3.0 1.375 [3,] 2.1495109 5.0 2.375 [4,] 2.6534141 5.5 3.000 [5,] 4.1129876 6.0 4.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.556800 3.859733 1.633827 [2,] 2.742222 6.140267 3.116173 $out [1] 5.737305 10.000000 12.000000 8.250000 $group [1] 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(0.577350269189626, 1.35391256382997, 2.14951089103724, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16kdr1479553782.ps tmp/16kdr1479553782.png",intern=TRUE)) character(0) > try(system("convert tmp/2wdzp1479553782.ps tmp/2wdzp1479553782.png",intern=TRUE)) character(0) > try(system("convert tmp/3yj9c1479553782.ps tmp/3yj9c1479553782.png",intern=TRUE)) character(0) > try(system("convert tmp/4473x1479553782.ps tmp/4473x1479553782.png",intern=TRUE)) character(0) > try(system("convert tmp/5zmk51479553782.ps tmp/5zmk51479553782.png",intern=TRUE)) character(0) > try(system("convert tmp/6vfpx1479553782.ps tmp/6vfpx1479553782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.089 0.176 2.296