R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" 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(89.65,90.65,89.34,89.15,88.82,88.82,91.97,93.01,93.24,93.2,93.19,92.2,93.39,94.75,94.25,94.37,94.02,92.77,92.64,93.19,92.74,92.52,92.25,91.6,93.73,96.21,96.36,95.69,95.07,95.5,95.22,97.41,98.31,98.54,98.45,98.03,101.45,102.44,102.42,100.98,100.69,100.28,98.06,97.37,97.25,98.93,100.04,100.09,100.79,99.76,99.63,99.26,99.69,99.17,98.79,97.97,98.1,97.91,97.16,96.8,97.46,96.59,96.35,96.12,96.16,95.95,96.06,95.89,95.9,95.82,95.54,95.51) > 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.65 93.39 93.73 101.45 100.79 97.46 NA [2,] 90.65 94.75 96.21 102.44 99.76 96.59 NA [3,] 89.34 94.25 96.36 102.42 99.63 96.35 NA [4,] 89.15 94.37 95.69 100.98 99.26 96.12 NA [5,] 88.82 94.02 95.07 100.69 99.69 96.16 NA [6,] 88.82 92.77 95.50 100.28 99.17 95.95 NA [7,] 91.97 92.64 95.22 98.06 98.79 96.06 NA [8,] 93.01 93.19 97.41 97.37 97.97 95.89 NA [9,] 93.24 92.74 98.31 97.25 98.10 95.90 NA [10,] 93.20 92.52 98.54 98.93 97.91 95.82 NA [11,] 93.19 92.25 98.45 100.04 97.16 95.54 NA [12,] 92.20 91.60 98.03 100.09 96.80 95.51 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/14i9g1458493902.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/2hmgh1458493902.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/3iadm1458493902.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/44d101458493902.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.650 90.65 89.340 89.150 88.820 88.820 91.97 93.01 92.740 92.520 [2,] 93.390 94.75 94.250 94.370 94.020 92.770 92.64 93.19 93.240 93.200 [3,] 95.595 96.40 96.355 95.905 95.615 95.725 95.64 96.63 96.575 96.865 [4,] 100.790 99.76 99.630 99.260 99.690 99.170 98.06 97.41 98.100 98.540 [5,] 101.450 102.44 102.420 100.980 100.690 100.280 98.79 97.97 98.310 98.930 [,11] [,12] [1,] 92.25 91.600 [2,] 93.19 92.200 [3,] 96.35 96.155 [4,] 98.45 98.030 [5,] 100.04 100.090 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 90.82176 93.16839 92.88473 92.75079 91.95767 91.59679 92.14392 93.90796 [2,] 100.36824 99.63161 99.82527 99.05921 99.27233 99.85321 99.13608 99.35204 [,9] [,10] [,11] [,12] [1,] 93.44014 93.42053 92.95713 92.39446 [2,] 99.70986 100.30947 99.74287 99.91554 $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.65, 93.39, 95.595, 100.79, 101.45, 90.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vsqu1458493902.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,] 88.820 91.600 93.730 97.250 96.80 95.510 NA [2,] 89.245 92.580 95.360 98.495 97.94 95.855 NA [3,] 91.310 92.980 96.285 100.185 98.98 96.005 NA [4,] 93.100 94.135 98.170 101.215 99.66 96.255 NA [5,] 93.240 94.750 98.540 102.440 100.79 96.590 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.55171 92.27075 95.00334 98.94439 98.1955 95.82256 NA [2,] 93.06829 93.68925 97.56666 101.42561 99.7645 96.18744 NA $out [1] 97.46 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(88.82, 89.245, 91.31, 93.1, 93.24, 91.6, 92.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xjrk1458493902.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.207711 4.960 3.53500 [2,] 2.773540 6.615 3.91750 [3,] 3.695102 9.975 4.31250 [4,] 4.243986 11.815 4.61125 [5,] 4.626638 13.080 4.91250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3.024422 7.603245 3.996076 [2,] 4.365783 12.346755 4.628924 $out [1] 6.4825 $group [1] 3 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2.20771072984362, 2.77353950608536, 3.69510238246947, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14i9g1458493902.ps tmp/14i9g1458493902.png",intern=TRUE)) character(0) > try(system("convert tmp/2hmgh1458493902.ps tmp/2hmgh1458493902.png",intern=TRUE)) character(0) > try(system("convert tmp/3iadm1458493902.ps tmp/3iadm1458493902.png",intern=TRUE)) character(0) > try(system("convert tmp/44d101458493902.ps tmp/44d101458493902.png",intern=TRUE)) character(0) > try(system("convert tmp/5vsqu1458493902.ps tmp/5vsqu1458493902.png",intern=TRUE)) character(0) > try(system("convert tmp/6xjrk1458493902.ps tmp/6xjrk1458493902.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.102 0.428 2.554