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(10700,12400,12000,12800,11800,11900,11900,12300,11700,11900,11900,14000,11300,12600,12600,12600,11300,12200,11800,12800,11400,11600,11700,14100,11000,12800,13300,12600,10700,12600,12700,14100,11600,11300,11600,13000,10800,13800,12600,12500,9900,11800,12400,15000,11500,11100,10800,12700,10500,14900,12800,12300,9600,11000,12700,15300,12900,11200,11000,13100,10200,15100,12600,11600,9700,10200,12100,15300,13500,10700,11400,12500,9300,15100,12300,11800,9600,9600,12400,16400,13500,11000,11200,12900,8900,15600,12500,11700,9000,8600,13100,16100,14400,11300,12200,14000,9300,14900,12500,11600,9100,8800,13000,15500,14600,11200,12700,14100) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 10700 11300 11000 10800 10500 10200 9300 8900 9300 NA [2,] 12400 12600 12800 13800 14900 15100 15100 15600 14900 NA [3,] 12000 12600 13300 12600 12800 12600 12300 12500 12500 NA [4,] 12800 12600 12600 12500 12300 11600 11800 11700 11600 NA [5,] 11800 11300 10700 9900 9600 9700 9600 9000 9100 NA [6,] 11900 12200 12600 11800 11000 10200 9600 8600 8800 NA [7,] 11900 11800 12700 12400 12700 12100 12400 13100 13000 NA [8,] 12300 12800 14100 15000 15300 15300 16400 16100 15500 NA [9,] 11700 11400 11600 11500 12900 13500 13500 14400 14600 NA [10,] 11900 11600 11300 11100 11200 10700 11000 11300 11200 NA [11,] 11900 11700 11600 10800 11000 11400 11200 12200 12700 NA [12,] 14000 14100 13000 12700 13100 12500 12900 14000 14100 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1700 1300 1800 3000 4400 4900 5800 6700 5600 NA [2,] -400 0 500 -1200 -2100 -2500 -2800 -3100 -2400 NA [3,] 800 0 -700 -100 -500 -1000 -500 -800 -900 NA [4,] -1000 -1300 -1900 -2600 -2700 -1900 -2200 -2700 -2500 NA [5,] 100 900 1900 1900 1400 500 0 -400 -300 NA [6,] 0 -400 100 600 1700 1900 2800 4500 4200 NA [7,] 400 1000 1400 2600 2600 3200 4000 3000 2500 NA [8,] -600 -1400 -2500 -3500 -2400 -1800 -2900 -1700 -900 NA [9,] 200 200 -300 -400 -1700 -2800 -2500 -3100 -3400 NA [10,] 0 100 300 -300 -200 700 200 900 1500 NA [11,] 2100 2400 1400 1900 2100 1100 1700 1800 1400 NA [12,] -2700 -3100 -2200 -2200 -2900 -3200 -4000 -4700 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/1p08n1405420802.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/2b3xp1405420802.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/3rysq1405420802.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/4od131405420802.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,] 8900 12400 12500 11600 9000 8600 11800 12300 11400 11000 10800 12500 [2,] 9300 12800 12500 11700 9600 9600 12100 14100 11600 11100 11200 12900 [3,] 10500 14900 12600 12300 9700 11000 12400 15300 12900 11200 11600 13100 [4,] 10800 15100 12600 12600 10700 11900 12700 15500 13500 11300 11900 14000 [5,] 11300 15600 12600 12800 11800 12600 13100 16400 14600 11600 12700 14100 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 9710 13688.67 12547.33 11826 9120.667 9788.667 12084 14562.67 11899.33 [2,] 11290 16111.33 12652.67 12774 10279.333 12211.333 12716 16037.33 13900.67 [,10] [,11] [,12] [1,] 11094.67 11231.33 12520.67 [2,] 11305.33 11968.67 13679.33 $out [1] 12000 13300 12800 12300 11900 10700 $group [1] 3 3 3 3 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(8900, 9300, 10500, 10800, 11300, 12400, 12800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5skjw1405420802.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,] 1300 -3100 -1000 -2700 -400 -400 400 -3500 -3400 -300 1100 -4700 [2,] 1800 -2500 -800 -2600 0 100 1400 -2500 -2800 0 1400 -3600 [3,] 4400 -2100 -500 -2200 500 1700 2600 -1800 -1700 200 1800 -3000 [4,] 5600 -400 -100 -1900 1400 2800 3000 -1400 -300 700 2100 -2450 [5,] 6700 500 800 -1000 1900 4500 4000 -600 200 1500 2400 -2200 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2398.667 -3206 -868.6667 -2568.667 -237.3333 278 1757.333 -2379.333 [2,] 6401.333 -994 -131.3333 -1831.333 1237.3333 3122 3442.667 -1220.667 [,9] [,10] [,11] [,12] [1,] -3016.6667 -168.6667 1431.333 -3642.407 [2,] -383.3333 568.6667 2168.667 -2357.593 $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(1300, 1800, 4400, 5600, 6700, -3100, -2500, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qkgh1405420802.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] [,8] [,9] [,10] [1,] 11700 11300 10700 9900 9600 9700 9300 8600 8800 NA [2,] 11850 11500 11450 10950 11000 10450 10300 10150 10250 NA [3,] 11900 12000 12600 12100 12500 11850 12050 12350 12600 NA [4,] 12350 12600 12900 12650 13000 13050 13200 14200 14350 NA [5,] 12800 14100 14100 15000 15300 15300 16400 16100 15500 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 11671.95 11498.28 11938.65 11324.62 11587.79 10664.12 10727.29 10502.77 [2,] 12128.05 12501.72 13261.35 12875.38 13412.21 13035.88 13372.71 14197.23 [,9] [,10] [1,] 10729.96 NA [2,] 14470.04 NA $out [1] 10700 14000 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(11700, 11850, 11900, 12350, 12800, 11300, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w5dv1405420802.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,] 10077.78 9700 10050 [2,] 11000.00 11100 10975 [3,] 12311.11 12350 12275 [4,] 13083.33 13000 13000 [5,] 14755.56 15300 14800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 11360.89 11483.4 11351.38 [2,] 13261.33 13216.6 13198.62 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10077.7777777778, 11000, 12311.1111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1p08n1405420802.ps tmp/1p08n1405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/2b3xp1405420802.ps tmp/2b3xp1405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/3rysq1405420802.ps tmp/3rysq1405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/4od131405420802.ps tmp/4od131405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/5skjw1405420802.ps tmp/5skjw1405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/6qkgh1405420802.ps tmp/6qkgh1405420802.png",intern=TRUE)) character(0) > try(system("convert tmp/7w5dv1405420802.ps tmp/7w5dv1405420802.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.525 0.409 2.961