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(95.83,95.87,96.06,96.06,96.15,96.26,96.28,96.36,96.38,96.43,96.47,96.55,96.71,96.87,96.99,97.1,97.26,97.31,97.33,97.33,97.45,97.61,97.59,97.6,97.96,98.36,98.36,98.51,98.77,98.78,98.89,98.86,99.04,99.09,99.1,99.12,99.37,99.46,99.6,99.88,99.88,100.01,100.02,100.19,100.2,100.35,100.47,100.58,101.4,101.67,101.82,101.85,101.98,102.06,102.16,102.2,102.35,102.47,102.55,102.62,102.8,102.87,102.94,102.95,102.94,103.05,103.09,103.1,103.13,103.19,103.36,103.42) > 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,] 95.83 96.71 97.96 99.37 101.40 102.80 NA [2,] 95.87 96.87 98.36 99.46 101.67 102.87 NA [3,] 96.06 96.99 98.36 99.60 101.82 102.94 NA [4,] 96.06 97.10 98.51 99.88 101.85 102.95 NA [5,] 96.15 97.26 98.77 99.88 101.98 102.94 NA [6,] 96.26 97.31 98.78 100.01 102.06 103.05 NA [7,] 96.28 97.33 98.89 100.02 102.16 103.09 NA [8,] 96.36 97.33 98.86 100.19 102.20 103.10 NA [9,] 96.38 97.45 99.04 100.20 102.35 103.13 NA [10,] 96.43 97.61 99.09 100.35 102.47 103.19 NA [11,] 96.47 97.59 99.10 100.47 102.55 103.36 NA [12,] 96.55 97.60 99.12 100.58 102.62 103.42 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/1e5ng1479579211.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/26vuv1479579211.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/3mvb21479579211.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/4tfqp1479579211.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,] 95.830 95.87 96.06 96.060 96.150 96.260 96.280 96.360 96.38 [2,] 96.710 96.87 96.99 97.100 97.260 97.310 97.330 97.330 97.45 [3,] 98.665 98.91 98.98 99.195 99.325 99.395 99.455 99.525 99.62 [4,] 101.400 101.67 101.82 101.850 101.980 102.060 102.160 102.200 102.35 [5,] 102.800 102.87 102.94 102.950 102.940 103.050 103.090 103.100 103.13 [,10] [,11] [,12] [1,] 96.43 96.470 96.55 [2,] 97.61 97.590 97.60 [3,] 99.72 99.785 99.85 [4,] 102.47 102.550 102.62 [5,] 103.19 103.360 103.42 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.6398 95.81384 95.86449 96.1311 96.28045 96.3311 96.33949 [2,] 101.6902 102.00616 102.09551 102.2589 102.36955 102.4589 102.57051 [,8] [,9] [,10] [,11] [,12] [1,] 96.38369 96.45934 96.58514 96.58564 96.61194 [2,] 102.66631 102.78066 102.85486 102.98436 103.08806 $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(95.83, 96.71, 98.665, 101.4, 102.8, 95.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mppa1479579211.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,] 95.830 96.710 97.960 99.370 101.400 102.80 NA [2,] 96.060 97.045 98.435 99.740 101.835 102.94 NA [3,] 96.270 97.320 98.820 100.015 102.110 103.07 NA [4,] 96.405 97.520 99.065 100.275 102.410 103.16 NA [5,] 96.550 97.610 99.120 100.580 102.620 103.42 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.11264 97.10335 98.53265 99.77098 101.8477 102.9697 NA [2,] 96.42736 97.53665 99.10735 100.25902 102.3723 103.1703 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(95.83, 96.06, 96.27, 96.405, 96.55, 96.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61fsy1479579211.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,] 2.642019 6.740 3.81750 [2,] 2.665735 6.775 3.87250 [3,] 2.676874 6.840 3.91875 [4,] 2.712374 6.890 3.97500 [5,] 2.732474 7.000 4.06250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.655601 6.787548 3.871999 [2,] 2.698146 6.892452 3.965501 $out [1] 4.13 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.64201942965351, 2.66573472087411, 2.67687384488573, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e5ng1479579211.ps tmp/1e5ng1479579211.png",intern=TRUE)) character(0) > try(system("convert tmp/26vuv1479579211.ps tmp/26vuv1479579211.png",intern=TRUE)) character(0) > try(system("convert tmp/3mvb21479579211.ps tmp/3mvb21479579211.png",intern=TRUE)) character(0) > try(system("convert tmp/4tfqp1479579211.ps tmp/4tfqp1479579211.png",intern=TRUE)) character(0) > try(system("convert tmp/5mppa1479579211.ps tmp/5mppa1479579211.png",intern=TRUE)) character(0) > try(system("convert tmp/61fsy1479579211.ps tmp/61fsy1479579211.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.302 0.186 2.538