R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 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(143.7,149.3,121.7,81,68.1,92.3,107.7,114.4,98.6,106.7,73.9,85.9,118.4,144.2,118.4,82.6,68,99.8,93.4,107.9,101.1,100.4,76.7,89.1,105.3,124.8,111.9,89,88.6,84.5,91.1,118.1,103.6,92.6,70.2,70.2,114.3,125.3,98.9,65.4,66,71.2,84.6,102.6,91.8,97.4,64.1,62.3,96.2,104.9,90.3,65.2,57.8,70.5,93.2,74.2,91.1,85,58.9,68.3,98.1,110.5,77.6,55.1,49.8,58.5,86.5,88.8,94,65,52.2,70.9) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 143.7 118.4 105.3 114.3 96.2 98.1 NA [2,] 149.3 144.2 124.8 125.3 104.9 110.5 NA [3,] 121.7 118.4 111.9 98.9 90.3 77.6 NA [4,] 81.0 82.6 89.0 65.4 65.2 55.1 NA [5,] 68.1 68.0 88.6 66.0 57.8 49.8 NA [6,] 92.3 99.8 84.5 71.2 70.5 58.5 NA [7,] 107.7 93.4 91.1 84.6 93.2 86.5 NA [8,] 114.4 107.9 118.1 102.6 74.2 88.8 NA [9,] 98.6 101.1 103.6 91.8 91.1 94.0 NA [10,] 106.7 100.4 92.6 97.4 85.0 65.0 NA [11,] 73.9 76.7 70.2 64.1 58.9 52.2 NA [12,] 85.9 89.1 70.2 62.3 68.3 70.9 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 5.6 25.8 19.5 11.0 8.7 12.4 NA [2,] -27.6 -25.8 -12.9 -26.4 -14.6 -32.9 NA [3,] -40.7 -35.8 -22.9 -33.5 -25.1 -22.5 NA [4,] -12.9 -14.6 -0.4 0.6 -7.4 -5.3 NA [5,] 24.2 31.8 -4.1 5.2 12.7 8.7 NA [6,] 15.4 -6.4 6.6 13.4 22.7 28.0 NA [7,] 6.7 14.5 27.0 18.0 -19.0 2.3 NA [8,] -15.8 -6.8 -14.5 -10.8 16.9 5.2 NA [9,] 8.1 -0.7 -11.0 5.6 -6.1 -29.0 NA [10,] -32.8 -23.7 -22.4 -33.3 -26.1 -12.8 NA [11,] 12.0 12.4 0.0 -1.8 9.4 18.7 NA [12,] 32.5 16.2 44.1 33.9 29.8 NA 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/11zao1445596908.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/2qm3h1445596908.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/3q7mf1445596908.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/4ho471445596908.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,] 96.2 104.90 77.6 55.1 49.8 58.50 84.60 74.20 91.1 65.0 52.20 62.30 [2,] 98.1 110.50 90.3 65.2 57.8 70.50 86.50 88.80 91.8 85.0 58.90 68.30 [3,] 109.8 125.05 105.4 73.2 67.0 77.85 92.15 105.25 96.3 95.0 67.15 70.55 [4,] 118.4 144.20 118.4 82.6 68.1 92.30 93.40 114.40 101.1 100.4 73.90 85.90 [5,] 143.7 149.30 121.7 89.0 68.1 99.80 93.40 118.10 103.6 106.7 76.70 89.10 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.70584 103.3124 87.27459 61.97644 60.35617 63.7883 87.69928 88.73717 [2,] 122.89416 146.7876 123.52541 84.42356 73.64383 91.9117 96.60072 121.76283 [,9] [,10] [,11] [,12] [1,] 90.3012 85.0665 57.47452 59.19743 [2,] 102.2988 104.9335 76.82548 81.90257 $out [1] 88.6 107.7 $group [1] 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(96.2, 98.1, 109.8, 118.4, 143.7, 104.9, 110.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vt3s1445596908.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,] 5.6 -32.9 -40.7 -14.60 -4.1 -6.4 -19.0 -15.8 -29.0 -33.3 -1.8 29.8 [2,] 8.7 -27.6 -35.8 -12.90 5.2 6.6 2.3 -14.5 -11.0 -32.8 0.0 29.8 [3,] 11.7 -26.1 -29.3 -6.35 10.7 14.4 10.6 -8.8 -3.4 -24.9 10.7 32.5 [4,] 19.5 -14.6 -22.9 -0.40 24.2 22.7 18.0 5.2 5.6 -22.4 12.4 33.9 [5,] 25.8 -12.9 -22.5 0.60 31.8 28.0 27.0 16.9 8.1 -12.8 18.7 33.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.733651 -34.48542 -37.62092 -14.412904 -1.555614 4.01498 0.4729929 [2,] 18.666349 -17.71458 -20.97908 1.712904 22.955614 24.78502 20.7270071 [,8] [,9] [,10] [,11] [,12] [1,] -21.507136 -14.107536 -31.60834 2.701599 29.60295 [2,] 3.907136 7.307536 -18.19166 18.698401 35.39705 $out [1] 16.2 44.1 $group [1] 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5.60000000000002, 8.7, 11.7, 19.5, 25.8, -32.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xvvq1445596908.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,] 68.10 68.00 70.20 62.30 57.80 49.80 NA [2,] 83.45 85.85 86.55 65.70 66.75 56.80 NA [3,] 102.65 100.10 91.85 88.20 79.60 74.25 NA [4,] 118.05 113.15 108.60 100.75 92.15 91.40 NA [5,] 149.30 144.20 124.80 125.30 104.90 110.50 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 86.86871 87.64829 81.79285 72.21346 68.01489 58.46871 NA [2,] 118.43129 112.55171 101.90715 104.18654 91.18511 90.03129 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(68.1, 83.45, 102.65, 118.05, 149.3, 68, 85.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7l2uh1445596908.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,] 66.00000 67.000 63.96250 [2,] 73.75000 71.875 74.59375 [3,] 91.96667 93.575 91.88750 [4,] 102.06667 105.325 103.56250 [5,] 126.50000 125.050 126.77500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 79.05124 78.31823 78.67466 [2,] 104.88209 108.83177 105.10034 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(66, 73.75, 91.9666666666667, 102.066666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11zao1445596908.ps tmp/11zao1445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/2qm3h1445596908.ps tmp/2qm3h1445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/3q7mf1445596908.ps tmp/3q7mf1445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/4ho471445596908.ps tmp/4ho471445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/5vt3s1445596908.ps tmp/5vt3s1445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/6xvvq1445596908.ps tmp/6xvvq1445596908.png",intern=TRUE)) character(0) > try(system("convert tmp/7l2uh1445596908.ps tmp/7l2uh1445596908.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.412 0.506 2.916