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(62239.3,64816.6,62625.3,67923,64363.7,67342,64411.2,69174.5,66290.2,69336.8,66712.2,72225.9,68229.5,71096.3,68407.9,74522.4,71798.4,75074.3,72694.6,78789.4,74814.5,78303.2,75431.6,82600.7,78830.5,82168.1,79493.2,86876.6,83478.5,87003.2,83672.7,90914.2,86448,90577.7,86621.1,91418.5,84275.4,87677.9,85149.6,92600,87111.3,92293.9,89060,97281.6,91812,95980.4,92043.7,100079.2,94384.8,97900.5,93630.8,102255.2,95251.8,100001.8,95689.8,104298,97435.1,101220.2,97537,105834.9) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 62239.3 68229.5 78830.5 84275.4 94384.8 NA [2,] 64816.6 71096.3 82168.1 87677.9 97900.5 NA [3,] 62625.3 68407.9 79493.2 85149.6 93630.8 NA [4,] 67923.0 74522.4 86876.6 92600.0 102255.2 NA [5,] 64363.7 71798.4 83478.5 87111.3 95251.8 NA [6,] 67342.0 75074.3 87003.2 92293.9 100001.8 NA [7,] 64411.2 72694.6 83672.7 89060.0 95689.8 NA [8,] 69174.5 78789.4 90914.2 97281.6 104298.0 NA [9,] 66290.2 74814.5 86448.0 91812.0 97435.1 NA [10,] 69336.8 78303.2 90577.7 95980.4 101220.2 NA [11,] 66712.2 75431.6 86621.1 92043.7 97537.0 NA [12,] 72225.9 82600.7 91418.5 100079.2 105834.9 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/1g7cz1448542878.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/2m5b91448542878.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/3c2v21448542878.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/4mj461448542878.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,] 62239.3 64816.6 62625.3 67923.0 64363.7 67342.0 64411.2 69174.5 66290.2 [2,] 68229.5 71096.3 68407.9 74522.4 71798.4 75074.3 72694.6 78789.4 74814.5 [3,] 78830.5 82168.1 79493.2 86876.6 83478.5 87003.2 83672.7 90914.2 86448.0 [4,] 84275.4 87677.9 85149.6 92600.0 87111.3 92293.9 89060.0 97281.6 91812.0 [5,] 94384.8 97900.5 93630.8 102255.2 95251.8 100001.8 95689.8 104298.0 97435.1 [,10] [,11] [,12] [1,] 69336.8 66712.2 72225.9 [2,] 78303.2 75431.6 82600.7 [3,] 90577.7 86621.1 91418.5 [4,] 95980.4 92043.7 100079.2 [5,] 101220.2 97537.0 105834.9 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67492.51 70451.58 67663.56 74103.01 72658.44 74835.87 72108.95 77847.66 [2,] 90168.49 93884.62 91322.84 99650.19 94298.56 99170.53 95236.45 103980.74 [,9] [,10] [,11] [,12] [1,] 74437.61 78087.04 74883.03 79068.24 [2,] 98458.39 103068.36 98359.17 103768.76 $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(62239.3, 68229.5, 78830.5, 84275.4, 94384.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eisz1448542878.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] [1,] 62239.30 68229.50 78830.50 84275.40 93630.80 NA [2,] 64387.45 71447.35 82823.30 87394.60 95470.80 NA [3,] 66501.20 74668.45 86534.55 91927.85 97718.75 NA [4,] 68548.75 76867.40 88790.45 94290.20 101737.70 NA [5,] 72225.90 82600.70 91418.50 100079.20 105834.90 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 64603.2 72196.33 83812.89 88782.72 94860.37 NA [2,] 68399.2 77140.57 89256.21 95072.98 100577.13 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(62239.3, 64387.45, 66501.2, 68548.75, 72225.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r0mr1448542878.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,] 12311.02 30824.80 15312.90 [2,] 12542.74 31075.20 16473.50 [3,] 12916.19 32014.45 16869.60 [4,] 13299.92 33346.45 17577.85 [5,] 14137.35 35123.50 18492.20 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12570.83 30978.52 16365.9 [2,] 13261.54 33050.38 17373.3 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(12311.0226087438, 12542.7425633997, 12916.1872311084, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1g7cz1448542878.ps tmp/1g7cz1448542878.png",intern=TRUE)) character(0) > try(system("convert tmp/2m5b91448542878.ps tmp/2m5b91448542878.png",intern=TRUE)) character(0) > try(system("convert tmp/3c2v21448542878.ps tmp/3c2v21448542878.png",intern=TRUE)) character(0) > try(system("convert tmp/4mj461448542878.ps tmp/4mj461448542878.png",intern=TRUE)) character(0) > try(system("convert tmp/5eisz1448542878.ps tmp/5eisz1448542878.png",intern=TRUE)) character(0) > try(system("convert tmp/6r0mr1448542878.ps tmp/6r0mr1448542878.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.102 0.418 2.541