R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(106474.50 + ,106559.75 + ,106636.75 + ,106722.00 + ,106804.50 + ,106889.75 + ,106972.25 + ,107057.50 + ,107142.75 + ,107225.25 + ,107310.50 + ,107393.00 + ,107478.25 + ,107563.50 + ,107640.50 + ,107725.75 + ,107808.25 + ,107893.50 + ,107976.00 + ,108061.25 + ,108146.50 + ,108229.00 + ,108314.25 + ,108396.75 + ,108482.00 + ,108567.25 + ,108647.00 + ,108732.25 + ,108814.75 + ,108900.00 + ,108982.50 + ,109067.75 + ,109153.00 + ,109235.50 + ,109320.75 + ,109403.25 + ,109488.50 + ,109573.75 + ,109650.75 + ,109736.00 + ,109818.50 + ,109903.75 + ,109986.25 + ,110071.50 + ,110156.75 + ,110239.25 + ,110324.50 + ,110407.00 + ,110492.25 + ,110577.50 + ,110654.50 + ,110739.75 + ,110822.25 + ,110907.50 + ,110990.00 + ,111075.25 + ,111160.50 + ,111243.00 + ,111328.25 + ,111410.75 + ,111496.00 + ,111581.25 + ,111658.25 + ,111743.50 + ,111826.00 + ,111911.25 + ,111993.75 + ,112079.00 + ,112164.25 + ,112246.75 + ,112332.00 + ,112414.50 + ,112499.75 + ,112585.00 + ,112664.75 + ,112750.00 + ,112832.50 + ,112917.75 + ,113000.25 + ,113085.50 + ,113170.75 + ,113253.25 + ,113338.50 + ,113421.00 + ,113506.25 + ,113591.50 + ,113668.50 + ,113753.75 + ,113836.25 + ,113921.50 + ,114004.00 + ,114089.25 + ,114174.50 + ,114257.00 + ,114342.25 + ,114424.75 + ,114510.00 + ,114595.25 + ,114672.25 + ,114757.50 + ,114840.00 + ,114925.25 + ,115007.75 + ,115093.00 + ,115178.25 + ,115260.75 + ,115346.00 + ,115428.50 + ,115513.75 + ,115599.00 + ,115676.00 + ,115761.25 + ,115843.75 + ,115929.00 + ,116011.50 + ,116096.75 + ,116182.00 + ,116264.50 + ,116349.75 + ,116432.25) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106474.5 107478.2 108482.0 109488.5 110492.2 111496.0 112499.8 113506.2 [2,] 106559.8 107563.5 108567.2 109573.8 110577.5 111581.2 112585.0 113591.5 [3,] 106636.8 107640.5 108647.0 109650.8 110654.5 111658.2 112664.8 113668.5 [4,] 106722.0 107725.8 108732.2 109736.0 110739.8 111743.5 112750.0 113753.8 [5,] 106804.5 107808.2 108814.8 109818.5 110822.2 111826.0 112832.5 113836.2 [6,] 106889.8 107893.5 108900.0 109903.8 110907.5 111911.2 112917.8 113921.5 [7,] 106972.2 107976.0 108982.5 109986.2 110990.0 111993.8 113000.2 114004.0 [8,] 107057.5 108061.2 109067.8 110071.5 111075.2 112079.0 113085.5 114089.2 [9,] 107142.8 108146.5 109153.0 110156.8 111160.5 112164.2 113170.8 114174.5 [10,] 107225.2 108229.0 109235.5 110239.2 111243.0 112246.8 113253.2 114257.0 [11,] 107310.5 108314.2 109320.8 110324.5 111328.2 112332.0 113338.5 114342.2 [12,] 107393.0 108396.8 109403.2 110407.0 111410.8 112414.5 113421.0 114424.8 [,9] [,10] [,11] [1,] 114510.0 115513.8 NA [2,] 114595.2 115599.0 NA [3,] 114672.2 115676.0 NA [4,] 114757.5 115761.2 NA [5,] 114840.0 115843.8 NA [6,] 114925.2 115929.0 NA [7,] 115007.8 116011.5 NA [8,] 115093.0 116096.8 NA [9,] 115178.2 116182.0 NA [10,] 115260.8 116264.5 NA [11,] 115346.0 116349.8 NA [12,] 115428.5 116432.2 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/10ao11470412903.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/2dpmu1470412903.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/3edpt1470412903.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/4b8tm1470412903.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] [1,] 106474.5 106559.8 106636.8 106722.0 106804.5 106889.8 106972.2 107057.5 [2,] 108482.0 108567.2 108647.0 108732.2 108814.8 108900.0 108982.5 109067.8 [3,] 110994.1 111079.4 111156.4 111241.6 111324.1 111409.4 111491.9 111577.1 [4,] 113506.2 113591.5 113668.5 113753.8 113836.2 113921.5 114004.0 114089.2 [5,] 115513.8 115599.0 115676.0 115761.2 115843.8 115929.0 116011.5 116096.8 [,9] [,10] [,11] [,12] [1,] 107142.8 107225.2 107310.5 107393.0 [2,] 109153.0 109235.5 109320.8 109403.2 [3,] 111662.4 111744.9 111830.1 111912.6 [4,] 114174.5 114257.0 114342.2 114424.8 [5,] 116182.0 116264.5 116349.8 116432.2 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 108483.8 108569.1 108647.4 108732.7 108815.2 108900.4 108982.9 109068.2 [2,] 113504.4 113589.7 113665.3 113750.6 113833.1 113918.3 114000.8 114086.1 [,9] [,10] [,11] [,12] [1,] 109153.4 109235.9 109321.2 109403.7 [2,] 114171.3 114253.8 114339.1 114421.6 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p7bo1470412903.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,] 106474.5 107478.2 108482.0 109488.5 110492.2 111496.0 112499.8 113506.2 [2,] 106679.4 107683.1 108689.6 109693.4 110697.1 111700.9 112707.4 113711.1 [3,] 106931.0 107934.8 108941.2 109945.0 110948.8 111952.5 112959.0 113962.8 [4,] 107184.0 108187.8 109194.2 110198.0 111201.8 112205.5 113212.0 114215.8 [5,] 107393.0 108396.8 109403.2 110407.0 111410.8 112414.5 113421.0 114424.8 [,9] [,10] [,11] [1,] 114510.0 115513.8 NA [2,] 114714.9 115718.6 NA [3,] 114966.5 115970.2 NA [4,] 115219.5 116223.2 NA [5,] 115428.5 116432.2 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 106700.8 107704.6 108711.1 109714.8 110718.6 111722.3 112728.8 113732.6 [2,] 107161.2 108164.9 109171.4 110175.2 111178.9 112182.7 113189.2 114192.9 [,9] [,10] [,11] [1,] 114736.3 115740.1 NA [2,] 115196.7 116200.4 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r6mm1470412903.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,] 3041.023 9039.25 4519.625 [2,] 3041.023 9039.25 4519.625 [3,] 3041.023 9039.25 4519.625 [4,] 3041.023 9039.25 4519.625 [5,] 3041.023 9039.25 4519.625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3041.023 9039.25 4519.625 [2,] 3041.023 9039.25 4519.625 $out [1] 3041.123 3041.123 4521.000 4521.000 $group [1] 1 1 3 3 $names [1] "S.D." "Range" "IQR" > dev.off() null device 1 > > try(system("convert tmp/10ao11470412903.ps tmp/10ao11470412903.png",intern=TRUE)) character(0) > try(system("convert tmp/2dpmu1470412903.ps tmp/2dpmu1470412903.png",intern=TRUE)) character(0) > try(system("convert tmp/3edpt1470412903.ps tmp/3edpt1470412903.png",intern=TRUE)) character(0) > try(system("convert tmp/4b8tm1470412903.ps tmp/4b8tm1470412903.png",intern=TRUE)) character(0) > try(system("convert tmp/5p7bo1470412903.ps tmp/5p7bo1470412903.png",intern=TRUE)) character(0) > try(system("convert tmp/6r6mm1470412903.ps tmp/6r6mm1470412903.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.092 0.186 2.311