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(1.464,1.474,1.479,1.517,1.575,1.627,1.613,1.558,1.545,1.406,1.269,1.191,1.231,1.276,1.281,1.312,1.363,1.419,1.374,1.422,1.378,1.38,1.409,1.398,1.445,1.452,1.506,1.531,1.524,1.52,1.499,1.491,1.496,1.493,1.507,1.569,1.593,1.597,1.633,1.686,1.683,1.646,1.658,1.636,1.67,1.634,1.618,1.622,1.688,1.723,1.776,1.809,1.754,1.714,1.733,1.783,1.818,1.81,1.764,1.73,1.742,1.785,1.769,1.743,1.721,1.73,1.753,1.764,1.758,1.7,1.678,1.688) > 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,] 1.464 1.231 1.445 1.593 1.688 1.742 NA [2,] 1.474 1.276 1.452 1.597 1.723 1.785 NA [3,] 1.479 1.281 1.506 1.633 1.776 1.769 NA [4,] 1.517 1.312 1.531 1.686 1.809 1.743 NA [5,] 1.575 1.363 1.524 1.683 1.754 1.721 NA [6,] 1.627 1.419 1.520 1.646 1.714 1.730 NA [7,] 1.613 1.374 1.499 1.658 1.733 1.753 NA [8,] 1.558 1.422 1.491 1.636 1.783 1.764 NA [9,] 1.545 1.378 1.496 1.670 1.818 1.758 NA [10,] 1.406 1.380 1.493 1.634 1.810 1.700 NA [11,] 1.269 1.409 1.507 1.618 1.764 1.678 NA [12,] 1.191 1.398 1.569 1.622 1.730 1.688 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.010 0.045 0.007 0.004 0.035 0.043 NA [2,] 0.005 0.005 0.054 0.036 0.053 -0.016 NA [3,] 0.038 0.031 0.025 0.053 0.033 -0.026 NA [4,] 0.058 0.051 -0.007 -0.003 -0.055 -0.022 NA [5,] 0.052 0.056 -0.004 -0.037 -0.040 0.009 NA [6,] -0.014 -0.045 -0.021 0.012 0.019 0.023 NA [7,] -0.055 0.048 -0.008 -0.022 0.050 0.011 NA [8,] -0.013 -0.044 0.005 0.034 0.035 -0.006 NA [9,] -0.139 0.002 -0.003 -0.036 -0.008 -0.058 NA [10,] -0.137 0.029 0.014 -0.016 -0.046 -0.022 NA [11,] -0.078 -0.011 0.062 0.004 -0.034 0.010 NA [12,] 0.040 0.047 0.024 0.066 0.012 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/121781418327637.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/2kcio1418327637.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/3k1ww1418327637.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/40uf01418327637.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,] 1.2310 1.2760 1.2810 1.3120 1.363 1.4190 1.3740 1.422 1.3780 1.3800 1.2690 [2,] 1.4450 1.4520 1.4790 1.5170 1.524 1.5200 1.4990 1.491 1.4960 1.4060 1.4090 [3,] 1.5285 1.5355 1.5695 1.6085 1.629 1.6365 1.6355 1.597 1.6075 1.5635 1.5625 [4,] 1.6880 1.7230 1.7690 1.7430 1.721 1.7140 1.7330 1.764 1.7580 1.7000 1.6780 [5,] 1.7420 1.7850 1.7760 1.8090 1.754 1.7300 1.7530 1.783 1.8180 1.8100 1.7640 [,12] [1,] 1.1910 [2,] 1.3980 [3,] 1.5955 [4,] 1.6880 [5,] 1.7300 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.371757 1.360696 1.382441 1.462723 1.501929 1.511364 1.484562 1.420906 [2,] 1.685243 1.710304 1.756559 1.754277 1.756071 1.761636 1.786438 1.773094 [,9] [,10] [,11] [,12] [1,] 1.438502 1.373861 1.388986 1.408441 [2,] 1.776498 1.753139 1.736014 1.782559 $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(1.231, 1.445, 1.5285, 1.688, 1.742, 1.276, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5epga1418327637.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] [1,] 0.0040 -0.0160 0.025 -0.055 -0.0400 -0.045 -0.0550 -0.0440 -0.139 -0.046 [2,] 0.0070 0.0050 0.025 -0.022 -0.0370 -0.021 -0.0220 -0.0130 -0.058 -0.046 [3,] 0.0225 0.0205 0.032 -0.005 0.0025 -0.001 0.0015 -0.0005 -0.022 -0.019 [4,] 0.0430 0.0530 0.038 0.051 0.0520 0.019 0.0480 0.0340 -0.003 0.014 [5,] 0.0450 0.0540 0.053 0.058 0.0560 0.023 0.0500 0.0350 0.002 0.029 [,11] [,12] [1,] -0.0780 0.012 [2,] -0.0340 0.024 [3,] -0.0035 0.040 [4,] 0.0100 0.047 [5,] 0.0620 0.066 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.0007211628 -0.01046155 0.02361458 -0.05208736 -0.05490787 -0.02680129 [2,] 0.0457211628 0.05146155 0.04038542 0.04208736 0.05990787 0.02480129 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.04365226 -0.03081652 -0.05747678 -0.05770194 -0.03188142 0.02374826 [2,] 0.04665226 0.02981652 0.01347678 0.01970194 0.02488142 0.05625174 $out [1] -0.026 -0.137 $group [1] 3 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.004, 0.0069999999999999, 0.0225000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i7qf1418327637.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,] 1.2690 1.2310 1.4520 1.593 1.6880 1.6780 NA [2,] 1.4350 1.2965 1.4920 1.620 1.7265 1.7105 NA [3,] 1.4980 1.3760 1.5025 1.635 1.7590 1.7425 NA [4,] 1.5665 1.4035 1.5220 1.664 1.7960 1.7610 NA [5,] 1.6270 1.4220 1.5310 1.686 1.8180 1.7850 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.438022 1.327197 1.488817 1.614931 1.727301 1.719467 NA [2,] 1.557978 1.424803 1.516183 1.655069 1.790699 1.765533 NA $out [1] 1.191 1.445 1.569 $group [1] 1 3 3 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.269, 1.435, 1.498, 1.5665, 1.627, 1.231, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79i2i1418327637.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,] 1.527167 1.52850 1.548250 [2,] 1.546000 1.56300 1.556563 [3,] 1.586833 1.59625 1.615125 [4,] 1.607000 1.61875 1.622000 [5,] 1.610833 1.63650 1.624625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.559011 1.570822 1.585279 [2,] 1.614656 1.621678 1.644971 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.52716666666667, 1.546, 1.58683333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/121781418327637.ps tmp/121781418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/2kcio1418327637.ps tmp/2kcio1418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/3k1ww1418327637.ps tmp/3k1ww1418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/40uf01418327637.ps tmp/40uf01418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/5epga1418327637.ps tmp/5epga1418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/6i7qf1418327637.ps tmp/6i7qf1418327637.png",intern=TRUE)) character(0) > try(system("convert tmp/79i2i1418327637.ps tmp/79i2i1418327637.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.682 0.422 3.140