R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(71.4,75.8,79.2,84.4,84.4,87.2,92.4,88.5,94.8,100.9,110,107.9,111.2,116.7,125.8,131.5,146.2,155.4,157.5,137.2,121.3,89.1,69.6,56.7,58.5,56.4,60.5,64.6,73.2,84.6,80.4,88.4,84.6,90.8,94.9,93.1,96.6,93.1,98.3,105,95.6,94.3,95.3,97.1,98.1,104.4,107.8,114.3,118.7,124.1,134.2,142.4,133.8,131,133.2,125.9,126.2,122.7,126.6,124.8,128,134.1,138.8,134,124,110.4,116.7,124.7,126,122.8,120.2,121.2) > 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,] 71.4 111.2 58.5 96.6 118.7 128.0 NA [2,] 75.8 116.7 56.4 93.1 124.1 134.1 NA [3,] 79.2 125.8 60.5 98.3 134.2 138.8 NA [4,] 84.4 131.5 64.6 105.0 142.4 134.0 NA [5,] 84.4 146.2 73.2 95.6 133.8 124.0 NA [6,] 87.2 155.4 84.6 94.3 131.0 110.4 NA [7,] 92.4 157.5 80.4 95.3 133.2 116.7 NA [8,] 88.5 137.2 88.4 97.1 125.9 124.7 NA [9,] 94.8 121.3 84.6 98.1 126.2 126.0 NA [10,] 100.9 89.1 90.8 104.4 122.7 122.8 NA [11,] 110.0 69.6 94.9 107.8 126.6 120.2 NA [12,] 107.9 56.7 93.1 114.3 124.8 121.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.4 5.5 -2.1 -3.5 5.4 6.1 NA [2,] 3.4 9.1 4.1 5.2 10.1 4.7 NA [3,] 5.2 5.7 4.1 6.7 8.2 -4.8 NA [4,] 0.0 14.7 8.6 -9.4 -8.6 -10.0 NA [5,] 2.8 9.2 11.4 -1.3 -2.8 -13.6 NA [6,] 5.2 2.1 -4.2 1.0 2.2 6.3 NA [7,] -3.9 -20.3 8.0 1.8 -7.3 8.0 NA [8,] 6.3 -15.9 -3.8 1.0 0.3 1.3 NA [9,] 6.1 -32.2 6.2 6.3 -3.5 -3.2 NA [10,] 9.1 -19.5 4.1 3.4 3.9 -2.6 NA [11,] -2.1 -12.9 -1.8 6.5 -1.8 1.0 NA [12,] 3.3 1.8 3.5 4.4 3.2 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/1hir51382193240.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/2yxuu1382193240.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/3kimy1382193240.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/4uk3e1382193240.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,] 58.5 56.4 60.50 64.60 73.2 84.60 80.4 88.4 84.6 89.10 69.6 [2,] 71.4 75.8 79.20 84.40 84.4 87.20 92.4 88.5 94.8 90.80 94.9 [3,] 103.9 104.9 112.05 118.25 109.8 102.35 106.0 110.9 109.7 102.65 108.9 [4,] 118.7 124.1 134.20 134.00 133.8 131.00 133.2 125.9 126.0 122.70 120.2 [5,] 128.0 134.1 138.80 142.40 146.2 155.40 157.5 137.2 126.2 122.80 126.6 [,12] [1,] 56.7 [2,] 93.1 [3,] 111.1 [4,] 121.2 [5,] 124.8 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 73.38997 73.74494 76.57322 86.2564 77.9354 74.09759 79.68268 [2,] 134.41003 136.05506 147.52678 150.2436 141.6646 130.60241 132.31732 [,8] [,9] [,10] [,11] [,12] [1,] 86.77579 89.57499 82.07347 92.58068 92.97459 [2,] 135.02421 129.82501 123.22653 125.21932 129.22541 $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(58.5, 71.4, 103.9, 118.7, 128, 56.4, 75.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53twq1382193240.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.5 3.40 4.10 -10.0 -13.60 -4.20 -20.30 -3.80 -3.50 -2.60 -2.1 3.2 [2,] -2.1 4.10 4.10 -9.4 -2.80 1.00 -7.30 -3.80 -3.50 -2.60 -2.1 3.2 [3,] 4.9 4.95 5.45 -4.3 0.75 2.15 -1.05 0.65 1.45 3.65 -1.8 3.3 [4,] 5.5 9.10 6.70 8.6 9.20 5.20 8.00 1.30 6.20 4.10 1.0 3.5 [5,] 6.1 10.10 8.20 14.7 11.40 6.30 8.00 6.30 6.30 9.10 1.0 3.5 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.002245472 1.724839 3.772916 -15.910581 -6.990388 -0.5591357 -10.918994 [2,] 9.802245472 8.175161 7.127084 7.310581 8.490388 4.8591357 8.818994 [,8] [,9] [,10] [,11] [,12] [1,] -2.639665 -4.806813 -0.6717164 -3.7996001 3.088021 [2,] 3.939665 7.706813 7.9717164 0.1996001 3.511979 $out [1] -4.8 -15.9 -32.2 -19.5 -12.9 6.5 1.8 4.4 $group [1] 3 8 9 10 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.5, -2.1, 4.89999999999999, 5.5, 6.09999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67ifh1382193240.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,] 71.40 56.70 56.40 93.10 118.70 110.40 NA [2,] 81.80 100.15 62.55 95.45 124.45 120.70 NA [3,] 87.85 123.55 82.50 97.60 126.40 124.35 NA [4,] 97.85 141.70 89.60 104.70 133.50 131.00 NA [5,] 110.00 157.50 94.90 114.30 142.40 138.80 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 80.52949 104.5988 70.16231 93.38101 122.2722 119.6521 NA [2,] 95.17051 142.5012 94.83769 101.81899 130.5278 129.0479 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(71.4, 81.8, 87.85, 97.85, 110, 56.7, 100.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78tk41382193240.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,] 97.4000 102.35 105.7250 [2,] 103.9250 104.40 106.5687 [3,] 107.3167 109.30 108.0812 [4,] 110.3083 111.00 109.7500 [5,] 112.5833 118.25 111.4625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.4052 106.2897 106.6303 [2,] 110.2281 112.3103 109.5322 $out [1] 97.2625 101.1875 $group [1] 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.4, 103.925, 107.316666666667, 110.308333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hir51382193240.ps tmp/1hir51382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/2yxuu1382193240.ps tmp/2yxuu1382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/3kimy1382193240.ps tmp/3kimy1382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/4uk3e1382193240.ps tmp/4uk3e1382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/53twq1382193240.ps tmp/53twq1382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/67ifh1382193240.ps tmp/67ifh1382193240.png",intern=TRUE)) character(0) > try(system("convert tmp/78tk41382193240.ps tmp/78tk41382193240.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.694 0.791 4.492