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(86.37,86.84,86.73,90.99,92.61,93.83,94.2,94.01,93.47,93.27,94.3,94.53,94.59,94.69,94.67,96.55,97.14,97.32,97.97,98.49,99.11,99.09,98.76,99.2,99.61,99.54,99.68,100.75,100.38,100.79,100.39,100.39,100.12,100,99.17,99.17,99.59,99.96,99.68,101.03,100.99,101.38,101.84,101.52,101.37,101.22,101.45,101.99,104.05,104.61,105.06,105.4,104.71,104.8,104.83,104.81,104.49,104.59,104.5,104.61) > 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,] 86.37 94.59 99.61 99.59 104.05 NA [2,] 86.84 94.69 99.54 99.96 104.61 NA [3,] 86.73 94.67 99.68 99.68 105.06 NA [4,] 90.99 96.55 100.75 101.03 105.40 NA [5,] 92.61 97.14 100.38 100.99 104.71 NA [6,] 93.83 97.32 100.79 101.38 104.80 NA [7,] 94.20 97.97 100.39 101.84 104.83 NA [8,] 94.01 98.49 100.39 101.52 104.81 NA [9,] 93.47 99.11 100.12 101.37 104.49 NA [10,] 93.27 99.09 100.00 101.22 104.59 NA [11,] 94.30 98.76 99.17 101.45 104.50 NA [12,] 94.53 99.20 99.17 101.99 104.61 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/11e4a1479639581.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/2pnd81479639581.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/35tut1479639581.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/4023p1479639581.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,] 94.59 86.84 94.67 90.99 92.61 93.83 94.20 94.01 99.11 99.09 [2,] 94.59 94.69 94.67 96.55 97.14 97.32 97.97 98.49 99.11 99.09 [3,] 99.59 99.54 99.68 100.75 100.38 100.79 100.39 100.39 100.12 100.00 [4,] 99.61 99.96 99.68 101.03 100.99 101.38 101.84 101.52 101.37 101.22 [5,] 104.05 104.61 105.06 105.40 104.71 104.80 104.83 104.81 104.49 101.22 [,11] [,12] [1,] 98.76 99.17 [2,] 98.76 99.17 [3,] 99.17 99.20 [4,] 101.45 101.99 [5,] 104.50 104.61 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.04288 95.81623 96.13995 97.58444 97.6596 97.92121 97.65547 [2,] 103.13712 103.26377 103.22005 103.91556 103.1004 103.65879 103.12453 [,8] [,9] [,10] [,11] [,12] [1,] 98.24901 98.52309 98.49495 97.26925 97.2074 [2,] 102.53099 101.71691 101.50505 101.07075 101.1926 $out [1] 86.37 86.73 93.47 93.27 104.59 94.30 94.53 $group [1] 1 3 9 10 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.59, 94.59, 99.59, 99.61, 104.05, 86.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51obj1479639581.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,] 86.370 94.590 99.170 99.590 104.490 NA [2,] 88.915 95.620 99.575 100.475 104.545 NA [3,] 93.370 97.645 100.060 101.295 104.660 NA [4,] 94.105 98.925 100.390 101.485 104.820 NA [5,] 94.530 99.200 100.790 101.990 105.060 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.00281 96.13757 99.68827 100.8343 104.5346 NA [2,] 95.73719 99.15243 100.43173 101.7557 104.7854 NA $out [1] 104.05 105.40 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(86.37, 88.915, 93.37, 94.105, 94.53, 94.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rqyi1479639581.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.755214 10.080 2.130 [2,] 4.002258 10.715 2.755 [3,] 4.155006 11.170 3.860 [4,] 6.088057 16.045 4.745 [5,] 6.893760 18.330 5.270 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.203659 8.738951 2.952348 [2,] 5.106353 13.601049 4.767652 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(3.75521370896518, 4.00225806937069, 4.15500628462289, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11e4a1479639581.ps tmp/11e4a1479639581.png",intern=TRUE)) character(0) > try(system("convert tmp/2pnd81479639581.ps tmp/2pnd81479639581.png",intern=TRUE)) character(0) > try(system("convert tmp/35tut1479639581.ps tmp/35tut1479639581.png",intern=TRUE)) character(0) > try(system("convert tmp/4023p1479639581.ps tmp/4023p1479639581.png",intern=TRUE)) character(0) > try(system("convert tmp/51obj1479639581.ps tmp/51obj1479639581.png",intern=TRUE)) character(0) > try(system("convert tmp/6rqyi1479639581.ps tmp/6rqyi1479639581.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.085 0.195 2.316