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(101.74,100.73,100.86,100.78,100.76,100.77,100.77,101.93,101.98,102.47,102.59,102.54,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] 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,] 101.74 102.54 104.03 100.15 101.43 101.81 NA [2,] 100.73 101.29 102.58 98.74 101.29 101.78 NA [3,] 100.86 101.49 102.65 98.74 101.33 101.93 NA [4,] 100.78 101.71 102.81 98.96 101.15 102.01 NA [5,] 100.76 101.98 102.98 99.34 101.25 102.03 NA [6,] 100.77 102.11 103.12 99.40 101.13 102.14 NA [7,] 100.77 102.11 103.12 99.50 101.07 101.81 NA [8,] 101.93 103.13 104.33 100.50 101.33 101.52 NA [9,] 101.98 103.43 104.41 100.77 101.61 101.38 NA [10,] 102.47 103.80 104.66 101.08 101.29 101.50 NA [11,] 102.59 103.99 104.81 101.39 101.39 101.65 NA [12,] 102.54 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/1rw0n1492784084.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/2cmz11492784084.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/3mdt21492784084.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/4ins01492784084.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.150 100.73 100.86 98.96 99.340 99.40 99.50 100.500 100.770 101.080 [2,] 101.430 100.73 100.86 100.78 100.760 100.77 100.77 101.330 101.380 101.290 [3,] 101.775 101.29 101.41 101.43 101.615 101.62 101.44 101.725 101.795 101.985 [4,] 102.540 101.78 101.93 102.01 102.030 102.14 102.11 103.130 103.430 103.800 [5,] 104.030 102.58 102.65 102.81 102.980 103.12 103.12 104.330 104.410 104.660 [,11] [,12] [1,] 101.39 101.43 [2,] 101.39 101.46 [3,] 102.12 102.09 [4,] 103.99 104.03 [5,] 104.81 104.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.059 100.6127 100.7198 100.6366 100.7958 100.7363 100.5757 100.5639 [2,] 102.491 101.9673 102.1002 102.2234 102.4342 102.5037 102.3043 102.8861 [,9] [,10] [,11] [,12] [1,] 100.4727 100.366 100.4429 100.4323 [2,] 103.1173 103.604 103.7971 103.7477 $out [1] 98.74 98.74 $group [1] 2 3 $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.775, 102.54, 104.03, 100.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55c0n1492784084.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,] 100.730 101.290 102.580 98.740 101.07 101.380 NA [2,] 100.770 101.845 102.895 99.150 101.20 101.580 NA [3,] 101.300 102.325 103.575 99.825 101.31 101.795 NA [4,] 102.225 103.615 104.535 100.925 101.41 101.970 NA [5,] 102.590 104.030 104.900 101.430 101.61 102.140 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.6364 101.5177 102.827 99.01541 101.2142 101.6171 NA [2,] 101.9636 103.1323 104.323 100.63459 101.4058 101.9729 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100.73, 100.77, 101.3, 102.225, 102.59, 101.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/648ll1492784084.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.244695 3.420 0.78750 [2,] 1.291263 3.600 0.95625 [3,] 1.326390 3.680 1.23125 [4,] 1.420315 3.845 1.87750 [5,] 1.476613 3.910 2.18500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.267529 3.568254 0.8110617 [2,] 1.385251 3.791746 1.6514383 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.24469541120174, 1.2912634980198, 1.32638972871993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rw0n1492784084.ps tmp/1rw0n1492784084.png",intern=TRUE)) character(0) > try(system("convert tmp/2cmz11492784084.ps tmp/2cmz11492784084.png",intern=TRUE)) character(0) > try(system("convert tmp/3mdt21492784084.ps tmp/3mdt21492784084.png",intern=TRUE)) character(0) > try(system("convert tmp/4ins01492784084.ps tmp/4ins01492784084.png",intern=TRUE)) character(0) > try(system("convert tmp/55c0n1492784084.ps tmp/55c0n1492784084.png",intern=TRUE)) character(0) > try(system("convert tmp/648ll1492784084.ps tmp/648ll1492784084.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.712 0.316 3.104