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(102.54,101.29,101.49,101.71,101.98,102.11,102.11,103.13,103.43,103.8,103.99,104.03,104.03,102.58,102.65,102.81,102.98,103.12,103.12,104.33,104.41,104.66,104.81,104.9,100.15,98.74,98.74,98.96,99.34,99.4,99.5,100.5,100.77,101.08,101.39,101.43,101.43,101.29,101.33,101.15,101.25,101.13,101.07,101.33,101.61,101.29,101.39,101.46,101.81,101.78,101.93,102.01,102.03,102.14,101.81,101.52,101.38,101.5,101.65,101.64) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 102.54 104.03 100.15 101.43 101.81 NA [2,] 101.29 102.58 98.74 101.29 101.78 NA [3,] 101.49 102.65 98.74 101.33 101.93 NA [4,] 101.71 102.81 98.96 101.15 102.01 NA [5,] 101.98 102.98 99.34 101.25 102.03 NA [6,] 102.11 103.12 99.40 101.13 102.14 NA [7,] 102.11 103.12 99.50 101.07 101.81 NA [8,] 103.13 104.33 100.50 101.33 101.52 NA [9,] 103.43 104.41 100.77 101.61 101.38 NA [10,] 103.80 104.66 101.08 101.29 101.50 NA [11,] 103.99 104.81 101.39 101.39 101.65 NA [12,] 104.03 104.90 101.43 101.46 101.64 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/19byt1479568302.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/2xpns1479568302.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/31o6u1479568302.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/4f7qh1479568302.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] [1,] 100.15 101.29 101.33 101.15 101.25 101.13 101.07 100.50 100.77 101.08 [2,] 101.43 101.29 101.33 101.15 101.25 101.13 101.07 101.33 101.38 101.29 [3,] 101.81 101.29 101.49 101.71 101.98 102.11 101.81 101.52 101.61 101.50 [4,] 102.54 101.78 101.93 102.01 102.03 102.14 102.11 103.13 103.43 103.80 [5,] 104.03 101.78 102.65 102.81 102.98 103.12 103.12 104.33 104.41 104.66 [,11] [,12] [1,] 101.39 101.43 [2,] 101.39 101.46 [3,] 101.65 101.64 [4,] 103.99 104.03 [5,] 104.81 104.90 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.0257 100.9438 101.066 101.1023 101.4289 101.3963 101.0751 100.2481 [2,] 102.5943 101.6362 101.914 102.3177 102.5311 102.8237 102.5449 102.7919 [,9] [,10] [,11] [,12] [1,] 100.1615 99.72644 99.81285 99.82404 [2,] 103.0585 103.27356 103.48715 103.45596 $out [1] 102.58 98.74 98.74 98.96 99.34 99.40 99.50 $group [1] 2 2 3 4 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(100.15, 101.43, 101.81, 102.54, 104.03, 101.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gpll1479568302.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] [1,] 101.290 102.580 98.740 101.07 101.380 NA [2,] 101.845 102.895 99.150 101.20 101.580 NA [3,] 102.325 103.575 99.825 101.31 101.795 NA [4,] 103.615 104.535 100.925 101.41 101.970 NA [5,] 104.030 104.900 101.430 101.61 102.140 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 101.5177 102.827 99.01541 101.2142 101.6171 NA [2,] 103.1323 104.323 100.63459 101.4058 101.9729 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(101.29, 101.845, 102.325, 103.615, 104.03, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6or811479568302.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,] 1.348618 3.420 0.490 [2,] 1.419309 3.600 0.820 [3,] 1.467519 3.680 1.075 [4,] 1.586043 3.845 2.280 [5,] 1.649445 3.910 2.600 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.391471 3.568254 0.4090842 [2,] 1.543568 3.791746 1.7409158 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.34861781094571, 1.41930923152802, 1.46751942849325, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19byt1479568302.ps tmp/19byt1479568302.png",intern=TRUE)) character(0) > try(system("convert tmp/2xpns1479568302.ps tmp/2xpns1479568302.png",intern=TRUE)) character(0) > try(system("convert tmp/31o6u1479568302.ps tmp/31o6u1479568302.png",intern=TRUE)) character(0) > try(system("convert tmp/4f7qh1479568302.ps tmp/4f7qh1479568302.png",intern=TRUE)) character(0) > try(system("convert tmp/5gpll1479568302.ps tmp/5gpll1479568302.png",intern=TRUE)) character(0) > try(system("convert tmp/6or811479568302.ps tmp/6or811479568302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.112 0.152 2.307