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.74,86.62,86.66,87.39,87.59,88.8,88.64,89.55,89.04,88.49,89.5,89.46,90.33,90.27,91.5,92.53,93.14,93.01,92.84,92.88,93.05,93.17,93.67,94.9,95.72,96.08,97.52,98.26,98.48,98.09,98.03,98.14,98.71,98.69,98.72,98.47,99.49,99.84,100.9,101.31,100.09,99.28,99.57,101.04,101.87,101.39,100.3,99.95,99.87,100.51,100.27,100.04,99.23,99.32,99.95,100.23,101.02,99.83,99.61,100.12,99.83,100.03,100.07,100.46,100.43,100.68,101.8,101.21,100.63,100.55,99.76,98.8) > 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,] 85.74 90.33 95.72 99.49 99.87 99.83 NA [2,] 86.62 90.27 96.08 99.84 100.51 100.03 NA [3,] 86.66 91.50 97.52 100.90 100.27 100.07 NA [4,] 87.39 92.53 98.26 101.31 100.04 100.46 NA [5,] 87.59 93.14 98.48 100.09 99.23 100.43 NA [6,] 88.80 93.01 98.09 99.28 99.32 100.68 NA [7,] 88.64 92.84 98.03 99.57 99.95 101.80 NA [8,] 89.55 92.88 98.14 101.04 100.23 101.21 NA [9,] 89.04 93.05 98.71 101.87 101.02 100.63 NA [10,] 88.49 93.17 98.69 101.39 99.83 100.55 NA [11,] 89.50 93.67 98.72 100.30 99.61 99.76 NA [12,] 89.46 94.90 98.47 99.95 100.12 98.80 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/1gu7f1447699371.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/2l1yb1447699371.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/36f4u1447699371.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/49rhm1447699371.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,] 85.740 86.62 86.660 87.39 87.590 88.800 88.64 89.550 89.04 88.49 [2,] 90.330 90.27 91.500 92.53 93.140 93.010 92.84 92.880 93.05 93.17 [3,] 97.605 97.96 98.795 99.15 98.855 98.685 98.80 99.185 99.67 99.26 [4,] 99.830 100.03 100.270 100.46 100.090 99.320 99.95 101.040 101.02 100.55 [5,] 99.870 100.51 100.900 101.31 100.430 100.680 101.80 101.210 101.87 101.39 [,11] [,12] [1,] 89.500 89.460 [2,] 93.670 94.900 [3,] 99.165 98.635 [4,] 99.760 99.950 [5,] 100.300 100.120 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.47719 91.66448 93.13807 94.03489 94.37203 94.61485 94.21382 [2,] 103.73281 104.25552 104.45193 104.26511 103.33797 102.75515 103.38618 [,8] [,9] [,10] [,11] [,12] [1,] 93.92154 94.52909 94.49966 95.23675 95.37759 [2,] 104.44846 104.81091 104.02034 103.09325 101.89241 $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.74, 90.33, 97.605, 99.83, 99.87, 86.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56zlz1447699371.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,] 85.740 90.330 97.520 99.280 99.230 99.760 NA [2,] 87.025 92.015 97.775 99.705 99.720 99.930 NA [3,] 88.565 92.945 98.200 100.195 99.995 100.445 NA [4,] 89.250 93.155 98.585 101.175 100.250 100.655 NA [5,] 89.550 93.670 98.720 101.870 101.020 101.210 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 87.55016 92.42504 97.83055 99.52452 99.75326 100.1143 NA [2,] 89.57984 93.46496 98.56945 100.86548 100.23674 100.7757 NA $out [1] 90.27 94.90 95.72 96.08 101.80 98.80 $group [1] 2 2 3 3 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(85.74, 87.025, 88.565, 89.25, 89.55, 90.33, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m69u1447699371.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.125152 10.660 3.87000 [2,] 4.744310 11.770 5.21500 [3,] 5.101075 12.870 6.10625 [4,] 5.668458 13.905 6.92875 [5,] 5.918120 14.240 8.26000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4.679565 11.89621 5.324597 [2,] 5.522585 13.84379 6.887903 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(4.12515211840727, 4.74431000349526, 5.10107473662391, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gu7f1447699371.ps tmp/1gu7f1447699371.png",intern=TRUE)) character(0) > try(system("convert tmp/2l1yb1447699371.ps tmp/2l1yb1447699371.png",intern=TRUE)) character(0) > try(system("convert tmp/36f4u1447699371.ps tmp/36f4u1447699371.png",intern=TRUE)) character(0) > try(system("convert tmp/49rhm1447699371.ps tmp/49rhm1447699371.png",intern=TRUE)) character(0) > try(system("convert tmp/56zlz1447699371.ps tmp/56zlz1447699371.png",intern=TRUE)) character(0) > try(system("convert tmp/6m69u1447699371.ps tmp/6m69u1447699371.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.232 0.435 2.686