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.5,1.439,1.49,1.502,1.531,1.611,1.644,1.559,1.553,1.494,1.298,1.215,1.179,1.267,1.282,1.304,1.32,1.413,1.38,1.426,1.394,1.354,1.415,1.406,1.44,1.449,1.489,1.53,1.548,1.518,1.507,1.499,1.487,1.487,1.491,1.56,1.587,1.584,1.647,1.666,1.699,1.671,1.622,1.669,1.663,1.624,1.621,1.607,1.671,1.699,1.751,1.821,1.77,1.734,1.703,1.752,1.823,1.827,1.773,1.75,1.733,1.765,1.791,1.773,1.712,1.735,1.729,1.769,1.776,1.709,1.678,1.691) > 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.500 1.179 1.440 1.587 1.671 1.733 NA [2,] 1.439 1.267 1.449 1.584 1.699 1.765 NA [3,] 1.490 1.282 1.489 1.647 1.751 1.791 NA [4,] 1.502 1.304 1.530 1.666 1.821 1.773 NA [5,] 1.531 1.320 1.548 1.699 1.770 1.712 NA [6,] 1.611 1.413 1.518 1.671 1.734 1.735 NA [7,] 1.644 1.380 1.507 1.622 1.703 1.729 NA [8,] 1.559 1.426 1.499 1.669 1.752 1.769 NA [9,] 1.553 1.394 1.487 1.663 1.823 1.776 NA [10,] 1.494 1.354 1.487 1.624 1.827 1.709 NA [11,] 1.298 1.415 1.491 1.621 1.773 1.678 NA [12,] 1.215 1.406 1.560 1.607 1.750 1.691 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.061 0.088 0.009 -0.003 0.028 0.032 NA [2,] 0.051 0.015 0.040 0.063 0.052 0.026 NA [3,] 0.012 0.022 0.041 0.019 0.070 -0.018 NA [4,] 0.029 0.016 0.018 0.033 -0.051 -0.061 NA [5,] 0.080 0.093 -0.030 -0.028 -0.036 0.023 NA [6,] 0.033 -0.033 -0.011 -0.049 -0.031 -0.006 NA [7,] -0.085 0.046 -0.008 0.047 0.049 0.040 NA [8,] -0.006 -0.032 -0.012 -0.006 0.071 0.007 NA [9,] -0.059 -0.040 0.000 -0.039 0.004 -0.067 NA [10,] -0.196 0.061 0.004 -0.003 -0.054 -0.031 NA [11,] -0.083 -0.009 0.069 -0.014 -0.023 0.013 NA [12,] -0.036 0.034 0.027 0.064 -0.017 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/1c7an1413750577.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/21u691413750577.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/3wkrj1413750577.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/4jbve1413750577.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.1790 1.2670 1.2820 1.304 1.3200 1.413 1.380 1.426 1.394 1.354 1.298 [2,] 1.4400 1.4390 1.4890 1.502 1.5310 1.518 1.507 1.499 1.487 1.487 1.415 [3,] 1.5435 1.5165 1.5685 1.598 1.6235 1.641 1.633 1.614 1.608 1.559 1.556 [4,] 1.6710 1.6990 1.7510 1.773 1.7120 1.734 1.703 1.752 1.776 1.709 1.678 [5,] 1.7330 1.7650 1.7910 1.821 1.7700 1.735 1.729 1.769 1.823 1.827 1.773 [,12] [1,] 1.2150 [2,] 1.4060 [3,] 1.5835 [4,] 1.6910 [5,] 1.7500 $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.394498 1.348792 1.399502 1.423196 1.506749 1.501673 1.506574 1.450807 [2,] 1.692502 1.684208 1.737498 1.772804 1.740251 1.780327 1.759426 1.777193 [,9] [,10] [,11] [,12] [1,] 1.421586 1.415803 1.386357 1.399666 [2,] 1.794414 1.702197 1.725643 1.767334 $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.179, 1.44, 1.5435, 1.671, 1.733, 1.267, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5twxh1413750577.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.0030 0.0150 -0.0180 -0.061 -0.0360 -0.049 -0.085 -0.032 -0.0670 -0.054 [2,] -0.0030 0.0260 0.0120 -0.051 -0.0300 -0.033 -0.008 -0.012 -0.0590 -0.054 [3,] 0.0185 0.0455 0.0205 0.017 -0.0025 -0.021 0.043 -0.006 -0.0395 -0.017 [4,] 0.0320 0.0520 0.0410 0.029 0.0800 -0.006 0.047 0.007 0.0000 0.004 [5,] 0.0320 0.0630 0.0700 0.033 0.0930 0.033 0.049 0.007 0.0040 0.061 [,11] [,12] [1,] -0.0230 -0.036 [2,] -0.0230 -0.017 [3,] -0.0115 0.027 [4,] 0.0130 0.034 [5,] 0.0130 0.064 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.00407613 0.02872916 0.001794063 -0.03460258 -0.07345355 -0.038415872 [2,] 0.04107613 0.06227084 0.039205937 0.06860258 0.06845355 -0.003584128 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.007523224 -0.018255614 -0.077556906 -0.05441187 -0.03472116 -0.009036472 [2,] 0.078476776 0.006255614 -0.001443094 0.02041187 0.01172116 0.063036472 $out [1] -0.061 0.088 0.071 -0.196 -0.083 0.069 $group [1] 1 1 8 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.00299999999999989, -0.00299999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lzzk1413750577.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.4390 1.1790 1.440 1.5840 1.6710 1.6780 NA [2,] 1.4645 1.2930 1.487 1.6140 1.7185 1.7105 NA [3,] 1.5010 1.3670 1.495 1.6355 1.7515 1.7340 NA [4,] 1.5560 1.4095 1.524 1.6675 1.7970 1.7710 NA [5,] 1.6440 1.4260 1.560 1.6990 1.8270 1.7910 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.459266 1.313864 1.478124 1.611098 1.715696 1.706406 NA [2,] 1.542734 1.420136 1.511876 1.659902 1.787304 1.761594 NA $out [1] 1.298 1.215 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.439, 1.4645, 1.501, 1.556, 1.644, 1.179, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7cavy1413750577.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.518333 1.51650 1.548875 [2,] 1.542083 1.55750 1.556563 [3,] 1.589583 1.59075 1.609563 [4,] 1.605833 1.61875 1.624125 [5,] 1.616000 1.64100 1.629750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.560507 1.562813 1.578747 [2,] 1.618660 1.618687 1.640378 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.51833333333333, 1.54208333333333, 1.58958333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1c7an1413750577.ps tmp/1c7an1413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/21u691413750577.ps tmp/21u691413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/3wkrj1413750577.ps tmp/3wkrj1413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/4jbve1413750577.ps tmp/4jbve1413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/5twxh1413750577.ps tmp/5twxh1413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/6lzzk1413750577.ps tmp/6lzzk1413750577.png",intern=TRUE)) character(0) > try(system("convert tmp/7cavy1413750577.ps tmp/7cavy1413750577.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.535 0.385 2.953