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(85.95,86.41,86.42,86.81,86.71,86.7,87.07,86.96,87.04,87.5,88.32,88.56,88.92,89.56,90.21,90.42,91.23,91.73,92.21,91.65,91.8,91.63,91.09,90.89,90.98,91.29,90.77,90.96,90.89,90.72,90.66,90.94,90.7,90.74,90.98,91.13,91.54,91.93,92.27,92.59,92.96,92.95,92.99,93.05,93.34,93.47,93.59,93.96,94.49,95.04,95.52,95.75,96.07,96.37,96.48,96.4,96.66,96.81,97.19,97.23,97.94,98.52,98.73,98.8,98.77,98.54,98.72,99.15,99.32,99.5,99.39,99.4,99.37,99.69,99.83,99.79,99.94,100.11,100.21,100.15,100.21,100.13,100.2,100.36,100.5,100.66,100.72,100.41,100.3,100.38,100.55,100.17,100.09,100.22,100.09,99.98) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 85.95 88.92 90.98 91.54 94.49 97.94 99.37 100.50 NA [2,] 86.41 89.56 91.29 91.93 95.04 98.52 99.69 100.66 NA [3,] 86.42 90.21 90.77 92.27 95.52 98.73 99.83 100.72 NA [4,] 86.81 90.42 90.96 92.59 95.75 98.80 99.79 100.41 NA [5,] 86.71 91.23 90.89 92.96 96.07 98.77 99.94 100.30 NA [6,] 86.70 91.73 90.72 92.95 96.37 98.54 100.11 100.38 NA [7,] 87.07 92.21 90.66 92.99 96.48 98.72 100.21 100.55 NA [8,] 86.96 91.65 90.94 93.05 96.40 99.15 100.15 100.17 NA [9,] 87.04 91.80 90.70 93.34 96.66 99.32 100.21 100.09 NA [10,] 87.50 91.63 90.74 93.47 96.81 99.50 100.13 100.22 NA [11,] 88.32 91.09 90.98 93.59 97.19 99.39 100.20 100.09 NA [12,] 88.56 90.89 91.13 93.96 97.23 99.40 100.36 99.98 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/153f21448194064.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/2yz0d1448194064.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/387s11448194064.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/4x59t1448194064.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,] 85.950 86.410 86.420 86.810 86.710 86.700 87.070 86.960 87.040 [2,] 89.950 90.425 90.490 90.690 91.060 91.225 91.435 91.295 91.250 [3,] 93.015 93.485 93.895 94.170 94.515 94.660 94.735 94.725 95.000 [4,] 98.655 99.105 99.280 99.295 99.355 99.325 99.465 99.650 99.705 [5,] 100.500 100.660 100.720 100.410 100.300 100.380 100.550 100.170 100.210 [,10] [,11] [,12] [1,] 87.500 88.320 88.560 [2,] 91.185 91.035 91.010 [3,] 95.140 95.390 95.595 [4,] 99.815 99.740 99.690 [5,] 100.220 100.200 100.360 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 88.15226 88.63623 88.98478 89.36312 89.88129 90.13522 90.24933 90.05778 [2,] 97.87774 98.33377 98.80522 98.97688 99.14871 99.18478 99.22067 99.39222 [,9] [,10] [,11] [,12] [1,] 90.27692 90.31916 90.52726 90.74623 [2,] 99.72308 99.96084 100.25274 100.44377 $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(85.95, 89.95, 93.015, 98.655, 100.5, 86.41, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/527hs1448194064.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] [,8] [,9] [1,] 85.950 88.920 90.660 91.540 94.490 97.940 99.370 99.980 NA [2,] 86.560 90.315 90.730 92.430 95.635 98.630 99.810 100.130 NA [3,] 86.885 91.160 90.915 92.975 96.385 98.785 100.120 100.340 NA [4,] 87.285 91.690 90.980 93.405 96.735 99.355 100.205 100.525 NA [5,] 88.320 92.210 91.290 93.960 97.230 99.500 100.360 100.720 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 86.55432 90.53285 90.80097 92.5303 95.88328 98.45432 99.93984 100.1598 [2,] 87.21568 91.78715 91.02903 93.4197 96.88672 99.11568 100.30016 100.5202 [,9] [1,] NA [2,] NA $out [1] 88.56 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(85.95, 86.56, 86.885, 87.285, 88.32, 88.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sfdl1448194064.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.659891 11.800 7.27000 [2,] 4.873759 12.945 7.87500 [3,] 4.926932 13.535 7.97125 [4,] 5.083872 13.965 8.31250 [5,] 5.236745 14.550 8.50250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.831098 13.06977 7.771703 [2,] 5.022766 14.00023 8.170797 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.65989097818516, 4.8737585755013, 4.92693232354721, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/153f21448194064.ps tmp/153f21448194064.png",intern=TRUE)) character(0) > try(system("convert tmp/2yz0d1448194064.ps tmp/2yz0d1448194064.png",intern=TRUE)) character(0) > try(system("convert tmp/387s11448194064.ps tmp/387s11448194064.png",intern=TRUE)) character(0) > try(system("convert tmp/4x59t1448194064.ps tmp/4x59t1448194064.png",intern=TRUE)) character(0) > try(system("convert tmp/527hs1448194064.ps tmp/527hs1448194064.png",intern=TRUE)) character(0) > try(system("convert tmp/6sfdl1448194064.ps tmp/6sfdl1448194064.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.179 0.412 2.596