R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(113.4,114.9,120.4,124.9,123.6,123.3,123,123.1,126.4,128.4,128.5,131.5,121.9,109,98.9,95,91.7,97.1,99.7,101,101.1,94.2,93.1,97.8,81.9,78.5,72.3,68.1,72.6,73.7,71,64.7,64.2,62.4,75.5,84,80.2,93.5,109.3,148.8,164.6,182.5,163,138.3,126,125.3,131.3,96.1,93,89.6,77.3,68.3,69.1,66.4,64.2,54.9,54.9,54.7,54.8,52.3,52.5,45.7,45.5,48.2,52,53.8,53.5,52.9,55.1,53.8,49.9,45.3) > 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,] 113.4 121.9 81.9 80.2 93.0 52.5 NA [2,] 114.9 109.0 78.5 93.5 89.6 45.7 NA [3,] 120.4 98.9 72.3 109.3 77.3 45.5 NA [4,] 124.9 95.0 68.1 148.8 68.3 48.2 NA [5,] 123.6 91.7 72.6 164.6 69.1 52.0 NA [6,] 123.3 97.1 73.7 182.5 66.4 53.8 NA [7,] 123.0 99.7 71.0 163.0 64.2 53.5 NA [8,] 123.1 101.0 64.7 138.3 54.9 52.9 NA [9,] 126.4 101.1 64.2 126.0 54.9 55.1 NA [10,] 128.4 94.2 62.4 125.3 54.7 53.8 NA [11,] 128.5 93.1 75.5 131.3 54.8 49.9 NA [12,] 131.5 97.8 84.0 96.1 52.3 45.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.5 -12.9 -3.4 13.3 -3.4 -6.8 NA [2,] 5.5 -10.1 -6.2 15.8 -12.3 -0.2 NA [3,] 4.5 -3.9 -4.2 39.5 -9.0 2.7 NA [4,] -1.3 -3.3 4.5 15.8 0.8 3.8 NA [5,] -0.3 5.4 1.1 17.9 -2.7 1.8 NA [6,] -0.3 2.6 -2.7 -19.5 -2.2 -0.3 NA [7,] 0.1 1.3 -6.3 -24.7 -9.3 -0.6 NA [8,] 3.3 0.1 -0.5 -12.3 0.0 2.2 NA [9,] 2.0 -6.9 -1.8 -0.7 -0.2 -1.3 NA [10,] 0.1 -1.1 13.1 6.0 0.1 -3.9 NA [11,] 3.0 4.7 8.5 -35.2 -2.5 -4.6 NA [12,] -9.6 -15.9 -3.8 -3.1 0.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/1r2zq1350633013.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/2xmur1350633013.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/3yst81350633013.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/43d841350633013.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,] 52.50 45.70 45.5 48.20 52.00 53.8 53.50 52.90 54.90 53.8 49.9 [2,] 80.20 78.50 72.3 68.10 69.10 66.4 64.20 54.90 55.10 54.7 54.8 [3,] 87.45 91.55 88.1 81.65 82.15 85.4 85.35 82.85 82.65 78.3 84.3 [4,] 113.40 109.00 109.3 124.90 123.60 123.3 123.00 123.10 126.00 125.3 128.5 [5,] 121.90 114.90 120.4 148.80 164.60 182.5 163.00 138.30 126.40 128.4 131.3 [,12] [1,] 45.30 [2,] 52.30 [3,] 90.05 [4,] 97.80 [5,] 131.50 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 66.03493 71.87651 64.2338 45.01217 46.99574 48.69766 47.4221 [2,] 108.86507 111.22349 111.9662 118.28783 117.30426 122.10234 123.2779 [,8] [,9] [,10] [,11] [,12] [1,] 38.8588 36.91721 32.76072 36.76112 60.70103 [2,] 126.8412 128.38279 123.83928 131.83888 119.39897 $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(52.5, 80.2, 87.45, 113.4, 121.9, 45.7, 78.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5n24u1350633013.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,] -12.9 -12.3 -9.0 -3.3 -2.70 -2.70 -9.30 -0.50 -1.8 -3.9 -4.60 -15.9 [2,] -6.8 -10.1 -4.2 -1.3 -0.30 -2.70 -9.30 -0.50 -1.8 -1.1 -4.60 -9.6 [3,] -3.4 -3.2 -0.6 2.3 1.45 -1.25 -3.45 0.05 -1.0 0.1 0.25 -3.8 [4,] 1.5 5.5 4.5 4.5 5.40 -0.30 0.10 2.20 -0.2 6.0 4.70 -3.1 [5,] 13.3 15.8 4.5 4.5 5.40 2.60 1.30 3.30 2.0 13.1 8.50 0.2 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -8.753768 -13.262504 -6.211781 -1.441187 -2.226684 -2.7980775 -9.513304 [2,] 1.953768 6.862504 5.011781 6.041187 5.126684 0.2980775 2.613304 [,8] [,9] [,10] [,11] [,12] [1,] -1.691587 -2.03205168 -4.479729 -5.7488 -8.3928836 [2,] 1.791587 0.03205168 4.679729 6.2488 0.7928836 $out [1] 39.5 15.8 17.9 -19.5 -24.7 -12.3 -6.9 -35.2 $group [1] 3 4 5 6 7 8 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-12.9, -6.8, -3.40000000000001, 1.5, 13.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g0271350633013.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,] 113.40 91.70 62.40 80.20 52.30 45.30 NA [2,] 121.70 94.60 66.40 102.70 54.85 46.95 NA [3,] 123.45 98.35 72.45 128.65 65.30 52.25 NA [4,] 127.40 101.05 77.00 155.90 73.20 53.65 NA [5,] 131.50 109.00 84.00 182.50 93.00 55.10 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 120.8502 95.40811 67.61527 104.3851 56.93044 49.19409 NA [2,] 126.0498 101.29189 77.28473 152.9149 73.66956 55.30591 NA $out [1] 121.9 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(113.4, 121.7, 123.45, 127.4, 131.5, 91.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7suz81350633013.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,] 84.50000 78.300 87.07500 [2,] 87.61667 82.400 88.01875 [3,] 89.00000 84.825 90.83125 [4,] 93.90833 87.775 92.79375 [5,] 99.46667 91.550 94.46250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 86.13033 82.37343 88.65334 [2,] 91.86967 87.27657 93.00916 $out [1] 78.8 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(84.5, 87.6166666666667, 89, 93.9083333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1r2zq1350633013.ps tmp/1r2zq1350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/2xmur1350633013.ps tmp/2xmur1350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/3yst81350633013.ps tmp/3yst81350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/43d841350633013.ps tmp/43d841350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/5n24u1350633013.ps tmp/5n24u1350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/6g0271350633013.ps tmp/6g0271350633013.png",intern=TRUE)) character(0) > try(system("convert tmp/7suz81350633013.ps tmp/7suz81350633013.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.353 0.700 4.042