R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(149,143,135,126,119,133,134,123,147,144,150,140,165,173,167,161,151,163,158,152,176,170,168,164,185,186,184,179,171,187,191,176,204,196,193,179,195,201,192,181,171,177,176,155,173,167,164,152,173,162,158,154,151,160,160,143,170,166,153,144) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 149 165 185 195 173 NA [2,] 143 173 186 201 162 NA [3,] 135 167 184 192 158 NA [4,] 126 161 179 181 154 NA [5,] 119 151 171 171 151 NA [6,] 133 163 187 177 160 NA [7,] 134 158 191 176 160 NA [8,] 123 152 176 155 143 NA [9,] 147 176 204 173 170 NA [10,] 144 170 196 167 166 NA [11,] 150 168 193 164 153 NA [12,] 140 164 179 152 144 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/1tm6u1479403259.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/2gqix1479403259.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/3dcm21479403259.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/45w7k1479403259.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] [,10] [,11] [,12] [1,] 149 143 135 126 151 160 134 143 170 166 150 140 [2,] 165 162 158 154 151 160 158 143 170 166 153 144 [3,] 173 173 167 161 151 163 160 152 173 167 164 152 [4,] 185 186 184 179 171 177 176 155 176 170 168 164 [5,] 195 201 192 181 171 187 191 155 176 170 168 179 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 158.8681 156.0417 148.6285 143.3351 136.8681 150.9878 147.2812 143.5208 [2,] 187.1319 189.9583 185.3715 178.6649 165.1319 175.0122 172.7188 160.4792 [,9] [,10] [,11] [,12] [1,] 168.7604 164.1736 153.401 137.8681 [2,] 177.2396 169.8264 174.599 166.1319 $out [1] 119 133 123 176 147 204 144 196 193 $group [1] 5 6 8 8 9 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(149, 165, 173, 185, 195, 143, 162, 173, 186, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g9051479403259.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,] 119.0 151.0 171.0 152.0 143 NA [2,] 129.5 159.5 179.0 165.5 152 NA [3,] 137.5 164.5 185.5 174.5 159 NA [4,] 145.5 169.0 192.0 186.5 164 NA [5,] 150.0 176.0 204.0 201.0 173 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 130.2023 160.167 179.5706 164.9218 153.5267 NA [2,] 144.7977 168.833 191.4294 184.0782 164.4733 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(119, 129.5, 137.5, 145.5, 150, 151, 159.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gm6a1479403259.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,] 15.88081 39.0 4.0 [2,] 18.14336 49.0 13.5 [3,] 20.38979 53.5 19.0 [4,] 21.78685 57.0 22.0 [5,] 22.46553 58.0 26.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 18.72797 49.85115 15.12309 [2,] 22.05161 57.14885 22.87691 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(15.8808060248843, 18.1433551032241, 20.3897927510243, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tm6u1479403259.ps tmp/1tm6u1479403259.png",intern=TRUE)) character(0) > try(system("convert tmp/2gqix1479403259.ps tmp/2gqix1479403259.png",intern=TRUE)) character(0) > try(system("convert tmp/3dcm21479403259.ps tmp/3dcm21479403259.png",intern=TRUE)) character(0) > try(system("convert tmp/45w7k1479403259.ps tmp/45w7k1479403259.png",intern=TRUE)) character(0) > try(system("convert tmp/5g9051479403259.ps tmp/5g9051479403259.png",intern=TRUE)) character(0) > try(system("convert tmp/6gm6a1479403259.ps tmp/6gm6a1479403259.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.658 0.195 2.927