R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(98.71,100.46,100.46,100.67,100.01,100.01,99.99,99.98,99.87,99.91,96.59,96.99,96.68,96.57,96.55,96.78,95.99,97.54,97.45,97.58,97.66,97.67,97.71,98.52,98.87,97.91,97.92,97.97,97.97,97.97,97.58,97.57,96.7,96.72,96.72,96.74,101.2,100.59,100.58,99.62,99.63,99.17,99.17,98.99,98.92,99.52,99.45,99.04,99.23,98.71,98.73,97.1,100.94,100.93,101.02,101.01,100.86,100.56,100.75,100.15,99.49,99.15,99.15,99.14,98.77,98.8,99.29,98.38,98.31,98.24,96.99,96.81) > 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,] 98.71 96.68 98.87 101.20 99.23 99.49 NA [2,] 100.46 96.57 97.91 100.59 98.71 99.15 NA [3,] 100.46 96.55 97.92 100.58 98.73 99.15 NA [4,] 100.67 96.78 97.97 99.62 97.10 99.14 NA [5,] 100.01 95.99 97.97 99.63 100.94 98.77 NA [6,] 100.01 97.54 97.97 99.17 100.93 98.80 NA [7,] 99.99 97.45 97.58 99.17 101.02 99.29 NA [8,] 99.98 97.58 97.57 98.99 101.01 98.38 NA [9,] 99.87 97.66 96.70 98.92 100.86 98.31 NA [10,] 99.91 97.67 96.72 99.52 100.56 98.24 NA [11,] 96.59 97.71 96.72 99.45 100.75 96.99 NA [12,] 96.99 98.52 96.74 99.04 100.15 96.81 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/1px961448206323.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/2ehot1448206323.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/3cmfz1448206323.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/4n9jt1448206323.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,] 98.71 96.57 96.55 96.780 95.99 97.540 97.45 97.570 96.700 96.72 [2,] 98.71 97.91 97.92 97.100 97.97 97.970 97.58 97.580 97.660 97.67 [3,] 99.05 98.93 98.94 98.555 99.20 98.985 99.23 98.685 98.615 98.88 [4,] 99.49 100.46 100.46 99.620 100.01 100.010 99.99 99.980 99.870 99.91 [5,] 99.49 100.59 100.58 100.670 100.94 100.930 101.02 101.010 100.860 100.56 [,11] [,12] [1,] 96.59 96.740 [2,] 96.72 96.810 [3,] 97.35 97.755 [4,] 99.45 99.040 [5,] 100.75 100.150 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.54687 97.28517 97.30162 96.92952 97.88413 97.66913 97.67547 [2,] 99.55313 100.57483 100.57838 100.18048 100.51587 100.30087 100.78453 [,8] [,9] [,10] [,11] [,12] [1,] 97.13692 97.18948 97.43513 95.58906 96.31658 [2,] 100.23308 100.04052 100.32487 99.11094 99.19342 $out [1] 96.68 101.20 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.71, 98.71, 99.05, 99.49, 99.49, 96.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s5lq1448206323.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,] 98.710 95.990 96.700 98.920 97.100 96.990 NA [2,] 99.290 96.625 96.730 99.105 98.980 98.275 NA [3,] 99.985 97.495 97.745 99.485 100.655 98.785 NA [4,] 100.235 97.665 97.970 100.105 100.935 99.150 NA [5,] 100.670 98.520 98.870 101.200 101.020 99.490 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99.55398 97.02065 97.17943 99.02889 99.76331 98.38591 NA [2,] 100.41602 97.96935 98.31057 99.94111 101.54669 99.18409 NA $out [1] 96.59 96.99 96.81 $group [1] 1 1 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.71, 99.29, 99.985, 100.235, 100.67, 95.99, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/612qb1448206323.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.263091 3.390 1.62250 [2,] 1.397719 3.505 1.77750 [3,] 1.485608 3.955 1.97625 [4,] 1.537126 4.160 2.03875 [5,] 1.696370 4.950 2.22750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.422024 3.65625 1.857092 [2,] 1.549193 4.25375 2.095408 $out [1] 1.747864 0.675000 $group [1] 1 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1.26309144562063, 1.3977185410973, 1.48560815477571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1px961448206323.ps tmp/1px961448206323.png",intern=TRUE)) character(0) > try(system("convert tmp/2ehot1448206323.ps tmp/2ehot1448206323.png",intern=TRUE)) character(0) > try(system("convert tmp/3cmfz1448206323.ps tmp/3cmfz1448206323.png",intern=TRUE)) character(0) > try(system("convert tmp/4n9jt1448206323.ps tmp/4n9jt1448206323.png",intern=TRUE)) character(0) > try(system("convert tmp/5s5lq1448206323.ps tmp/5s5lq1448206323.png",intern=TRUE)) character(0) > try(system("convert tmp/612qb1448206323.ps tmp/612qb1448206323.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.079 0.369 2.470