R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(4.69,4.69,4.69,4.69,4.69,4.69,4.69,4.73,4.78,4.79,4.79,4.8,4.8,4.81,5.16,5.26,5.29,5.29,5.29,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.3,5.35,5.44,5.47,5.47,5.48,5.48,5.48,5.48,5.48,5.48,5.48,5.5,5.55,5.57,5.58,5.58,5.58,5.59,5.59,5.59,5.55,5.61,5.61,5.61,5.63,5.69,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.71,5.74,5.77,5.79,5.79,5.8,5.8,5.8,5.8) > 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,] 4.69 4.80 5.30 5.48 5.61 5.70 NA [2,] 4.69 4.81 5.30 5.48 5.61 5.70 NA [3,] 4.69 5.16 5.30 5.50 5.61 5.70 NA [4,] 4.69 5.26 5.35 5.55 5.63 5.71 NA [5,] 4.69 5.29 5.44 5.57 5.69 5.74 NA [6,] 4.69 5.29 5.47 5.58 5.70 5.77 NA [7,] 4.69 5.29 5.47 5.58 5.70 5.79 NA [8,] 4.73 5.30 5.48 5.58 5.70 5.79 NA [9,] 4.78 5.30 5.48 5.59 5.70 5.80 NA [10,] 4.79 5.30 5.48 5.59 5.70 5.80 NA [11,] 4.79 5.30 5.48 5.59 5.70 5.80 NA [12,] 4.80 5.30 5.48 5.55 5.70 5.80 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.01 0.00 0.00 0.00 0.00 NA [2,] 0.00 0.35 0.00 0.02 0.00 0.00 NA [3,] 0.00 0.10 0.05 0.05 0.02 0.01 NA [4,] 0.00 0.03 0.09 0.02 0.06 0.03 NA [5,] 0.00 0.00 0.03 0.01 0.01 0.03 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.02 NA [7,] 0.04 0.01 0.01 0.00 0.00 0.00 NA [8,] 0.05 0.00 0.00 0.01 0.00 0.01 NA [9,] 0.01 0.00 0.00 0.00 0.00 0.00 NA [10,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [11,] 0.01 0.00 0.00 -0.04 0.00 0.00 NA [12,] 0.00 0.00 0.00 0.06 0.00 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/fisher/rcomp/tmp/18coz1362692627.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/fisher/rcomp/tmp/2be4q1362692627.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/fisher/rcomp/tmp/31ke21362692627.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/fisher/rcomp/tmp/4jswg1362692627.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] [,12] [1,] 4.69 4.69 4.69 5.26 4.690 4.690 4.690 4.73 4.780 4.790 4.790 4.800 [2,] 4.80 4.81 5.16 5.26 5.290 5.290 5.290 5.30 5.300 5.300 5.300 5.300 [3,] 5.39 5.39 5.40 5.45 5.505 5.525 5.525 5.53 5.535 5.535 5.535 5.515 [4,] 5.61 5.61 5.61 5.63 5.690 5.700 5.700 5.70 5.700 5.700 5.700 5.700 [5,] 5.70 5.70 5.70 5.71 5.740 5.770 5.790 5.79 5.800 5.800 5.800 5.800 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 4.867524 4.873974 5.109735 5.211338 5.246987 5.260537 5.260537 5.271987 [2,] 5.912476 5.906026 5.690265 5.688662 5.763013 5.789463 5.789463 5.788013 [,9] [,10] [,11] [,12] [1,] 5.276987 5.276987 5.276987 5.256987 [2,] 5.793013 5.793013 5.793013 5.773013 $out [1] 4.69 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(4.69, 4.8, 5.39, 5.61, 5.7, 4.69, 4.81, 5.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5npd71362692627.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,] 0 0.00 0.000 0.00 0.00 0 0.000 0.000 0 0 0 0 [2,] 0 0.00 0.010 0.02 0.00 0 0.000 0.000 0 0 0 0 [3,] 0 0.00 0.035 0.03 0.01 0 0.005 0.005 0 0 0 0 [4,] 0 0.02 0.050 0.06 0.03 0 0.010 0.010 0 0 0 0 [5,] 0 0.02 0.100 0.09 0.03 0 0.010 0.010 0 0 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 -0.01290065 0.009198708 0.004198708 -0.009350969 0 -0.001450323 [2,] 0 0.01290065 0.060801292 0.055801292 0.029350969 0 0.011450323 [,8] [,9] [,10] [,11] [,12] [1,] -0.001450323 0 0 0 0 [2,] 0.011450323 0 0 0 0 $out [1] 0.01 0.35 0.02 0.04 0.05 0.01 0.01 -0.04 0.06 $group [1] 1 2 6 7 8 9 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0.0199999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ci6v1362692627.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,] 4.690 5.16 5.300 5.480 5.61 5.700 NA [2,] 4.690 5.21 5.325 5.525 5.62 5.705 NA [3,] 4.690 5.29 5.470 5.575 5.70 5.780 NA [4,] 4.785 5.30 5.480 5.585 5.70 5.800 NA [5,] 4.800 5.30 5.480 5.590 5.70 5.800 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.64667 5.24895 5.399303 5.547634 5.663511 5.73667 NA [2,] 4.73333 5.33105 5.540697 5.602366 5.736489 5.82333 NA $out [1] 4.80 4.81 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(4.69, 4.69, 4.69, 4.785, 4.8, 5.16, 5.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7xkjg1362692627.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,] 5.263333 5.3900 5.388750 [2,] 5.345833 5.4250 5.417500 [3,] 5.418333 5.5200 5.502500 [4,] 5.440000 5.5325 5.508125 [5,] 5.443333 5.5350 5.508750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5.375383 5.470969 5.461165 [2,] 5.461283 5.569031 5.543835 $out [1] 5.25125 5.25500 $group [1] 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5.26333333333333, 5.34583333333333, 5.41833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18coz1362692627.ps tmp/18coz1362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/2be4q1362692627.ps tmp/2be4q1362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/31ke21362692627.ps tmp/31ke21362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/4jswg1362692627.ps tmp/4jswg1362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/5npd71362692627.ps tmp/5npd71362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/6ci6v1362692627.ps tmp/6ci6v1362692627.png",intern=TRUE)) character(0) > try(system("convert tmp/7xkjg1362692627.ps tmp/7xkjg1362692627.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.502 0.540 4.030