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(111.4,117,141.7,120,132.1,146.7,122.5,99.6,122.7,139,117.8,125.5,134.5,121.3,126.7,117.7,123,132.1,113.1,89.2,121.7,105.3,85.3,105.3,72.2,92.1,97.2,78.6,78.1,93,81,65.9,88.6,85.7,76.3,96.8,76.8,85.6,119.2,91.4,95.7,112.3,95.2,82.8,111.3,108.2,97,124.4,99.3,117.6,131.5,114.2,116.8,116.5,105.4,89.2,115.8,111.4,106.4,128.4,107.7,111,129.8,130.5,142.9,159.9,84.1,75,100.7,106.8,97.4,113,76.9,87.3,103.7,92.1,92.9,112.2,88.7,74.6,101.5,119.7,120.7,153.5) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 111.4 134.5 72.2 76.8 99.3 107.7 76.9 NA [2,] 117.0 121.3 92.1 85.6 117.6 111.0 87.3 NA [3,] 141.7 126.7 97.2 119.2 131.5 129.8 103.7 NA [4,] 120.0 117.7 78.6 91.4 114.2 130.5 92.1 NA [5,] 132.1 123.0 78.1 95.7 116.8 142.9 92.9 NA [6,] 146.7 132.1 93.0 112.3 116.5 159.9 112.2 NA [7,] 122.5 113.1 81.0 95.2 105.4 84.1 88.7 NA [8,] 99.6 89.2 65.9 82.8 89.2 75.0 74.6 NA [9,] 122.7 121.7 88.6 111.3 115.8 100.7 101.5 NA [10,] 139.0 105.3 85.7 108.2 111.4 106.8 119.7 NA [11,] 117.8 85.3 76.3 97.0 106.4 97.4 120.7 NA [12,] 125.5 105.3 96.8 124.4 128.4 113.0 153.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5.6 -13.2 19.9 8.8 18.3 3.3 10.4 NA [2,] 24.7 5.4 5.1 33.6 13.9 18.8 16.4 NA [3,] -21.7 -9.0 -18.6 -27.8 -17.3 0.7 -11.6 NA [4,] 12.1 5.3 -0.5 4.3 2.6 12.4 0.8 NA [5,] 14.6 9.1 14.9 16.6 -0.3 17.0 19.3 NA [6,] -24.2 -19.0 -12.0 -17.1 -11.1 -75.8 -23.5 NA [7,] -22.9 -23.9 -15.1 -12.4 -16.2 -9.1 -14.1 NA [8,] 23.1 32.5 22.7 28.5 26.6 25.7 26.9 NA [9,] 16.3 -16.4 -2.9 -3.1 -4.4 6.1 18.2 NA [10,] -21.2 -20.0 -9.4 -11.2 -5.0 -9.4 1.0 NA [11,] 7.7 20.0 20.5 27.4 22.0 15.6 32.8 NA [12,] 9.0 -33.1 -20.0 -25.1 -20.7 -36.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/1iacs1412782219.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/2t8i11412782219.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/37mjt1412782219.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/4ptgi1412782219.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,] 72.20 85.6 97.20 78.60 78.10 93.00 81.00 65.9 88.60 105.30 76.30 [2,] 76.85 89.7 111.45 91.75 94.30 112.25 86.40 74.8 101.10 106.05 91.15 [3,] 99.30 111.0 126.70 114.20 116.80 116.50 95.20 82.8 111.30 108.20 97.40 [4,] 109.55 117.3 130.65 118.85 127.55 139.40 109.25 89.2 118.75 115.55 112.10 [5,] 134.50 121.3 141.70 130.50 142.90 159.90 122.50 99.6 122.70 119.70 120.70 [,12] [1,] 96.80 [2,] 109.15 [3,] 124.40 [4,] 126.95 [5,] 153.50 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.77209 94.51773 115.2341 98.01632 96.94364 100.2865 81.55435 [2,] 118.82791 127.48227 138.1659 130.38368 136.65636 132.7135 108.84565 [,8] [,9] [,10] [,11] [,12] [1,] 74.20055 100.7597 102.5268 84.889 113.7701 [2,] 91.39945 121.8403 113.8732 109.911 135.0299 $out [1] 139.0 85.7 $group [1] 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(72.2, 76.85, 99.3, 109.55, 134.5, 85.6, 89.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56e8m1412782219.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,] 3.30 5.10 -27.80 -0.5 9.10 -24.20 -23.90 22.7 -16.40 -21.2 7.7 -36.1 [2,] 4.45 9.65 -20.15 1.7 11.85 -23.85 -19.55 24.4 -3.75 -15.6 17.8 -33.1 [3,] 8.80 16.40 -17.30 4.3 14.90 -19.00 -15.10 26.6 -2.90 -9.4 20.5 -22.9 [4,] 14.35 21.75 -10.30 8.7 16.80 -14.55 -13.25 27.7 11.20 -7.2 24.7 -20.0 [5,] 19.90 33.60 0.70 12.4 19.30 -11.10 -9.10 32.5 18.20 1.0 32.8 -20.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.88788 9.174075 -23.18226 0.1197129 11.94394 -24.55381 -18.86226 [2,] 14.71212 23.625925 -11.41774 8.4802871 17.85606 -13.44619 -11.33774 [,8] [,9] [,10] [,11] [,12] [1,] 24.62929 -11.827899 -14.416344 16.37943 -31.34992 [2,] 28.57071 6.027899 -4.383656 24.62057 -14.45008 $out [1] -13.2 -0.3 -75.8 9.0 $group [1] 1 5 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3.3, 4.45, 8.8, 14.35, 19.9, 5.10000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ae0r1412782219.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] [1,] 99.60 85.30 65.90 76.80 89.2 75.00 74.60 NA [2,] 117.40 105.30 77.20 88.50 105.9 99.05 88.00 NA [3,] 122.60 119.50 83.35 96.35 115.0 109.35 97.20 NA [4,] 135.55 124.85 92.55 111.80 117.2 130.15 115.95 NA [5,] 146.70 134.50 97.20 124.40 131.5 159.90 153.50 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 114.3217 110.5831 76.34876 85.72271 109.846 95.16508 84.45182 NA [2,] 130.8783 128.4169 90.35124 106.97729 120.154 123.53492 109.94818 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(99.6, 117.4, 122.6, 135.55, 146.7, 85.3, 105.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7z8q51412782219.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,] 82.32857 82.80 82.0000 [2,] 99.35000 98.35 99.7250 [3,] 107.62857 111.15 107.6125 [4,] 116.31429 116.65 114.4875 [5,] 124.67143 126.70 125.8250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.89105 102.8032 100.8792 [2,] 115.36610 119.4968 114.3458 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(82.3285714285714, 99.35, 107.628571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1iacs1412782219.ps tmp/1iacs1412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/2t8i11412782219.ps tmp/2t8i11412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/37mjt1412782219.ps tmp/37mjt1412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/4ptgi1412782219.ps tmp/4ptgi1412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/56e8m1412782219.ps tmp/56e8m1412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/6ae0r1412782219.ps tmp/6ae0r1412782219.png",intern=TRUE)) character(0) > try(system("convert tmp/7z8q51412782219.ps tmp/7z8q51412782219.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.416 0.422 2.868