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(37729,48191,52498,57319,44377,48081,52597,53331,39587,46278,50365,57176,39251,47946,50427,54317,41210,50592,55728,59099,47519,53203,53882,55163,45255,50423,52161,54562,40971,48014,48440,44967,27218,30269,33234,36811,27745,31891,32398,34093,28358,29532,30769,32080,23951,34628,22978,35704,23090,22111,28925,35968,28963,34074,39160,51314,34527,40722,50609,52435) > par1 = '4' > par1 <- '4' > #'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] 15 > 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] 15 15 15 15 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 37729 44377 39587 39251 41210 47519 45255 40971 27218 27745 28358 23951 [2,] 48191 48081 46278 47946 50592 53203 50423 48014 30269 31891 29532 34628 [3,] 52498 52597 50365 50427 55728 53882 52161 48440 33234 32398 30769 22978 [4,] 57319 53331 57176 54317 59099 55163 54562 44967 36811 34093 32080 35704 [,13] [,14] [,15] [,16] [1,] 23090 28963 34527 NA [2,] 22111 34074 40722 NA [3,] 28925 39160 50609 NA [4,] 35968 51314 52435 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/1v6a11479218604.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/2uwji1479218604.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/3knvu1479218604.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/4s9pw1479218604.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] [1,] 23090.0 22111.0 22978.0 32080.0 [2,] 28051.5 32982.5 32816.0 36389.5 [3,] 37729.0 46278.0 50365.0 52435.0 [4,] 41090.5 48136.0 52329.5 54862.5 [5,] 47519.0 53203.0 55728.0 59099.0 $n [1] 15 15 15 15 $conf [,1] [,2] [,3] [,4] [1,] 32409.68 40096.07 42404.38 44898.86 [2,] 43048.32 52459.93 58325.62 59971.14 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(23090, 28051.5, 37729, 41090.5, 47519, 22111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pnva1479218604.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,] 37729.0 44377 39587.0 39251.0 41210.0 47519.0 45255.0 40971.0 27218.0 [2,] 42960.0 46229 42932.5 43598.5 45901.0 50361.0 47839.0 42969.0 28743.5 [3,] 50344.5 50339 48321.5 49186.5 53160.0 53542.5 51292.0 46490.5 31751.5 [4,] 54908.5 52964 53770.5 52372.0 57413.5 54522.5 53361.5 48227.0 35022.5 [5,] 57319.0 53331 57176.0 54317.0 59099.0 55163.0 54562.0 48440.0 36811.0 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 27745.0 28358.0 22978.0 22111.0 28963.0 34527.0 NA [2,] 29818.0 28945.0 23464.5 22600.5 31518.5 37624.5 NA [3,] 32144.5 30150.5 29289.5 26007.5 36617.0 45665.5 NA [4,] 33245.5 31424.5 35166.0 32446.5 45237.0 51522.0 NA [5,] 34093.0 32080.0 35704.0 35968.0 51314.0 52435.0 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 40905.18 45018.35 39759.48 42255.43 44065.12 50254.92 46929.22 42336.68 [2,] 59783.82 55659.65 56883.52 56117.57 62254.88 56830.08 55654.78 50644.32 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 26791.09 29436.78 28191.69 20045.31 18229.16 25779.39 34686.47 NA [2,] 36711.91 34852.22 32109.31 38533.68 33785.84 47454.61 56644.53 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] NA Warning message: In bxp(list(stats = c(37729, 42960, 50344.5, 54908.5, 57319, 44377, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67vx41479218604.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,] 8137.207 24429.0 13039.00 [2,] 8945.462 25724.0 14096.25 [3,] 9809.698 29055.5 16813.25 [4,] 10457.220 31921.0 18993.25 [5,] 11048.760 32750.0 19513.50 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 8615.41 24159.87 12944.62 [2,] 11003.99 33951.13 20681.88 $out numeric(0) $group numeric(0) $names [1] "S.D." "Range" "IQR" Warning message: In bxp(list(stats = c(8137.20722068579, 8945.46217425276, 9809.69833498928, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1v6a11479218604.ps tmp/1v6a11479218604.png",intern=TRUE)) character(0) > try(system("convert tmp/2uwji1479218604.ps tmp/2uwji1479218604.png",intern=TRUE)) character(0) > try(system("convert tmp/3knvu1479218604.ps tmp/3knvu1479218604.png",intern=TRUE)) character(0) > try(system("convert tmp/4s9pw1479218604.ps tmp/4s9pw1479218604.png",intern=TRUE)) character(0) > try(system("convert tmp/5pnva1479218604.ps tmp/5pnva1479218604.png",intern=TRUE)) character(0) > try(system("convert tmp/67vx41479218604.ps tmp/67vx41479218604.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.365 0.212 2.625