R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(89.8,101.7,92.7,116.2,134.2,153.3,129.7,137.6,158.8,197.1,171.1,184.4,216.6,219.3,184.2,205.3,216.8,219.4,172.1,165.3,178.9,163,116.2,121.8,124.1,125.7,81.8,94.8,121.5,136.3,109.6,120.7,154.1,154.4,153.3,157.3,192.1,223,220.6,221.7,239.2,251.2,238.3,240.6,250.3,256.7,239.2,189.9,155.9,138.4,124.7,119.4,116,124.9,123.4,124.4,135.5,143.6,130.6,116.6,118.2,116.1,106,94.9,97.1,96.8,93.7,91,105.7,112.9,112.1,112.9,127,136.5,130.9,136.3) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > x <- na.omit(x) > (n <- length(x)) [1] 76 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 7 7 7 7 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 89.8 216.6 124.1 192.1 155.9 118.2 127.0 [2,] 101.7 219.3 125.7 223.0 138.4 116.1 136.5 [3,] 92.7 184.2 81.8 220.6 124.7 106.0 130.9 [4,] 116.2 205.3 94.8 221.7 119.4 94.9 136.3 [5,] 134.2 216.8 121.5 239.2 116.0 97.1 NA [6,] 153.3 219.4 136.3 251.2 124.9 96.8 NA [7,] 129.7 172.1 109.6 238.3 123.4 93.7 NA [8,] 137.6 165.3 120.7 240.6 124.4 91.0 NA [9,] 158.8 178.9 154.1 250.3 135.5 105.7 NA [10,] 197.1 163.0 154.4 256.7 143.6 112.9 NA [11,] 171.1 116.2 153.3 239.2 130.6 112.1 NA [12,] 184.4 121.8 157.3 189.9 116.6 112.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 11.9 2.7 1.6 30.9 -17.5 -2.1 9.5 [2,] -9.0 -35.1 -43.9 -2.4 -13.7 -10.1 -5.6 [3,] 23.5 21.1 13.0 1.1 -5.3 -11.1 5.4 [4,] 18.0 11.5 26.7 17.5 -3.4 2.2 NA [5,] 19.1 2.6 14.8 12.0 8.9 -0.3 NA [6,] -23.6 -47.3 -26.7 -12.9 -1.5 -3.1 NA [7,] 7.9 -6.8 11.1 2.3 1.0 -2.7 NA [8,] 21.2 13.6 33.4 9.7 11.1 14.7 NA [9,] 38.3 -15.9 0.3 6.4 8.1 7.2 NA [10,] -26.0 -46.8 -1.1 -17.5 -13.0 -0.8 NA [11,] 13.3 5.6 4.0 -49.3 -14.0 0.8 NA [12,] 32.2 2.3 34.8 -34.0 1.6 14.1 NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/wessaorg/rcomp/tmp/14a6y1476370782.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2vfx41476370782.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3pizc1476370782.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4rf561476370782.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] [1,] 89.80 101.70 81.80 94.80 97.10 96.8 93.70 91.0 105.70 112.9 112.10 [2,] 121.15 120.90 99.35 105.55 116.00 124.9 109.60 120.7 135.50 143.6 116.20 [3,] 127.00 136.50 124.70 119.40 127.85 144.8 126.55 131.0 156.45 158.7 141.95 [4,] 174.00 178.85 157.55 170.80 216.80 219.4 172.10 165.3 178.90 197.1 171.10 [5,] 216.60 223.00 220.60 221.70 239.20 251.2 238.30 165.3 178.90 256.7 239.20 [,12] [1,] 112.90 [2,] 116.60 [3,] 139.55 [4,] 184.40 [5,] 189.90 $n [1] 7 7 7 7 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.43883 101.8932 89.9439 80.43375 62.83074 83.84445 86.23548 [2,] 158.56117 171.1068 159.4561 158.36625 192.86926 205.75555 166.86452 [,8] [,9] [,10] [,11] [,12] [1,] 102.2316 128.4556 124.1908 106.5377 95.81681 [2,] 159.7684 184.4444 193.2092 177.3623 183.28319 $out [1] 240.6 250.3 $group [1] 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(89.8, 121.15, 127, 174, 216.6, 101.7, 120.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51cae1476370782.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -2.10 -43.9 -11.10 -3.4 -0.30 -47.30 -6.80 9.70 0.3 -46.80 -14.0 -34.0 [2,] -0.25 -24.4 -2.10 2.2 2.60 -26.70 -2.70 11.10 0.3 -26.00 -14.0 1.6 [3,] 2.70 -10.1 5.40 14.5 10.45 -18.25 1.65 14.15 6.8 -15.25 2.4 8.2 [4,] 10.70 -7.3 17.05 18.0 14.80 -3.10 7.90 21.20 8.1 -1.10 5.6 32.2 [5,] 11.90 -2.4 23.50 26.7 19.10 -1.50 11.10 33.40 8.1 -0.80 13.3 34.8 $n [1] 7 7 7 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3.839163 -20.3118441 -6.036071 4.30849 2.580606 -33.472762 -5.187342 [2,] 9.239163 0.1118441 16.836071 24.69151 18.319394 -3.027238 8.487342 [,8] [,9] [,10] [,11] [,12] [1,] 7.635174 1.768748 -31.3113042 -10.24263 -11.53799 [2,] 20.664826 11.831252 0.8113042 15.04263 27.93799 $out [1] 30.9 -17.5 38.3 -15.9 -49.3 $group [1] 1 1 9 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.10000000000001, -0.25, 2.70000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6x67a1476370782.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] [1,] 89.80 116.20 81.80 189.90 116.00 91.00 127.00 [2,] 108.95 164.15 115.15 221.15 121.40 95.85 128.95 [3,] 135.90 181.55 124.90 238.75 124.80 105.85 133.60 [4,] 164.95 216.70 153.70 245.45 136.95 112.90 136.40 [5,] 197.10 219.40 157.30 256.70 155.90 118.20 136.50 $n [1] 12 12 12 12 12 12 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 110.358 157.5816 107.3171 227.6666 117.7075 98.07338 127.7145 [2,] 161.442 205.5184 142.4829 249.8334 131.8925 113.62662 139.4855 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(89.8, 108.95, 135.9, 164.95, 197.1, 116.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b7up1476370782.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 134.4143 119.400 128.4500 [2,] 145.3548 126.775 139.0875 [3,] 149.3393 133.750 147.6687 [4,] 158.8917 143.375 156.8875 [5,] 171.2833 158.700 167.4375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 143.1650 126.1786 139.5501 [2,] 155.5136 141.3214 155.7874 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(134.414285714286, 145.354761904762, 149.339285714286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14a6y1476370782.ps tmp/14a6y1476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/2vfx41476370782.ps tmp/2vfx41476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/3pizc1476370782.ps tmp/3pizc1476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/4rf561476370782.ps tmp/4rf561476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/51cae1476370782.ps tmp/51cae1476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/6x67a1476370782.ps tmp/6x67a1476370782.png",intern=TRUE)) character(0) > try(system("convert tmp/7b7up1476370782.ps tmp/7b7up1476370782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.646 0.159 2.850