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(103.1,113.5,115.7,113.1,112.7,121.9,120.3,108.7,102.8,83.4,79.4,77.8,85.7,83.2,82,86.9,95.7,97.9,89.3,91.5,86.8,91,93.8,96.8,95.7,91.4,88.7,88.2,87.7,89.5,95.6,100.5,106.3,112,117.7,125,132.4,138.1,134.7,136.7,134.3,131.6,129.8,131.9,129.8,119.4,116.7,112.8,116,117.5,118.8,118.7,116.3,115.2,131.7,133.7,132.5,126.9,122.2,120.2,117.9,117.2,116.4,112.3,113.6,114.2,108,102.8,102.8,101.6,100.3,101.7) > 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,] 103.1 85.7 95.7 132.4 116.0 117.9 NA [2,] 113.5 83.2 91.4 138.1 117.5 117.2 NA [3,] 115.7 82.0 88.7 134.7 118.8 116.4 NA [4,] 113.1 86.9 88.2 136.7 118.7 112.3 NA [5,] 112.7 95.7 87.7 134.3 116.3 113.6 NA [6,] 121.9 97.9 89.5 131.6 115.2 114.2 NA [7,] 120.3 89.3 95.6 129.8 131.7 108.0 NA [8,] 108.7 91.5 100.5 131.9 133.7 102.8 NA [9,] 102.8 86.8 106.3 129.8 132.5 102.8 NA [10,] 83.4 91.0 112.0 119.4 126.9 101.6 NA [11,] 79.4 93.8 117.7 116.7 122.2 100.3 NA [12,] 77.8 96.8 125.0 112.8 120.2 101.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 10.4 -2.5 -4.3 5.7 1.5 -0.7 NA [2,] 2.2 -1.2 -2.7 -3.4 1.3 -0.8 NA [3,] -2.6 4.9 -0.5 2.0 -0.1 -4.1 NA [4,] -0.4 8.8 -0.5 -2.4 -2.4 1.3 NA [5,] 9.2 2.2 1.8 -2.7 -1.1 0.6 NA [6,] -1.6 -8.6 6.1 -1.8 16.5 -6.2 NA [7,] -11.6 2.2 4.9 2.1 2.0 -5.2 NA [8,] -5.9 -4.7 5.8 -2.1 -1.2 0.0 NA [9,] -19.4 4.2 5.7 -10.4 -5.6 -1.2 NA [10,] -4.0 2.8 5.7 -2.7 -4.7 -1.3 NA [11,] -1.6 3.0 7.3 -3.9 -2.0 1.4 NA [12,] 7.9 -1.1 7.4 3.2 -2.3 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/1tbdq1416834496.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/2pmi81416834496.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/38ib01416834496.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/4mynp1416834496.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,] 85.70 83.20 82.00 86.9 87.70 89.5 89.30 91.50 86.80 83.4 79.4 [2,] 95.70 91.40 88.70 88.2 95.70 97.9 95.60 100.50 102.80 91.0 93.8 [3,] 109.55 115.35 116.05 112.7 113.15 114.7 114.15 105.75 104.55 106.8 108.5 [4,] 117.90 117.50 118.80 118.7 116.30 121.9 129.80 131.90 129.80 119.4 117.7 [5,] 132.40 138.10 134.70 136.7 134.30 131.6 131.70 133.70 132.50 126.9 122.2 [,12] [1,] 77.80 [2,] 96.80 [3,] 107.25 [4,] 120.20 [5,] 125.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.23028 98.51466 96.63453 93.02651 99.86233 99.21922 92.0899 [2,] 123.86972 132.18534 135.46547 132.37349 126.43767 130.18078 136.2101 [,8] [,9] [,10] [,11] [,12] [1,] 85.49599 87.13413 88.48108 93.08373 92.15624 [2,] 126.00401 121.96587 125.11892 123.91627 122.34376 $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(85.7, 95.7, 109.55, 117.9, 132.4, 83.2, 91.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vnfz1416834496.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,] -4.3 -3.4 -4.1 -2.40 -2.7 -8.6 -11.60 -5.90 -19.4 -4.7 -3.9 -2.3 [2,] -2.5 -2.7 -2.6 -2.40 -1.1 -6.2 -5.20 -4.70 -10.4 -4.0 -2.0 -1.1 [3,] 0.4 -1.0 -0.3 -0.45 1.2 -1.7 2.05 -1.65 -3.4 -2.0 -0.1 3.2 [4,] 5.7 1.3 2.0 1.30 2.2 6.1 2.20 0.00 4.2 2.8 3.0 7.4 [5,] 10.4 2.2 4.9 1.30 2.2 16.5 4.90 5.80 5.7 5.7 7.3 7.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.889265 -3.580129 -3.267149 -2.83662 -0.9286066 -9.633897 -2.723239 [2,] 5.689265 1.580129 2.667149 1.93662 3.3286066 6.233897 6.823239 [,8] [,9] [,10] [,11] [,12] [1,] -4.681652 -12.817472 -6.38622 -3.325161 -2.806079 [2,] 1.381652 6.017472 2.38622 3.125161 9.206079 $out [1] 8.8 9.2 $group [1] 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.3, -2.5, 0.399999999999999, 5.69999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6toeo1416834496.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,] 77.8 82.00 87.70 112.80 115.2 100.30 NA [2,] 93.1 86.25 89.10 124.60 116.9 102.25 NA [3,] 110.7 90.15 95.65 131.75 119.5 110.15 NA [4,] 114.6 94.75 109.15 134.50 129.3 115.30 NA [5,] 121.9 97.90 125.00 138.10 133.7 117.90 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.8937 86.27309 86.50506 127.2345 113.8443 104.1978 NA [2,] 120.5063 94.02691 104.79494 136.2655 125.1557 116.1022 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(77.8, 93.1, 110.7, 114.6, 121.9, 82, 86.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75bi01416834496.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,] 105.0167 104.550 105.6000 [2,] 107.0917 107.025 106.6312 [3,] 109.7167 111.125 107.6375 [4,] 110.8417 114.425 112.0813 [5,] 112.4500 116.050 113.5875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 108.0063 107.7498 105.1517 [2,] 111.4271 114.5002 110.1233 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(105.016666666667, 107.091666666667, 109.716666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tbdq1416834496.ps tmp/1tbdq1416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/2pmi81416834496.ps tmp/2pmi81416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/38ib01416834496.ps tmp/38ib01416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/4mynp1416834496.ps tmp/4mynp1416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/5vnfz1416834496.ps tmp/5vnfz1416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/6toeo1416834496.ps tmp/6toeo1416834496.png",intern=TRUE)) character(0) > try(system("convert tmp/75bi01416834496.ps tmp/75bi01416834496.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.539 0.462 3.026