R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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 = '4' > par1 <- '4' > #'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] 15 > 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] 15 15 15 15 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 62239.3 64363.7 66290.2 68229.5 71798.4 74814.5 78830.5 83478.5 86448.0 [2,] 64816.6 67342.0 69336.8 71096.3 75074.3 78303.2 82168.1 87003.2 90577.7 [3,] 62625.3 64411.2 66712.2 68407.9 72694.6 75431.6 79493.2 83672.7 86621.1 [4,] 67923.0 69174.5 72225.9 74522.4 78789.4 82600.7 86876.6 90914.2 91418.5 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 84275.4 87111.3 91812.0 94384.8 95251.8 97435.1 NA [2,] 87677.9 92293.9 95980.4 97900.5 100001.8 101220.2 NA [3,] 85149.6 89060.0 92043.7 93630.8 95689.8 97537.0 NA [4,] 92600.0 97281.6 100079.2 102255.2 104298.0 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/1515v1451037465.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/28kca1451037465.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/3mr1r1451037465.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/4gi341451037465.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] [1,] 62239.30 64816.60 62625.30 67923.0 [2,] 70013.95 73085.30 70551.25 76655.9 [3,] 83478.50 87003.20 83672.70 90914.2 [4,] 89461.65 94137.15 90551.85 98680.4 [5,] 97435.10 101220.20 97537.00 105834.9 $n [1] 15 15 15 15 $conf [,1] [,2] [,3] [,4] [1,] 75544.73 78415.01 75513.37 81929.21 [2,] 91412.27 95591.39 91832.03 99899.19 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(62239.3, 70013.95, 83478.5, 89461.65, 97435.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gwc41451037465.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] [1,] 62239.30 64363.70 66290.20 68229.50 71798.40 74814.50 78830.50 83478.50 [2,] 62432.30 64387.45 66501.20 68318.70 72246.50 75123.05 79161.85 83575.60 [3,] 63720.95 65876.60 68024.50 69752.10 73884.45 76867.40 80830.65 85337.95 [4,] 66369.80 68258.25 70781.35 72809.35 76931.85 80451.95 84522.35 88958.70 [5,] 67923.00 69174.50 72225.90 74522.40 78789.40 82600.70 86876.60 90914.20 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 86448.00 84275.40 87111.30 91812.00 93630.80 95251.8 97435.10 NA [2,] 86534.55 84712.50 88085.65 91927.85 94007.80 95470.8 97486.05 NA [3,] 88599.40 86413.75 90676.95 94012.05 96142.65 97845.8 99378.60 NA [4,] 90998.10 90138.95 94787.75 98029.80 100077.85 102149.9 103527.55 NA [5,] 91418.50 92600.00 97281.60 100079.20 102255.20 104298.0 105834.90 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 60610.32 62818.67 64643.18 66204.49 70183.02 72657.57 76595.85 81085.3 [2,] 66831.57 68934.53 71405.82 73299.71 77585.88 81077.23 85065.44 89590.6 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 85073.2 82126.85 85382.29 89191.51 91347.31 92569.31 94605.82 NA [2,] 92125.6 90700.65 95971.61 98832.59 100937.99 103122.29 104151.38 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] NA Warning message: In bxp(list(stats = c(62239.3, 62432.3, 63720.95, 66369.8, 67923, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67ze71451037465.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,] 11860.02 34911.70 19447.70 [2,] 11882.93 35053.75 19724.15 [3,] 12172.69 35799.70 20526.22 [4,] 12715.42 37157.75 21538.17 [5,] 12991.29 37911.90 22024.50 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 11515.03 34137.54 19093.15 [2,] 12830.35 37461.86 21959.30 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(11860.0244396801, 11882.9317161481, 12172.6894621623, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1515v1451037465.ps tmp/1515v1451037465.png",intern=TRUE)) character(0) > try(system("convert tmp/28kca1451037465.ps tmp/28kca1451037465.png",intern=TRUE)) character(0) > try(system("convert tmp/3mr1r1451037465.ps tmp/3mr1r1451037465.png",intern=TRUE)) character(0) > try(system("convert tmp/4gi341451037465.ps tmp/4gi341451037465.png",intern=TRUE)) character(0) > try(system("convert tmp/5gwc41451037465.ps tmp/5gwc41451037465.png",intern=TRUE)) character(0) > try(system("convert tmp/67ze71451037465.ps tmp/67ze71451037465.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.045 0.406 2.449