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(123.2,136.9,146.8,149.6,146.5,157,147.9,133.6,128.7,100.8,91.8,89.3,96.7,91.6,93.3,93.3,101,100.4,86.9,83.9,80.3,87.7,92.7,95.5,92,87.4,86.8,83.7,85,81.7,90.9,101.5,113.8,120.1,122.1,132.5,140,149.4,144.3,154.4,151.4,145.5,136.8,146.6,145.1,133.6,131.4,127.5,130.1,131.1,132.3,128.6,125.1,128.7,156.1,163.2,159.8,157.4,156.2,152.5,149.4,145.9,144.8,135.9,137.6,136,117.7,111.5,107.8,107.3,102.6,101) > 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,] 123.2 96.7 92.0 140.0 130.1 149.4 NA [2,] 136.9 91.6 87.4 149.4 131.1 145.9 NA [3,] 146.8 93.3 86.8 144.3 132.3 144.8 NA [4,] 149.6 93.3 83.7 154.4 128.6 135.9 NA [5,] 146.5 101.0 85.0 151.4 125.1 137.6 NA [6,] 157.0 100.4 81.7 145.5 128.7 136.0 NA [7,] 147.9 86.9 90.9 136.8 156.1 117.7 NA [8,] 133.6 83.9 101.5 146.6 163.2 111.5 NA [9,] 128.7 80.3 113.8 145.1 159.8 107.8 NA [10,] 100.8 87.7 120.1 133.6 157.4 107.3 NA [11,] 91.8 92.7 122.1 131.4 156.2 102.6 NA [12,] 89.3 95.5 132.5 127.5 152.5 101.0 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 13.7 -5.1 -4.6 9.4 1.0 -3.5 NA [2,] 9.9 1.7 -0.6 -5.1 1.2 -1.1 NA [3,] 2.8 0.0 -3.1 10.1 -3.7 -8.9 NA [4,] -3.1 7.7 1.3 -3.0 -3.5 1.7 NA [5,] 10.5 -0.6 -3.3 -5.9 3.6 -1.6 NA [6,] -9.1 -13.5 9.2 -8.7 27.4 -18.3 NA [7,] -14.3 -3.0 10.6 9.8 7.1 -6.2 NA [8,] -4.9 -3.6 12.3 -1.5 -3.4 -3.7 NA [9,] -27.9 7.4 6.3 -11.5 -2.4 -0.5 NA [10,] -9.0 5.0 2.0 -2.2 -1.2 -4.7 NA [11,] -2.5 2.8 10.4 -3.9 -3.7 -1.6 NA [12,] 7.4 -3.5 7.5 2.6 -3.1 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/13yjn1413037439.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/2wvb61413037439.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/3a3z81413037439.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/4avug1413037439.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,] 92.00 87.4 86.8 83.70 85.00 81.70 86.90 83.90 80.30 87.7 91.80 [2,] 96.70 91.6 93.3 93.30 101.00 100.40 90.90 101.50 107.80 100.8 92.70 [3,] 126.65 134.0 138.3 132.25 131.35 132.35 127.25 122.55 121.25 113.7 112.35 [4,] 140.00 145.9 144.8 149.60 146.50 145.50 147.90 146.60 145.10 133.6 131.40 [5,] 149.40 149.4 146.8 154.40 151.40 157.00 156.10 163.20 159.80 157.4 156.20 [,12] [1,] 89.30 [2,] 95.50 [3,] 114.25 [4,] 132.50 [5,] 152.50 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.7201 98.97475 105.0808 95.93468 102.001 103.259 90.48316 93.45904 [2,] 154.5799 169.02525 171.5192 168.56532 160.699 161.441 164.01684 151.64096 [,9] [,10] [,11] [,12] [1,] 97.1903 92.54294 87.38725 90.3838 [2,] 145.3097 134.85706 137.31275 138.1162 $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(92, 96.7, 126.65, 140, 149.4, 87.4, 91.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5c1em1413037439.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.10 -5.1 -8.90 -3.50 -5.9 -18.3 -14.30 -4.9 -27.90 -9.0 -3.90 -3.5 [2,] -4.60 -1.1 -3.70 -3.10 -3.3 -13.5 -6.20 -3.7 -11.50 -4.7 -3.70 -3.1 [3,] -1.25 0.3 -1.55 -0.85 -1.1 -8.9 2.05 -3.5 -1.45 -1.7 -2.05 2.6 [4,] 9.40 1.7 2.80 1.70 3.6 9.2 9.80 -1.5 6.30 2.0 2.80 7.4 [5,] 13.70 1.7 10.10 7.70 10.5 27.4 10.60 -1.5 7.40 5.0 10.40 7.5 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -10.280452 -1.50609 -5.74271 -3.946155 -5.550723 -23.542233 -8.270517 [2,] 7.780452 2.10609 2.64271 2.246155 3.350723 5.742233 12.370517 [,8] [,9] [,10] [,11] [,12] [1,] -4.919071 -12.93157 -6.021716 -6.24271 -4.819274 [2,] -2.080929 10.03157 2.621716 2.14271 10.019274 $out [1] 9.9 12.3 $group [1] 2 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-5.10000000000001, -4.59999999999999, -1.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l1h91413037439.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.30 80.3 81.70 127.5 125.1 101.00 NA [2,] 112.00 87.3 85.90 135.2 129.4 107.55 NA [3,] 135.25 93.0 91.45 144.7 142.4 126.80 NA [4,] 147.35 96.1 116.95 148.0 156.8 141.20 NA [5,] 157.00 101.0 132.50 154.4 163.2 149.40 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 119.1266 88.98626 77.28789 138.8618 129.9027 111.452 NA [2,] 151.3734 97.01374 105.61211 150.5382 154.8973 142.148 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(89.3, 112, 135.25, 147.35, 157, 80.3, 87.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/716eh1413037439.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,] 116.1333 112.35 112.1250 [2,] 119.8583 117.75 118.3750 [3,] 123.0500 126.95 123.1188 [4,] 124.3417 132.30 124.6500 [5,] 124.8833 138.30 125.6500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 121.0051 120.3136 120.2567 [2,] 125.0949 133.5864 125.9808 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(116.133333333333, 119.858333333333, 123.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13yjn1413037439.ps tmp/13yjn1413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/2wvb61413037439.ps tmp/2wvb61413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/3a3z81413037439.ps tmp/3a3z81413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/4avug1413037439.ps tmp/4avug1413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/5c1em1413037439.ps tmp/5c1em1413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/6l1h91413037439.ps tmp/6l1h91413037439.png",intern=TRUE)) character(0) > try(system("convert tmp/716eh1413037439.ps tmp/716eh1413037439.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.332 0.442 2.812