R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(124275,58605,21828,42811,65963,128457,26867,143540,107458,258558,22475,294584,159848,289458,117950,78351,84589,44324,52285,185486,23846,13257,166999,148488,74747,55700,218584,187888,44788,18840,48787,69100,41892,90588,148574,50201,86828,102785,118844,145288,56790,287525,187880,87740,55258,58769,43366,77051,91574,15533,18425,65192,81059,73322,91261,86166,61842,25192,21059,15855,12618,101667,224275,55700,60748,41848,61781,120077,42032,46485,36861,55027,48999,68352,126987,86526,125340,69029,153287,135724,92108,119906,79798,97206) > 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] [,7] [,8] [1,] 124275 159848 74747 86828 91574 12618 48999 NA [2,] 58605 289458 55700 102785 15533 101667 68352 NA [3,] 21828 117950 218584 118844 18425 224275 126987 NA [4,] 42811 78351 187888 145288 65192 55700 86526 NA [5,] 65963 84589 44788 56790 81059 60748 125340 NA [6,] 128457 44324 18840 287525 73322 41848 69029 NA [7,] 26867 52285 48787 187880 91261 61781 153287 NA [8,] 143540 185486 69100 87740 86166 120077 135724 NA [9,] 107458 23846 41892 55258 61842 42032 92108 NA [10,] 258558 13257 90588 58769 25192 46485 119906 NA [11,] 22475 166999 148574 43366 21059 36861 79798 NA [12,] 294584 148488 50201 77051 15855 55027 97206 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/fisher/rcomp/tmp/1r6ls1354127374.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/fisher/rcomp/tmp/2vlpr1354127374.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/fisher/rcomp/tmp/3lovc1354127374.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/fisher/rcomp/tmp/45z7o1354127374.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,] 12618.0 15533.0 18425.0 42811 44788 18840.0 26867 69100 23846 [2,] 61873.0 57152.5 69889.0 60446 58769 43086.0 50536 86953 41962 [3,] 86828.0 68352.0 118844.0 78351 65963 69029.0 61781 120077 55258 [4,] 107924.5 102226.0 172785.5 115907 82824 100889.5 122274 139632 76975 [5,] 159848.0 102785.0 224275.0 187888 84589 128457.0 187880 185486 107458 [,10] [,11] [,12] [1,] 13257.0 21059 15855 [2,] 35838.5 29668 52614 [3,] 58769.0 43366 77051 [4,] 105247.0 114186 122847 [5,] 119906.0 166999 148488 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 59326.79 41434.83 57395.87 45230.59 51597.74 34509.68 18940.22 [2,] 114329.21 95269.17 180292.13 111471.41 80328.26 103548.32 104621.78 [,8] [,9] [,10] [,11] [,12] [1,] 88617.95 34348.8 17319.36 -7106.786 35108.99 [2,] 151536.05 76167.2 100218.64 93838.786 118993.01 $out [1] 289458 125340 287525 258558 294584 $group [1] 2 5 6 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12618, 61873, 86828, 107924.5, 159848, 15533, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/545nj1354127374.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] [1,] 21828.0 13257.0 18840.0 43366.0 15533.0 12618.0 48999.0 NA [2,] 34839.0 48304.5 46787.5 57779.5 19742.0 41940.0 74413.5 NA [3,] 86710.5 101269.5 62400.0 87284.0 63517.0 55363.5 94657.0 NA [4,] 135998.5 163423.5 119581.0 132066.0 83612.5 81724.0 126163.5 NA [5,] 258558.0 289458.0 218584.0 187880.0 91574.0 120077.0 153287.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 40570.97 48762.95 29198.4 53401.43 34385.24 37217.75 71053.48 NA [2,] 132850.03 153776.05 95601.6 121166.57 92648.76 73509.25 118260.52 NA $out [1] 294584 287525 224275 $group [1] 1 4 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(21828, 34839, 86710.5, 135998.5, 258558, 13257, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6imek1354127374.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,] 26417.33 80552.0 24055.00 [2,] 44258.28 130731.5 45562.50 [3,] 60207.10 154121.5 56632.25 [4,] 86528.92 256993.0 70985.50 [5,] 93202.82 278729.0 102896.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 40927.17 96532.78 45036.65 [2,] 79487.02 211710.22 68227.85 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(26417.3331915313, 44258.2762345433, 60207.0966058022, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r6ls1354127374.ps tmp/1r6ls1354127374.png",intern=TRUE)) character(0) > try(system("convert tmp/2vlpr1354127374.ps tmp/2vlpr1354127374.png",intern=TRUE)) character(0) > try(system("convert tmp/3lovc1354127374.ps tmp/3lovc1354127374.png",intern=TRUE)) character(0) > try(system("convert tmp/45z7o1354127374.ps tmp/45z7o1354127374.png",intern=TRUE)) character(0) > try(system("convert tmp/545nj1354127374.ps tmp/545nj1354127374.png",intern=TRUE)) character(0) > try(system("convert tmp/6imek1354127374.ps tmp/6imek1354127374.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.017 0.765 3.775