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(5452304,5431998,5411406,5368792,5790356,5768048,5452304,5242380,5262686,5262686,5285280,5325892,5389098,5389098,5348486,5242380,5790356,5873868,5747742,5452304,5578716,5389098,5474612,5515510,5558124,5452304,5474612,5325892,5790356,5937074,5810948,5578716,5831254,5558124,5810948,5790356,5853562,5621330,5873868,5853562,6232512,6146998,5810948,5641636,5873868,5558124,5790356,5831254,5916768,5727436,5831254,5894460,6126692,5937074,5684536,5411406,5664230,4969250,5305586,5494918,5684536,5411406,5411406,5411406,5558124,5348486,5073354,4843124,5010148,4358068,4757610,4989842,5032456,4800224,4820530,4757610,4969250,4820530,4527380,4315454,4673812,3895606,4400968,4631198,4631198,4358068,4105530,4085224,4315454,4105530,3706274,3431142,3726580,3031886,3663374,3999424,4105530,3873298,3579862,3789786,3873298,3810092,3178318,2885168,3094806,2463318,3115398,3347630,3536962,3221218,2925780,3094806,3178318,3011294,2379806,2104674,2357212,1662518,2420418,2885168) > 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,] 5452304 5389098 5558124 5853562 5916768 5684536 5032456 4631198 4105530 [2,] 5431998 5389098 5452304 5621330 5727436 5411406 4800224 4358068 3873298 [3,] 5411406 5348486 5474612 5873868 5831254 5411406 4820530 4105530 3579862 [4,] 5368792 5242380 5325892 5853562 5894460 5411406 4757610 4085224 3789786 [5,] 5790356 5790356 5790356 6232512 6126692 5558124 4969250 4315454 3873298 [6,] 5768048 5873868 5937074 6146998 5937074 5348486 4820530 4105530 3810092 [7,] 5452304 5747742 5810948 5810948 5684536 5073354 4527380 3706274 3178318 [8,] 5242380 5452304 5578716 5641636 5411406 4843124 4315454 3431142 2885168 [9,] 5262686 5578716 5831254 5873868 5664230 5010148 4673812 3726580 3094806 [10,] 5262686 5389098 5558124 5558124 4969250 4358068 3895606 3031886 2463318 [11,] 5285280 5474612 5810948 5790356 5305586 4757610 4400968 3663374 3115398 [12,] 5325892 5515510 5790356 5831254 5494918 4989842 4631198 3999424 3347630 [,10] [,11] [1,] 3536962 NA [2,] 3221218 NA [3,] 2925780 NA [4,] 3094806 NA [5,] 3178318 NA [6,] 3011294 NA [7,] 2379806 NA [8,] 2104674 NA [9,] 2357212 NA [10,] 1662518 NA [11,] 2420418 NA [12,] 2885168 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/1agpu1439657690.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/2tiqq1439657690.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/34jv01439657690.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/4sdv21439657690.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,] 3536962 3221218 2925780 3094806 3178318 3011294 2379806 2104674 2357212 [2,] 4631198 4358068 4105530 4085224 4315454 4105530 3706274 3431142 3726580 [3,] 5420701 5400252 5379946 5284136 5674240 5558267 5262829 5042752 5136417 [4,] 5684536 5452304 5474612 5411406 5790356 5937074 5747742 5452304 5664230 [5,] 5916768 5727436 5873868 5894460 6232512 6146998 5810948 5641636 5873868 [,10] [,11] [,12] [1,] 1662518 2420418 2885168 [2,] 3031886 3663374 3999424 [3,] 4663659 5021445 5157867 [4,] 5389098 5474612 5515510 [5,] 5558124 5810948 5831254 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 4894411 4853528 4695898 4621523 4937320 4643155 4242830 4032899 4168290 [2,] 5946991 5946976 6063994 5946749 6411160 6473379 6282828 6052605 6104544 [,10] [,11] [,12] [1,] 3485902 4116478 4400370 [2,] 5841416 5926412 5915364 $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(3536962, 4631198, 5420701, 5684536, 5916768, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a2r91439657690.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] [,9] [1,] 5242380 5242380 5325892 5558124 4969250 4358068 4315454 3031886 2463318 [2,] 5273983 5389098 5516368 5715996 5453162 4916483 4464174 3684824 3105102 [3,] 5390099 5463458 5684536 5842408 5705986 5210920 4715711 4042324 3463746 [4,] 5452304 5663229 5810948 5873868 5905614 5411406 4820530 4210492 3841695 [5,] 5452304 5873868 5937074 5873868 6126692 5684536 5032456 4631198 4105530 [,10] [,11] [1,] 1662518 NA [2,] 2368509 NA [3,] 2905474 NA [4,] 3136562 NA [5,] 3536962 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 5308766 5338425 5550176 5770402 5499620 4985182 4553175 3802563 3127781 [2,] 5471432 5588491 5818896 5914414 5912352 5436658 4878247 4282085 3799711 [,10] [,11] [1,] 2555160 NA [2,] 3255788 NA $out [1] 5790356 5768048 6232512 6146998 3895606 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5242380, 5273983, 5390099, 5452304, 5452304, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66ubi1439657690.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,] 792186.8 2379806 921420.5 [2,] 970938.5 2872870 1160981.2 [3,] 1066563.1 3094949 1468788.8 [4,] 1241153.1 3473899 1734661.5 [5,] 1404706.5 3895606 2109679.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 943316.4 2820816 1207129 [2,] 1189809.8 3369082 1730448 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(792186.845447433, 970938.510770712, 1066563.11573724, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1agpu1439657690.ps tmp/1agpu1439657690.png",intern=TRUE)) character(0) > try(system("convert tmp/2tiqq1439657690.ps tmp/2tiqq1439657690.png",intern=TRUE)) character(0) > try(system("convert tmp/34jv01439657690.ps tmp/34jv01439657690.png",intern=TRUE)) character(0) > try(system("convert tmp/4sdv21439657690.ps tmp/4sdv21439657690.png",intern=TRUE)) character(0) > try(system("convert tmp/5a2r91439657690.ps tmp/5a2r91439657690.png",intern=TRUE)) character(0) > try(system("convert tmp/66ubi1439657690.ps tmp/66ubi1439657690.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.132 0.348 2.514