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(1544400,1487200,1573000,1258400,1630200,1601600,1716000,1773200,1973400,1716000,1630200,2030600,1716000,1287000,1515800,1144000,1601600,1315600,1744600,1573000,1658800,1859000,1830400,2173600,1573000,1315600,1458600,1058200,1515800,1172600,1658800,1573000,1401400,2002000,1801800,2059200,1544400,1430000,1287000,1058200,1401400,1258400,1716000,1658800,1430000,1916200,1773200,2288000,1830400,1115400,1115400,1115400,1315600,1315600,1773200,1630200,1458600,1830400,1687400,2431000,1916200,1115400,1172600,972400,1344200,1544400,1944800,1916200,1544400,1801800,1601600,2288000,1744600,1401400,1258400,943800,1401400,1687400,1973400,1859000,1372800,1973400,1544400,2373800,1973400,1430000,1315600,886600,1401400,1344200,2030600,2030600,1544400,2002000,1487200,2316600,1973400,1458600,1115400,772200,1515800,1458600,1916200,2202200,1630200,1830400,1372800,2373800) > 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] [1,] 1544400 1716000 1573000 1544400 1830400 1916200 1744600 1973400 1973400 [2,] 1487200 1287000 1315600 1430000 1115400 1115400 1401400 1430000 1458600 [3,] 1573000 1515800 1458600 1287000 1115400 1172600 1258400 1315600 1115400 [4,] 1258400 1144000 1058200 1058200 1115400 972400 943800 886600 772200 [5,] 1630200 1601600 1515800 1401400 1315600 1344200 1401400 1401400 1515800 [6,] 1601600 1315600 1172600 1258400 1315600 1544400 1687400 1344200 1458600 [7,] 1716000 1744600 1658800 1716000 1773200 1944800 1973400 2030600 1916200 [8,] 1773200 1573000 1573000 1658800 1630200 1916200 1859000 2030600 2202200 [9,] 1973400 1658800 1401400 1430000 1458600 1544400 1372800 1544400 1630200 [10,] 1716000 1859000 2002000 1916200 1830400 1801800 1973400 2002000 1830400 [11,] 1630200 1830400 1801800 1773200 1687400 1601600 1544400 1487200 1372800 [12,] 2030600 2173600 2059200 2288000 2431000 2288000 2373800 2316600 2373800 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -57200 -429000 -257400 -114400 -715000 -800800 -343200 -543400 -514800 [2,] 85800 228800 143000 -143000 0 57200 -143000 -114400 -343200 [3,] -314600 -371800 -400400 -228800 0 -200200 -314600 -429000 -343200 [4,] 371800 457600 457600 343200 200200 371800 457600 514800 743600 [5,] -28600 -286000 -343200 -143000 0 200200 286000 -57200 -57200 [6,] 114400 429000 486200 457600 457600 400400 286000 686400 457600 [7,] 57200 -171600 -85800 -57200 -143000 -28600 -114400 0 286000 [8,] 200200 85800 -171600 -228800 -171600 -371800 -486200 -486200 -572000 [9,] -257400 200200 600600 486200 371800 257400 600600 457600 200200 [10,] -85800 -28600 -200200 -143000 -143000 -200200 -429000 -514800 -457600 [11,] 400400 343200 257400 514800 743600 686400 829400 829400 1001000 [12,] -314600 -600600 -514800 -457600 -514800 -543400 -400400 -343200 NA [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/10w6z1439740460.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/2yt651439740460.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/3er6d1439740460.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/4tzbt1439740460.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] [1,] 1544400 1115400 1115400 772200 1315600 1172600 1658800 1573000 1372800 [2,] 1573000 1287000 1172600 943800 1401400 1315600 1716000 1630200 1430000 [3,] 1744600 1401400 1287000 1058200 1401400 1344200 1773200 1773200 1544400 [4,] 1916200 1430000 1458600 1115400 1515800 1544400 1944800 1916200 1630200 [5,] 1973400 1487200 1573000 1258400 1630200 1687400 2030600 2202200 1658800 [,10] [,11] [,12] [1,] 1716000 1372800 2030600 [2,] 1830400 1544400 2173600 [3,] 1859000 1630200 2288000 [4,] 1973400 1773200 2373800 [5,] 2002000 1830400 2431000 $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,] 1563848 1326087 1136373 967824 1341149 1223699 1652699 1622573 1438961 [2,] 1925352 1476713 1437627 1148576 1461651 1464701 1893701 1923827 1649839 [,10] [,11] [,12] [1,] 1783687 1509699 2182561 [2,] 1934313 1750701 2393439 $out [1] 1973400 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1544400, 1573000, 1744600, 1916200, 1973400, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ko6w1439740460.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] [1,] -800800 -343200 -429000 343200 -343200 400400 -171600 -572000 200200 [2,] -543400 -143000 -371800 371800 -143000 400400 -114400 -486200 200200 [3,] -429000 0 -314600 457600 -57200 457600 -57200 -228800 371800 [4,] -257400 85800 -228800 457600 0 457600 0 -171600 486200 [5,] -57200 228800 -200200 514800 200200 486200 57200 200200 600600 [,10] [,11] [,12] [1,] -514800 257400 -600600 [2,] -429000 400400 -529100 [3,] -200200 686400 -486200 [4,] -143000 829400 -371800 [5,] -28600 1001000 -314600 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -579626.7 -120501.3 -389913.3 412412 -132513.33 427474.7 -117450.667 [2,] -278373.3 120501.3 -239286.7 502788 18113.33 487725.3 3050.667 [,8] [,9] [,10] [,11] [,12] [1,] -394489.33 221173.3 -350826.67 460460 -574070 [2,] -63110.67 522426.7 -49573.33 912340 -398330 $out [1] 0 200200 743600 286000 114400 286000 686400 286000 -257400 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-800800, -543400, -429000, -257400, -57200, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qr0r1439740460.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] [1,] 1487200 1144000 1058200 1058200 1115400 972400 943800 886600 772200 [2,] 1558700 1415700 1358500 1344200 1215500 1258400 1387100 1372800 1415700 [3,] 1630200 1630200 1544400 1487200 1544400 1573000 1615900 1515800 1573000 [4,] 1744600 1787500 1730300 1744600 1801800 1916200 1916200 2016300 1944800 [5,] 1973400 2173600 2059200 2288000 2431000 2288000 2373800 2316600 2373800 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1545410 1460620 1374820 1304575 1276985 1272973 1374574 1222295 1331674 [2,] 1714990 1799780 1713980 1669825 1811815 1873027 1857226 1809305 1814326 [,10] [1,] NA [2,] NA $out [1] 1258400 2030600 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(1487200, 1558700, 1630200, 1744600, 1973400, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7uc641439740460.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,] 1023244 1058200 1029600 [2,] 1374389 1372800 1394250 [3,] 1596833 1587300 1594450 [4,] 1816100 1773200 1801800 [5,] 2259400 2288000 2273700 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1395366 1404675 1408564 [2,] 1798301 1769925 1780336 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/10w6z1439740460.ps tmp/10w6z1439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/2yt651439740460.ps tmp/2yt651439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/3er6d1439740460.ps tmp/3er6d1439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/4tzbt1439740460.ps tmp/4tzbt1439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/5ko6w1439740460.ps tmp/5ko6w1439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/6qr0r1439740460.ps tmp/6qr0r1439740460.png",intern=TRUE)) character(0) > try(system("convert tmp/7uc641439740460.ps tmp/7uc641439740460.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.415 2.907