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(89.56,89.84,89.97,90.65,91.17,91.35,91.41,91.55,91.63,91.54,91.74,91.87,92.13,92.14,92.05,92,92.51,92.67,92.68,92.77,92.85,92.71,92.73,92.28,92.49,92.46,92.55,92.24,92.41,92.83,92.85,93.04,93.04,92.83,92.96,92.83,93.01,93.21,93.58,94.07,94.57,95.03,95.21,95.89,96.43,96.35,96.71,96.32,97.23,97.88,98.2,98.56,99.31,99.69,99.77,101.06,101.77,101.91,102.52,102.09,102.22,102.74,103.56,104.4,104.76,104.86,104.84,104.96,104.83,104.58,104.8,104.17) > 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,] 89.56 92.13 92.49 93.01 97.23 102.22 NA [2,] 89.84 92.14 92.46 93.21 97.88 102.74 NA [3,] 89.97 92.05 92.55 93.58 98.20 103.56 NA [4,] 90.65 92.00 92.24 94.07 98.56 104.40 NA [5,] 91.17 92.51 92.41 94.57 99.31 104.76 NA [6,] 91.35 92.67 92.83 95.03 99.69 104.86 NA [7,] 91.41 92.68 92.85 95.21 99.77 104.84 NA [8,] 91.55 92.77 93.04 95.89 101.06 104.96 NA [9,] 91.63 92.85 93.04 96.43 101.77 104.83 NA [10,] 91.54 92.71 92.83 96.35 101.91 104.58 NA [11,] 91.74 92.73 92.96 96.71 102.52 104.80 NA [12,] 91.87 92.28 92.83 96.32 102.09 104.17 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/1qmai1448204129.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/27fho1448204129.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/35bhv1448204129.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/4phz91448204129.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,] 89.56 89.840 89.970 90.650 91.17 91.35 91.41 91.550 91.630 91.54 [2,] 92.13 92.140 92.050 92.000 92.41 92.67 92.68 92.770 92.850 92.71 [3,] 92.75 92.835 93.065 93.155 93.54 93.93 94.03 94.465 94.735 94.59 [4,] 97.23 97.880 98.200 98.560 99.31 99.69 99.77 101.060 101.770 101.91 [5,] 102.22 102.740 103.560 104.400 104.76 104.86 104.84 104.960 104.830 104.58 [,11] [,12] [1,] 91.740 91.870 [2,] 92.730 92.280 [3,] 94.835 94.575 [4,] 102.520 102.090 [5,] 104.800 104.170 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 89.46034 89.13251 89.09805 88.92359 89.08928 89.40187 89.45672 89.11768 [2,] 96.03966 96.53749 97.03195 97.38641 97.99072 98.45813 98.60328 99.81232 [,9] [,10] [,11] [,12] [1,] 88.98131 88.6557 88.52013 88.24723 [2,] 100.48869 100.5243 101.14987 100.90277 $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(89.56, 92.13, 92.75, 97.23, 102.22, 89.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yaad1448204129.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,] 89.56 92.000 92.240 93.010 97.23 102.740 NA [2,] 90.31 92.135 92.475 93.825 98.38 103.865 NA [3,] 91.38 92.590 92.830 95.120 99.73 104.670 NA [4,] 91.59 92.720 92.905 96.335 101.84 104.835 NA [5,] 91.87 92.850 93.040 96.710 102.52 104.960 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.79618 92.32318 92.63387 93.97517 98.15187 104.2276 NA [2,] 91.96382 92.85682 93.02613 96.26483 101.30813 105.1124 NA $out [1] 102.22 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(89.56, 90.31, 91.38, 91.59, 91.87, 92, 92.135, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cggc1448204129.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,] 4.736329 12.300 3.95500 [2,] 5.102447 12.970 5.12375 [3,] 5.241089 13.305 5.86125 [4,] 5.374786 13.550 7.65875 [5,] 5.541985 13.750 8.28000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.116873 13.04046 4.705019 [2,] 5.365304 13.56954 7.017481 $out [1] 4.545556 $group [1] 1 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.73632945081596, 5.10244716256888, 5.24108856884768, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1qmai1448204129.ps tmp/1qmai1448204129.png",intern=TRUE)) character(0) > try(system("convert tmp/27fho1448204129.ps tmp/27fho1448204129.png",intern=TRUE)) character(0) > try(system("convert tmp/35bhv1448204129.ps tmp/35bhv1448204129.png",intern=TRUE)) character(0) > try(system("convert tmp/4phz91448204129.ps tmp/4phz91448204129.png",intern=TRUE)) character(0) > try(system("convert tmp/5yaad1448204129.ps tmp/5yaad1448204129.png",intern=TRUE)) character(0) > try(system("convert tmp/6cggc1448204129.ps tmp/6cggc1448204129.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.132 0.369 2.526