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(92.82,92.82,92.88,93.38,93.89,94.1,94.18,94.3,94.31,94.36,94.38,94.38,94.5,94.57,94.89,96.71,97.57,97.88,97.97,98.4,98.51,98.46,98.46,98.48,98.6,98.6,98.71,99.13,99.2,99.3,100.18,101.37,101.77,102.28,102.38,102.35,103.23,105.37,106.62,107,107.24,107.31,107.35,107.42,107.58,107.64,107.64,107.68,108.51,110.37,111.31,111.57,111.66,111.69,111.9,111.95,112.04,112.13,112.14,112.13,113.59,115.03,115.7,116.1,116.12,116.32,116.51,116.63,116.92,116.96,117.15) > 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] 71 > (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] 6 6 6 6 6 6 6 6 6 6 6 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.82 94.50 98.60 103.23 108.51 113.59 [2,] 92.82 94.57 98.60 105.37 110.37 115.03 [3,] 92.88 94.89 98.71 106.62 111.31 115.70 [4,] 93.38 96.71 99.13 107.00 111.57 116.10 [5,] 93.89 97.57 99.20 107.24 111.66 116.12 [6,] 94.10 97.88 99.30 107.31 111.69 116.32 [7,] 94.18 97.97 100.18 107.35 111.90 116.51 [8,] 94.30 98.40 101.37 107.42 111.95 116.63 [9,] 94.31 98.51 101.77 107.58 112.04 116.92 [10,] 94.36 98.46 102.28 107.64 112.13 116.96 [11,] 94.38 98.46 102.38 107.64 112.14 117.15 [12,] 94.38 98.48 102.35 107.68 112.13 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/1h1of1493146612.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/2x8r31493146612.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/3nfsy1493146612.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/475ao1493146612.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] [1,] 92.820 92.820 92.880 93.380 93.89 94.100 94.180 94.300 94.310 [2,] 94.500 94.570 94.890 96.710 97.57 97.880 97.970 98.400 98.510 [3,] 100.915 101.985 102.665 103.065 103.22 103.305 103.765 104.395 104.675 [4,] 108.510 110.370 111.310 111.570 111.66 111.690 111.900 111.950 112.040 [5,] 113.590 115.030 115.700 116.100 116.12 116.320 116.510 116.630 116.920 [,10] [,11] [,12] [1,] 94.36 94.38 94.38 [2,] 98.46 98.46 98.48 [3,] 104.96 105.01 102.35 [4,] 112.13 112.14 107.68 [5,] 116.96 117.15 112.13 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.8781 91.79349 92.07357 93.47982 94.13149 94.3971 94.7797 [2,] 109.9519 112.17651 113.25643 112.65018 112.30851 112.2129 112.7503 [,8] [,9] [,10] [,11] [,12] [1,] 95.65481 95.94771 96.14241 96.18596 95.8493 [2,] 113.13519 113.40229 113.77759 113.83404 108.8507 $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(92.82, 94.5, 100.915, 108.51, 113.59, 92.82, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56eur1493146612.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,] 92.820 94.500 98.600 106.62 111.310 115.030 [2,] 93.130 95.800 98.920 106.81 111.440 115.900 [3,] 94.140 97.925 99.740 107.33 111.795 116.320 [4,] 94.335 98.460 102.025 107.61 112.085 116.775 [5,] 94.380 98.510 102.380 107.68 112.140 117.150 $n [1] 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 93.59039 96.71176 98.32379 106.9651 111.5008 115.9032 [2,] 94.68961 99.13824 101.15621 107.6949 112.0892 116.7368 $out [1] 103.23 105.37 108.51 110.37 113.59 $group [1] 4 4 5 5 6 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.82, 93.13, 94.14, 94.335, 94.38, 94.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65nwt1493146612.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,] 8.126620 22.210 11.57500 [2,] 8.510630 22.215 11.59625 [3,] 8.613553 22.330 11.95750 [4,] 8.834960 22.665 12.84500 [5,] 9.266057 22.820 14.29250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 8.465624 22.12475 11.38794 [2,] 8.761482 22.53525 12.52706 $out [1] 7.078427 20.770000 17.750000 9.200000 $group [1] 1 2 2 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8.12661983853066, 8.51063023142793, 8.61355309559081, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1h1of1493146612.ps tmp/1h1of1493146612.png",intern=TRUE)) character(0) > try(system("convert tmp/2x8r31493146612.ps tmp/2x8r31493146612.png",intern=TRUE)) character(0) > try(system("convert tmp/3nfsy1493146612.ps tmp/3nfsy1493146612.png",intern=TRUE)) character(0) > try(system("convert tmp/475ao1493146612.ps tmp/475ao1493146612.png",intern=TRUE)) character(0) > try(system("convert tmp/56eur1493146612.ps tmp/56eur1493146612.png",intern=TRUE)) character(0) > try(system("convert tmp/65nwt1493146612.ps tmp/65nwt1493146612.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.685 0.352 3.095