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(2421.21,2378.63,2336.00,2250.79,3113.00,3070.38,2421.21,1990.13,2032.71,2032.71,2075.33,2165.17,1904.92,1644.25,1430.79,1430.79,2250.79,2336.00,1686.83,952.46,1340.96,1340.96,1644.25,1819.29,1776.67,1340.96,1559.04,1473.42,2207.79,2032.71,1340.96,824.25,1298.33,1430.79,1559.04,1729.46,1383.54,1084.92,1213.17,1255.75,2378.63,2378.63,1729.46,1644.25,1904.92,1776.67,2122.58,2553.67,2639.29,2032.71,1861.88,1686.83,2856.96,2942.58,2724.50,2942.58,2899.54,2553.67,2942.58,3373.67,3548.71,3027.79,2681.88,2942.58,4065.42,4411.33,4326.13,4496.50,4453.92,4022.83,4757.21,4932.25,5188.29,4411.33,4108.04,4453.92,5278.13,6012.50,5837.46,5837.46,5923.08,5624.00,6401.42,6401.42,6268.96,5534.17,5666.63,5752.25,6315.79,7050.17,6529.21,6789.92,6571.83,6444.00,7439.08,7221.00,6917.71,6486.63,6917.71,7135.79,7396.04,7741.92,7396.04,7609.50,7349.21,7306.63,8386.88,8476.71,8130.83,7524.29,8041.00,8258.67,8519.33,8907.83,8519.33,8822.63,8690.17,8216.04,9211.08,9211.08) > 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] [,9] [1,] 2421.21 1904.92 1776.67 1383.54 2639.29 3548.71 5188.29 6268.96 6917.71 [2,] 2378.63 1644.25 1340.96 1084.92 2032.71 3027.79 4411.33 5534.17 6486.63 [3,] 2336.00 1430.79 1559.04 1213.17 1861.88 2681.88 4108.04 5666.63 6917.71 [4,] 2250.79 1430.79 1473.42 1255.75 1686.83 2942.58 4453.92 5752.25 7135.79 [5,] 3113.00 2250.79 2207.79 2378.63 2856.96 4065.42 5278.13 6315.79 7396.04 [6,] 3070.38 2336.00 2032.71 2378.63 2942.58 4411.33 6012.50 7050.17 7741.92 [7,] 2421.21 1686.83 1340.96 1729.46 2724.50 4326.13 5837.46 6529.21 7396.04 [8,] 1990.13 952.46 824.25 1644.25 2942.58 4496.50 5837.46 6789.92 7609.50 [9,] 2032.71 1340.96 1298.33 1904.92 2899.54 4453.92 5923.08 6571.83 7349.21 [10,] 2032.71 1340.96 1430.79 1776.67 2553.67 4022.83 5624.00 6444.00 7306.63 [11,] 2075.33 1644.25 1559.04 2122.58 2942.58 4757.21 6401.42 7439.08 8386.88 [12,] 2165.17 1819.29 1729.46 2553.67 3373.67 4932.25 6401.42 7221.00 8476.71 [,10] [,11] [1,] 8130.83 NA [2,] 7524.29 NA [3,] 8041.00 NA [4,] 8258.67 NA [5,] 8519.33 NA [6,] 8907.83 NA [7,] 8519.33 NA [8,] 8822.63 NA [9,] 8690.17 NA [10,] 8216.04 NA [11,] 9211.08 NA [12,] 9211.08 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/13t5v1470739501.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/2edyy1470739501.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/3lju41470739501.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/4i2h81470739501.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,] 1383.54 1084.92 1213.17 1255.750 2207.79 2032.710 1340.960 824.25 1298.33 [2,] 1904.92 1644.25 1559.04 1473.420 2378.63 2378.630 1729.460 1644.25 1904.92 [3,] 3094.00 2703.21 2508.94 2596.685 3589.21 3740.855 3525.315 3719.54 3676.73 [4,] 6268.96 5534.17 5666.63 5752.250 6315.79 7050.170 6529.210 6789.92 6571.83 [5,] 8130.83 7524.29 8041.00 8258.670 8519.33 8907.830 8519.330 8822.63 8690.17 [,10] [,11] [,12] [1,] 1340.96 1559.040 1729.46 [2,] 1776.67 2075.330 2165.17 [3,] 3288.25 3849.895 4152.96 [4,] 6444.00 7439.080 7221.00 [5,] 8216.04 9211.080 9211.08 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 913.5516 759.6509 456.6243 458.8109 1622.048 1406.767 1127.169 [2,] 5274.4484 4646.7691 4561.2557 4734.5591 5556.372 6074.943 5923.461 [,8] [,9] [,10] [,11] [,12] [1,] 1148.558 1344.956 956.2658 1169.952 1626.866 [2,] 6290.522 6008.504 5620.2342 6529.838 6679.054 $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(1383.54, 1904.92, 3094, 6268.96, 8130.83, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5i9xl1470739501.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,] 1990.130 952.460 824.250 1084.920 1686.83 2681.880 4108.040 5534.170 [2,] 2054.020 1385.875 1340.960 1319.645 2293.19 3288.250 4821.105 6010.605 [3,] 2293.395 1644.250 1516.230 1753.065 2790.73 4195.775 5730.730 6486.605 [4,] 2421.210 1862.105 1753.065 2250.605 2942.58 4475.210 5967.790 6920.045 [5,] 2421.210 2336.000 2207.790 2553.670 3373.67 4932.250 6401.420 7439.080 [,9] [,10] [,11] [1,] 6486.630 7524.290 NA [2,] 7026.750 8173.435 NA [3,] 7372.625 8519.330 NA [4,] 7675.710 8865.230 NA [5,] 8476.710 9211.080 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2125.917 1427.038 1328.266 1328.448 2494.539 3654.395 5207.719 6071.803 [2,] 2460.873 1861.462 1704.194 2177.682 3086.921 4737.155 6253.741 6901.407 [,9] [,10] [,11] [1,] 7076.63 8203.798 NA [2,] 7668.62 8834.862 NA $out [1] 3113.00 3070.38 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(1990.13, 2054.02, 2293.395, 2421.21, 2421.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65j0h1470739501.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,] 2300.551 6311.54 3512.095 [2,] 2450.979 6787.56 3771.564 [3,] 2603.375 6939.02 4334.727 [4,] 2795.210 7436.73 4613.292 [5,] 2984.146 7998.38 5092.522 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2446.369 6642.929 3950.809 [2,] 2760.381 7235.111 4718.646 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(2300.55111822653, 2450.97898829331, 2603.37507960577, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13t5v1470739501.ps tmp/13t5v1470739501.png",intern=TRUE)) character(0) > try(system("convert tmp/2edyy1470739501.ps tmp/2edyy1470739501.png",intern=TRUE)) character(0) > try(system("convert tmp/3lju41470739501.ps tmp/3lju41470739501.png",intern=TRUE)) character(0) > try(system("convert tmp/4i2h81470739501.ps tmp/4i2h81470739501.png",intern=TRUE)) character(0) > try(system("convert tmp/5i9xl1470739501.ps tmp/5i9xl1470739501.png",intern=TRUE)) character(0) > try(system("convert tmp/65j0h1470739501.ps tmp/65j0h1470739501.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.655 0.285 3.019