R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(2884,2505,3128,2765,2398,3015,2769,2840,2895,2761,2712,3051,2980,2790,3164,2629,2919,2653,2788,3031,2794,2448,2856,2703,2918,2766,2907,2516,2754,3000,3117,3265,2748,2970,3081,2679,3034,2958,3029,2697,2844,2604,3289,3217,2834,3141,2674,2883,3237,2905,3211,3058,2784,3125,3370,3021,3152,3210,2930,3229,2961,2927,3342,2999,2593,3168,3547,3037,2911,2869,2827,2988) > 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,] 2884 2980 2918 3034 3237 2961 NA [2,] 2505 2790 2766 2958 2905 2927 NA [3,] 3128 3164 2907 3029 3211 3342 NA [4,] 2765 2629 2516 2697 3058 2999 NA [5,] 2398 2919 2754 2844 2784 2593 NA [6,] 3015 2653 3000 2604 3125 3168 NA [7,] 2769 2788 3117 3289 3370 3547 NA [8,] 2840 3031 3265 3217 3021 3037 NA [9,] 2895 2794 2748 2834 3152 2911 NA [10,] 2761 2448 2970 3141 3210 2869 NA [11,] 2712 2856 3081 2674 2930 2827 NA [12,] 3051 2703 2679 2883 3229 2988 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/159tb1479413286.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/2cd5v1479413286.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/3p62v1479413286.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/4ogd21479413286.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] [,10] [,11] [,12] [1,] 2884.0 2766.0 2907 2516 2398 2604.0 2769 2840 2748.0 2448.0 2674.0 2679.0 [2,] 2918.0 2766.0 3029 2629 2593 2653.0 2788 3021 2794.0 2761.0 2712.0 2703.0 [3,] 2970.5 2847.5 3146 2731 2769 3007.5 3203 3034 2864.5 2919.5 2841.5 2935.5 [4,] 3034.0 2927.0 3211 2999 2844 3125.0 3370 3217 2911.0 3141.0 2930.0 3051.0 [5,] 3034.0 2958.0 3342 3058 2919 3168.0 3547 3265 2911.0 3210.0 3081.0 3229.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2895.676 2743.65 3028.604 2492.338 2607.097 2703.045 2827.591 2907.574 [2,] 3045.324 2951.35 3263.396 2969.662 2930.903 3311.955 3578.409 3160.426 [,9] [,10] [,11] [,12] [1,] 2789.031 2674.388 2700.883 2711.029 [2,] 2939.969 3164.612 2982.117 3159.971 $out [1] 3237 2505 3152 $group [1] 1 2 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2884, 2918, 2970.5, 3034, 3034, 2766, 2766, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5oggs1479413286.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,] 2505.0 2448.0 2516.0 2604.0 2784.0 2593.0 NA [2,] 2736.5 2678.0 2751.0 2765.5 2975.5 2890.0 NA [3,] 2804.5 2792.0 2912.5 2920.5 3138.5 2974.5 NA [4,] 2955.0 2949.5 3040.5 3087.5 3220.0 3102.5 NA [5,] 3128.0 3164.0 3265.0 3289.0 3370.0 3342.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2704.841 2668.167 2780.457 2773.634 3026.982 2877.577 NA [2,] 2904.159 2915.833 3044.543 3067.366 3250.018 3071.423 NA $out [1] 2398 3547 $group [1] 1 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2505, 2736.5, 2804.5, 2955, 3128, 2448, 2678, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6q2mg1479413286.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,] 126.0106 353 91.750 [2,] 149.2877 416 147.000 [3,] 178.5007 487 183.250 [4,] 226.3884 557 302.375 [5,] 317.0354 762 479.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 143.3345 422.689 112.3824 [2,] 213.6668 551.311 254.1176 $out [1] 778 $group [1] 2 $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(126.010581566258, 149.287692866969, 178.500654380106, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/159tb1479413286.ps tmp/159tb1479413286.png",intern=TRUE)) character(0) > try(system("convert tmp/2cd5v1479413286.ps tmp/2cd5v1479413286.png",intern=TRUE)) character(0) > try(system("convert tmp/3p62v1479413286.ps tmp/3p62v1479413286.png",intern=TRUE)) character(0) > try(system("convert tmp/4ogd21479413286.ps tmp/4ogd21479413286.png",intern=TRUE)) character(0) > try(system("convert tmp/5oggs1479413286.ps tmp/5oggs1479413286.png",intern=TRUE)) character(0) > try(system("convert tmp/6q2mg1479413286.ps tmp/6q2mg1479413286.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.389 0.168 2.616