R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(2754542000,2899512000,2928886000,3011252000,2932895000,3069307000,2863923000,2585491000,2993900000,3023542000,2491370000,2341705000,2126472000,2196705000,2368313000,2285174000,2163877000,2299241000,2275643000,2163091000,2416149000,2434553000,2281937000,2440464000,2255745000,2389872000,2863148000,2623516000,2558136000,2898129000,2537720000,2543469000,2779739000,2884779000,2711624000,2817771000,2884477000,3058996000,3285298000,2879617000,3220416000,3144280000,2940811000,2986507000,3153720000,2995806000,2990242000,2879837000,2848699000,3138385000,3532447000,3121872000,3309250000,3215022000,2966778000,3010284000,3083824000,3257727000,3180374000,3036414000,2966714000,3067677000,3339789000,3299861000,3193328000,3181266000,3193356000,2898282000,2929524000,3217311000,3126249000,3131083000,3008058000,2868318000,3207495000,3109336000,3070725000,2989963000,3287552000,2835238000,3368961000,3291689000,3008536000,2974109000) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2754542000 2126472000 2255745000 2884477000 2848699000 2966714000 [2,] 2899512000 2196705000 2389872000 3058996000 3138385000 3067677000 [3,] 2928886000 2368313000 2863148000 3285298000 3532447000 3339789000 [4,] 3011252000 2285174000 2623516000 2879617000 3121872000 3299861000 [5,] 2932895000 2163877000 2558136000 3220416000 3309250000 3193328000 [6,] 3069307000 2299241000 2898129000 3144280000 3215022000 3181266000 [7,] 2863923000 2275643000 2537720000 2940811000 2966778000 3193356000 [8,] 2585491000 2163091000 2543469000 2986507000 3010284000 2898282000 [9,] 2993900000 2416149000 2779739000 3153720000 3083824000 2929524000 [10,] 3023542000 2434553000 2884779000 2995806000 3257727000 3217311000 [11,] 2491370000 2281937000 2711624000 2990242000 3180374000 3126249000 [12,] 2341705000 2440464000 2817771000 2879837000 3036414000 3131083000 [,7] [,8] [1,] 3008058000 NA [2,] 2868318000 NA [3,] 3207495000 NA [4,] 3109336000 NA [5,] 3070725000 NA [6,] 2989963000 NA [7,] 3287552000 NA [8,] 2835238000 NA [9,] 3368961000 NA [10,] 3291689000 NA [11,] 3008536000 NA [12,] 2974109000 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/1dh841447958433.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/211kz1447958433.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/3opr31447958433.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/4k3731447958433.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] [1,] 2126472000 2196705000 2368313000 2285174000 2163877000 2898129000 [2,] 2505143500 2629095000 2896017000 2751566500 2745515500 2944046000 [3,] 2848699000 2899512000 3207495000 3011252000 3070725000 3069307000 [4,] 2925595500 3063336500 3312543500 3115604000 3206872000 3162773000 [5,] 3008058000 3138385000 3532447000 3299861000 3309250000 3215022000 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2275643000 2163091000 2779739000 2884779000 2281937000 2341705000 [2,] 2700821500 2564480000 2854631500 2940292500 2601497000 2629117500 [3,] 2940811000 2835238000 2993900000 3023542000 2990242000 2879837000 [4,] 3080067000 2942394500 3118772000 3237519000 3067392500 3005261500 [5,] 3287552000 3010284000 3368961000 3291689000 3180374000 3131083000 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2597611849 2640189982 2958752094 2793854678 2795210341 2938686764 [2,] 3099786151 3158834018 3456237906 3228649322 3346239659 3199927236 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2714331706 2609553557 2836159555 2846043129 2712016724 2655209871 [2,] 3167290294 3060922443 3151640445 3201040871 3268467276 3104464129 $out [1] 2299241000 2416149000 2434553000 $group [1] 6 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2126472000, 2505143500, 2848699000, 2925595500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qrii1447958433.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] [1,] 2341705000 2126472000 2255745000 2879617000 2848699000 2898282000 [2,] 2670016500 2180291000 2540594500 2912644000 3023349000 3017195500 [3,] 2914199000 2283555500 2667570000 2993024000 3130128500 3156174500 [4,] 3002576000 2392231000 2840459500 3149000000 3236374500 3205333500 [5,] 3069307000 2440464000 2898129000 3285298000 3532447000 3339789000 [,7] [,8] [1,] 2835238000 NA [2,] 2982036000 NA [3,] 3039630500 NA [4,] 3247523500 NA [5,] 3368961000 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2762516380 2186888243 2530799561 2885220442 3032966139 3070363495 [2,] 3065881620 2380222757 2804340439 3100827558 3227290861 3241985505 [,7] [,8] [1,] 2918539869 NA [2,] 3160721131 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(2341705000, 2670016500, 2914199000, 3002576000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6soqd1447958433.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,] 297411197 789378000 218727000 [2,] 304157964 869361000 330632000 [3,] 343636957 928730500 378580000 [4,] 360154512 1013298000 427346750 [5,] 416736278 1164134000 465895500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 318096555 863079868 334467753 [2,] 369177359 994381132 422692247 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(297411196.930237, 304157963.523999, 343636957.159317, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dh841447958433.ps tmp/1dh841447958433.png",intern=TRUE)) character(0) > try(system("convert tmp/211kz1447958433.ps tmp/211kz1447958433.png",intern=TRUE)) character(0) > try(system("convert tmp/3opr31447958433.ps tmp/3opr31447958433.png",intern=TRUE)) character(0) > try(system("convert tmp/4k3731447958433.ps tmp/4k3731447958433.png",intern=TRUE)) character(0) > try(system("convert tmp/5qrii1447958433.ps tmp/5qrii1447958433.png",intern=TRUE)) character(0) > try(system("convert tmp/6soqd1447958433.ps tmp/6soqd1447958433.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.159 0.392 2.570