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(209.704,208.923,208.131,206.492,222.706,221.848,209.704,201.630,202.411,202.411,203.280,204.842,207.273,207.273,205.711,201.630,222.706,225.918,221.067,209.704,214.566,207.273,210.562,212.135,213.774,209.704,210.562,204.842,222.706,228.349,223.498,214.566,224.279,213.774,223.498,222.706,225.137,216.205,225.918,225.137,239.712,236.423,223.498,216.986,225.918,213.774,222.706,224.279,227.568,220.286,224.279,226.710,235.642,228.349,218.636,208.131,217.855,191.125,204.061,211.343,218.636,208.131,208.131,208.131,213.774,205.711,195.129,186.274,192.698,167.618,182.985,191.917,193.556,184.624,185.405,182.985,191.125,185.405,174.130,165.979,179.762,149.831,169.268,178.123,178.123,167.618,157.905,157.124,165.979,157.905,142.549,131.967,143.330,116.611,140.899,153.824,157.905,148.973,137.687,145.761,148.973,146.542,122.243,110.968,119.031,94.743,119.823,128.755,136.037,123.893,112.530,119.031,122.243,115.819,91.531,80.949,90.662,63.943,93.093,110.968) > 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,] 209.704 207.273 213.774 225.137 227.568 218.636 193.556 178.123 157.905 [2,] 208.923 207.273 209.704 216.205 220.286 208.131 184.624 167.618 148.973 [3,] 208.131 205.711 210.562 225.918 224.279 208.131 185.405 157.905 137.687 [4,] 206.492 201.630 204.842 225.137 226.710 208.131 182.985 157.124 145.761 [5,] 222.706 222.706 222.706 239.712 235.642 213.774 191.125 165.979 148.973 [6,] 221.848 225.918 228.349 236.423 228.349 205.711 185.405 157.905 146.542 [7,] 209.704 221.067 223.498 223.498 218.636 195.129 174.130 142.549 122.243 [8,] 201.630 209.704 214.566 216.986 208.131 186.274 165.979 131.967 110.968 [9,] 202.411 214.566 224.279 225.918 217.855 192.698 179.762 143.330 119.031 [10,] 202.411 207.273 213.774 213.774 191.125 167.618 149.831 116.611 94.743 [11,] 203.280 210.562 223.498 222.706 204.061 182.985 169.268 140.899 119.823 [12,] 204.842 212.135 222.706 224.279 211.343 191.917 178.123 153.824 128.755 [,10] [,11] [1,] 136.037 NA [2,] 123.893 NA [3,] 112.530 NA [4,] 119.031 NA [5,] 122.243 NA [6,] 115.819 NA [7,] 91.531 NA [8,] 80.949 NA [9,] 90.662 NA [10,] 63.943 NA [11,] 93.093 NA [12,] 110.968 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/17t8y1437392319.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/2j5701437392319.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/3fj8s1437392319.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/4g7p91437392319.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] [1,] 136.0370 123.893 112.530 119.031 122.243 115.8190 91.5310 80.949 [2,] 178.1230 167.618 157.905 157.124 165.979 157.9050 142.5490 131.967 [3,] 208.4885 207.702 206.921 203.236 218.240 213.7795 202.4165 193.952 [4,] 218.6360 209.704 210.562 208.131 222.706 228.3490 221.0670 209.704 [5,] 227.5680 220.286 225.918 226.710 239.712 236.4230 223.4980 216.986 [,9] [,10] [,11] [,12] [1,] 90.6620 63.9430 93.0930 110.9680 [2,] 143.3300 116.6110 140.8990 153.8240 [3,] 197.5545 179.3715 193.1325 198.3795 [4,] 217.8550 207.2730 210.5620 212.1350 [5,] 225.9180 213.7740 223.4980 224.2790 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 188.2466 186.6742 180.6115 177.7509 189.8969 178.5829 163.1858 155.1115 [2,] 228.7304 228.7298 233.2305 228.7211 246.5831 248.9761 241.6472 232.7925 [,9] [,10] [,11] [,12] [1,] 160.3188 134.0732 158.3261 169.245 [2,] 234.7902 224.6698 227.9389 227.514 $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(136.037, 178.123, 208.4885, 218.636, 227.568, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5eg0r1437392319.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,] 201.6300 201.6300 204.842 213.774 191.125 167.6180 165.9790 116.611 [2,] 202.8455 207.2730 212.168 219.846 209.737 189.0955 171.6990 141.724 [3,] 207.3115 210.1330 218.636 224.708 219.461 200.4200 181.3735 155.474 [4,] 209.7040 217.8165 223.498 225.918 227.139 208.1310 185.4050 161.942 [5,] 209.7040 225.9180 228.349 225.918 235.642 218.6360 193.5560 178.123 [,9] [,10] [,11] [1,] 94.7430 63.9430 NA [2,] 119.4270 91.0965 NA [3,] 133.2210 111.7490 NA [4,] 147.7575 120.6370 NA [5,] 157.9050 136.0370 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 204.1833 205.324 213.4683 221.9385 211.5238 191.7378 175.1221 146.2524 [2,] 210.4397 214.942 223.8037 227.4775 227.3982 209.1022 187.6249 164.6956 [,9] [,10] [,11] [1,] 120.2993 98.27538 NA [2,] 146.1427 125.22262 NA $out [1] 222.706 221.848 239.712 236.423 149.831 $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(201.63, 202.8455, 207.3115, 209.704, 209.704, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/652z51437392319.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,] 30.46872 91.5310 35.43925 [2,] 37.34379 110.4950 44.65313 [3,] 41.02166 119.0365 56.49187 [4,] 47.73666 133.6115 66.71775 [5,] 54.02717 149.8310 81.14150 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 36.28140 108.4929 46.42805 [2,] 45.76192 129.5801 66.55570 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(30.4687248249013, 37.3437888757966, 41.0216582975861, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17t8y1437392319.ps tmp/17t8y1437392319.png",intern=TRUE)) character(0) > try(system("convert tmp/2j5701437392319.ps tmp/2j5701437392319.png",intern=TRUE)) character(0) > try(system("convert tmp/3fj8s1437392319.ps tmp/3fj8s1437392319.png",intern=TRUE)) character(0) > try(system("convert tmp/4g7p91437392319.ps tmp/4g7p91437392319.png",intern=TRUE)) character(0) > try(system("convert tmp/5eg0r1437392319.ps tmp/5eg0r1437392319.png",intern=TRUE)) character(0) > try(system("convert tmp/652z51437392319.ps tmp/652z51437392319.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.096 0.462 2.587