R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17,2466.92,2502.66,2539.91,2482.6,2626.15,2656.32,2446.66,2467.38,2462.32,2504.58,2579.39,2649.24,2636.87,2613.94,2634.01,2711.94,2646.43,2717.79,2701.54,2572.98,2488.92,2204.91,2123.99,2149.1,2036.71,2048.32,2159.56,2267.79,2313.55,2247.3,2134.43,2114,2236.94,2345.39,2422.4,2385.96,2378.17,2457.13,2527.67,2530.03,2604.92,2596.8,2713.2,2574.82,2611.98,2768.46,2785.61,2859.27,2880.53,2824.5) > 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,] 3844.49 1905.41 2539.91 2634.01 2159.56 2527.67 NA [2,] 3720.98 1810.99 2482.60 2711.94 2267.79 2530.03 NA [3,] 3674.40 1670.07 2626.15 2646.43 2313.55 2604.92 NA [4,] 3857.62 1864.44 2656.32 2717.79 2247.30 2596.80 NA [5,] 3801.06 2052.02 2446.66 2701.54 2134.43 2713.20 NA [6,] 3504.37 2029.60 2467.38 2572.98 2114.00 2574.82 NA [7,] 3032.60 2070.83 2462.32 2488.92 2236.94 2611.98 NA [8,] 3047.03 2293.41 2504.58 2204.91 2345.39 2768.46 NA [9,] 2962.34 2443.27 2579.39 2123.99 2422.40 2785.61 NA [10,] 2197.82 2513.17 2649.24 2149.10 2385.96 2859.27 NA [11,] 2014.45 2466.92 2636.87 2036.71 2378.17 2880.53 NA [12,] 1862.83 2502.66 2613.94 2048.32 2457.13 2824.50 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/1d2mb1416653741.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/22mne1416653741.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/3utpo1416653741.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/4dble1416653741.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,] 1905.41 1810.990 2313.550 1864.44 2052.02 2029.60 2070.83 2204.910 2123.99 [2,] 2159.56 2267.790 2313.550 2247.30 2134.43 2114.00 2236.94 2293.410 2422.40 [3,] 2533.79 2506.315 2615.535 2626.56 2574.10 2520.18 2475.62 2424.985 2511.33 [4,] 2634.01 2711.940 2646.430 2717.79 2713.20 2574.82 2611.98 2768.460 2785.61 [5,] 2634.01 2711.940 2646.430 2717.79 2713.20 2574.82 3032.60 3047.030 2962.34 [,10] [,11] [,12] [1,] 2149.100 2014.450 1862.830 [2,] 2197.820 2036.710 2048.320 [3,] 2449.565 2422.545 2479.895 [4,] 2649.240 2636.870 2613.940 [5,] 2859.270 2880.530 2824.500 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2227.754 2219.824 2400.817 2323.079 2200.775 2222.936 2233.707 2118.562 [2,] 2839.826 2792.806 2830.253 2930.041 2947.425 2817.424 2717.533 2731.408 [,9] [,10] [,11] [,12] [1,] 2277.048 2158.385 2035.422 2115.052 [2,] 2745.612 2740.745 2809.668 2844.738 $out [1] 3844.49 3720.98 3674.40 1670.07 3857.62 3801.06 3504.37 $group [1] 1 2 3 3 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1905.41, 2159.56, 2533.79, 2634.01, 2634.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ypu81416653741.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,] 1862.83 1670.070 2446.66 2036.710 2114.000 2527.670 NA [2,] 2580.08 1884.925 2474.99 2136.545 2198.250 2585.810 NA [3,] 3275.70 2061.425 2559.65 2530.950 2290.670 2662.590 NA [4,] 3761.02 2455.095 2631.51 2673.985 2382.065 2805.055 NA [5,] 3857.62 2513.170 2656.32 2717.790 2457.130 2880.530 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2737.065 1801.367 2488.26 2285.82 2206.831 2562.591 NA [2,] 3814.335 2321.483 2631.04 2776.08 2374.509 2762.589 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1862.83, 2580.08, 3275.7, 3761.02, 3857.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/639i11416653741.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,] 271.6356 710.170 254.9675 [2,] 327.0949 854.100 325.7037 [3,] 442.9945 1218.270 369.0575 [4,] 642.0792 1924.535 415.8413 [5,] 670.0468 2004.330 497.7975 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 299.3280 730.0374 327.9452 [2,] 586.6609 1706.5026 410.1698 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(271.635605594456, 327.094869794846, 442.994472400145, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d2mb1416653741.ps tmp/1d2mb1416653741.png",intern=TRUE)) character(0) > try(system("convert tmp/22mne1416653741.ps tmp/22mne1416653741.png",intern=TRUE)) character(0) > try(system("convert tmp/3utpo1416653741.ps tmp/3utpo1416653741.png",intern=TRUE)) character(0) > try(system("convert tmp/4dble1416653741.ps tmp/4dble1416653741.png",intern=TRUE)) character(0) > try(system("convert tmp/5ypu81416653741.ps tmp/5ypu81416653741.png",intern=TRUE)) character(0) > try(system("convert tmp/639i11416653741.ps tmp/639i11416653741.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.132 0.362 2.518