R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(1155168,1144638,1133976,1111920,1330188,1318626,1155168,1046484,1056978,1056978,1068672,1089696,1155168,1133976,1166694,1220472,1526400,1526400,1461096,1395624,1449402,1514838,1526400,1559118,1657302,1591836,1591836,1690020,1962198,1984254,1929480,1798572,1896726,1896726,1907256,1962198,2005446,2027502,2027502,2092938,2344086,2409390,2419884,2256426,2344086,2311368,2245902,2387334,2419884,2365110,2376672,2452638,2736510,2877744,2877744,2812440,2910492,2812440,2757528,2965434,2997984,2920992,3117198,3194196,3423126,3575052,3554034,3542334,3629994,3619332,3488592,3684768,3750240,3684768,3956946,4087854,4392612,4512858,4480272,4414800,4469610,4535046,4316646,4490766,4600518,4556238,4839942,4937958,5352606,5428566,5330544,5385324,5418042,5450760,5242854,5439066,5547744,5439066,5755650,5853708,6278808,6344280,6365304,6475020,6475020,6518268,6322056,6420246,6485550,6365304,6714474,6779916,7215582,7292580,7401258,7499448,7509942,7521504,7325298,7521504) > 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,] 1155168 1155168 1657302 2005446 2419884 2997984 3750240 4600518 5547744 [2,] 1144638 1133976 1591836 2027502 2365110 2920992 3684768 4556238 5439066 [3,] 1133976 1166694 1591836 2027502 2376672 3117198 3956946 4839942 5755650 [4,] 1111920 1220472 1690020 2092938 2452638 3194196 4087854 4937958 5853708 [5,] 1330188 1526400 1962198 2344086 2736510 3423126 4392612 5352606 6278808 [6,] 1318626 1526400 1984254 2409390 2877744 3575052 4512858 5428566 6344280 [7,] 1155168 1461096 1929480 2419884 2877744 3554034 4480272 5330544 6365304 [8,] 1046484 1395624 1798572 2256426 2812440 3542334 4414800 5385324 6475020 [9,] 1056978 1449402 1896726 2344086 2910492 3629994 4469610 5418042 6475020 [10,] 1056978 1514838 1896726 2311368 2812440 3619332 4535046 5450760 6518268 [11,] 1068672 1526400 1907256 2245902 2757528 3488592 4316646 5242854 6322056 [12,] 1089696 1559118 1962198 2387334 2965434 3684768 4490766 5439066 6420246 [,10] [,11] [1,] 6485550 NA [2,] 6365304 NA [3,] 6714474 NA [4,] 6779916 NA [5,] 7215582 NA [6,] 7292580 NA [7,] 7401258 NA [8,] 7499448 NA [9,] 7509942 NA [10,] 7521504 NA [11,] 7325298 NA [12,] 7521504 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/17www1373029761.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/2kr5z1373029761.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/38ust1373029761.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/45kjp1373029761.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,] 1155168 1133976 1133976 1111920 1330188 1318626 1155168 1046484 1056978 [2,] 1657302 1591836 1591836 1690020 1962198 1984254 1929480 1798572 1896726 [3,] 2708934 2643051 2746935 2823417 3079818 3226398 3215889 3177387 3270243 [4,] 4600518 4556238 4839942 4937958 5352606 5428566 5330544 5385324 5418042 [5,] 6485550 6365304 6714474 6779916 7215582 7292580 7401258 7499448 7509942 [,10] [,11] [,12] [1,] 1056978 1068672 1089696 [2,] 1896726 1907256 1962198 [3,] 3215886 3123060 3325101 [4,] 5450760 5242854 5439066 [5,] 7521504 7325298 7521504 $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,] 1238386 1161918 1124052 1200618 1385835 1505482 1516582 1385303 1510853 [2,] 4179482 4124184 4369818 4446216 4773801 4947314 4915196 4969471 5029633 [,10] [,11] [,12] [1,] 1440149 1456462 1587919 [2,] 4991623 4789658 5062283 $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(1155168, 1657302, 2708934, 4600518, 6485550, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xlju1373029761.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,] 1046484 1133976 1591836 2005446 2365110 2920992 3684768 4556238 5439066 [2,] 1062825 1193583 1673661 2060220 2436261 3155697 4022400 4888950 5804679 [3,] 1122948 1455249 1896726 2283897 2784984 3515463 4403706 5341575 6333168 [4,] 1155168 1526400 1945839 2365710 2877744 3597192 4485519 5423304 6447633 [5,] 1155168 1559118 1984254 2419884 2965434 3684768 4535046 5450760 6518268 [,10] [,11] [1,] 6365304 NA [2,] 6747195 NA [3,] 7308939 NA [4,] 7504695 NA [5,] 7521504 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,] 1080830 1303449 1772584 2144561 2583621 3314094 4192474 5097853 6039912 [2,] 1165066 1607049 2020868 2423233 2986347 3716832 4614938 5585297 6626424 [,10] [,11] [1,] 6963438 NA [2,] 7654440 NA $out [1] 1330188 1318626 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(1046484, 1062825, 1122948, 1155168, 1155168, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a3lx1373029761.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,] 1834132 5231328 2637618 [2,] 1985409 5624247 2926562 [3,] 2106279 6110022 3060416 [4,] 2183637 6442386 3152938 [5,] 2219537 6464526 3229658 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2015865 5736863 2957164 [2,] 2196692 6483181 3163668 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(1834132.17703251, 1985408.96145779, 2106278.78531966, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17www1373029761.ps tmp/17www1373029761.png",intern=TRUE)) character(0) > try(system("convert tmp/2kr5z1373029761.ps tmp/2kr5z1373029761.png",intern=TRUE)) character(0) > try(system("convert tmp/38ust1373029761.ps tmp/38ust1373029761.png",intern=TRUE)) character(0) > try(system("convert tmp/45kjp1373029761.ps tmp/45kjp1373029761.png",intern=TRUE)) character(0) > try(system("convert tmp/5xlju1373029761.ps tmp/5xlju1373029761.png",intern=TRUE)) character(0) > try(system("convert tmp/6a3lx1373029761.ps tmp/6a3lx1373029761.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.035 0.866 5.022