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(22943,21413,20631,19775,17506,20688,32631,34062,29159,25871,23719,25638,27596,28006,27662,26655,25213,28434,40388,42758,37956,33490,31578,34766,32324,32046,29565,28284,26366,27530,39728,41528,36458,32301,28985,29118,29249,28036,26326,24942,23280,23969,35948,37639,34327,30133,27549,27990,30437,30464,28471,26882,25806,26465,36416,42870,40489,36645,33841,33496,34504,34699,33322,32160,30173,30782,43062,46223,45191,40671,37251,36870) > 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,] 22943 27596 32324 29249 30437 34504 NA [2,] 21413 28006 32046 28036 30464 34699 NA [3,] 20631 27662 29565 26326 28471 33322 NA [4,] 19775 26655 28284 24942 26882 32160 NA [5,] 17506 25213 26366 23280 25806 30173 NA [6,] 20688 28434 27530 23969 26465 30782 NA [7,] 32631 40388 39728 35948 36416 43062 NA [8,] 34062 42758 41528 37639 42870 46223 NA [9,] 29159 37956 36458 34327 40489 45191 NA [10,] 25871 33490 32301 30133 36645 40671 NA [11,] 23719 31578 28985 27549 33841 37251 NA [12,] 25638 34766 29118 27990 33496 36870 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1530 410 -278 -1213 27 195 NA [2,] -782 -344 -2481 -1710 -1993 -1377 NA [3,] -856 -1007 -1281 -1384 -1589 -1162 NA [4,] -2269 -1442 -1918 -1662 -1076 -1987 NA [5,] 3182 3221 1164 689 659 609 NA [6,] 11943 11954 12198 11979 9951 12280 NA [7,] 1431 2370 1800 1691 6454 3161 NA [8,] -4903 -4802 -5070 -3312 -2381 -1032 NA [9,] -3288 -4466 -4157 -4194 -3844 -4520 NA [10,] -2152 -1912 -3316 -2584 -2804 -3420 NA [11,] 1919 3188 133 441 -345 -381 NA [12,] 1958 -2442 131 2447 1008 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/1o3zj1413216607.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/28uxz1413216607.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/3i1f31413216607.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/49ezb1413216607.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] [1,] 22943 28006 26326.0 24942.0 23280.0 20688.0 32631 34062 29159 25871.0 [2,] 27596 28006 26326.0 24942.0 23280.0 23969.0 35948 37639 34327 30133.0 [3,] 29843 29250 28066.5 26768.5 25509.5 26997.5 38072 42143 37207 32895.5 [4,] 32324 32046 29565.0 28284.0 26366.0 28434.0 40388 42870 40489 36645.0 [5,] 34504 34699 33322.0 32160.0 30173.0 30782.0 43062 46223 45191 40671.0 [,11] [,12] [1,] 23719.0 25638 [2,] 27549.0 27990 [3,] 30281.5 31307 [4,] 33841.0 34766 [5,] 37251.0 36870 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 26793.29 26644.07 25977.24 24612.8 23518.93 24117.43 35208.06 38768.84 [2,] 32892.71 31855.93 30155.76 28924.2 27500.07 29877.57 40935.94 45517.16 [,9] [,10] [,11] [,12] [1,] 33232.31 28695.05 26222.96 26936.26 [2,] 41181.69 37095.95 34340.04 35677.74 $out [1] 21413 20631 19775 17506 $group [1] 2 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(22943, 27596, 29843, 32324, 34504, 28006, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a8mm1413216607.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,] -1530.0 -2481.0 -1589.0 -2269 609.0 11943.0 1431 -5070 -4520.0 -3420 [2,] -1213.0 -1993.0 -1384.0 -1987 659.0 11943.0 1691 -4903 -4466.0 -3316 [3,] -125.5 -1543.5 -1221.5 -1790 926.5 11966.5 2085 -4057 -4175.5 -2694 [4,] 195.0 -782.0 -1007.0 -1442 3182.0 12198.0 3161 -2381 -3844.0 -2152 [5,] 410.0 -344.0 -856.0 -1076 3221.0 12280.0 3161 -1032 -3288.0 -1912 [,11] [,12] [1,] -381 -2442 [2,] -345 131 [3,] 287 1008 [4,] 1919 1958 [5,] 3188 2447 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1033.7055 -2324.6341 -1464.6772 -2141.543 -700.9165 11802.02 1136.803 [2,] 782.7055 -762.3659 -978.3228 -1438.457 2553.9165 12130.98 3033.197 [,8] [,9] [,10] [,11] [,12] [1,] -5683.771 -4576.71 -3444.818 -1173.353 -282.9536 [2,] -2430.229 -3774.29 -1943.182 1747.353 2298.9536 $out [1] 9951 6454 $group [1] 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1530, -1213, -125.5, 195, 410, -2481, -1993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xohy1413216607.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,] 17506.0 25213 26366.0 23280 25806.0 30173.0 NA [2,] 20659.5 27629 28634.5 25634 27676.5 32741.0 NA [3,] 23331.0 30006 30805.5 28013 31980.0 35784.5 NA [4,] 27515.0 36361 34391.0 32230 36530.5 41866.5 NA [5,] 34062.0 42758 41528.0 37639 42870.0 46223.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 20204.16 26023.28 28179.92 25004.52 27941.63 31622.3 NA [2,] 26457.84 33988.72 33431.08 31021.48 36018.37 39946.7 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(17506, 20659.5, 23331, 27515, 34062, 25213, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7txw21413216607.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,] 24724.00 25509.50 24994.62 [2,] 27056.25 27532.00 27313.81 [3,] 29998.00 30062.25 30261.19 [4,] 35224.25 35051.25 35311.69 [5,] 40846.67 42143.00 40726.62 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 26272.52 26632.67 26613.30 [2,] 33723.48 33491.83 33909.07 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(24724, 27056.25, 29998, 35224.25, 40846.6666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1o3zj1413216607.ps tmp/1o3zj1413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/28uxz1413216607.ps tmp/28uxz1413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/3i1f31413216607.ps tmp/3i1f31413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/49ezb1413216607.ps tmp/49ezb1413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/5a8mm1413216607.ps tmp/5a8mm1413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/6xohy1413216607.ps tmp/6xohy1413216607.png",intern=TRUE)) character(0) > try(system("convert tmp/7txw21413216607.ps tmp/7txw21413216607.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.455 0.412 2.901