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(12374.6,12864.7,14905.8,12259.7,14088.9,14243.7,12732.8,11612,14176.6,14452.6,14512.7,12645.1,13820.5,13644.7,15684.1,13568.3,14531.1,15320.1,14344.2,12899.4,14462,16044.7,14731.2,12798.3,14213.1,14683.3,14652,15623.1,14880.4,15765.7,15433.1,12402.6,15639.8,14861.7,11699.4,10651.9,10086.9,10676.9,11332.1,10756.1,10450.5,11930.2,11419.9,9713.1,12608.5,12357.2,12107.9,11627.2,11105.9,11841.6,14290.8,13271.7,12909.4,14924.1,13257.4,12184.4,15035.5,14401,14165,13375.6,14210.8,15017.5,17157.8,15106.2,16696.1,16035.9,15418.9,13763.9,15595.2,15183.1,15515.9,14142.8,15012.7,16293.2,17771.4,15582.8,16049.9,16105.8,15623.6,14254.9,15266.8,16671,15665.4,13949.5,15146.9,15172.9,16981.4,16553.8,16438.5,15895.1,16989,13803.5,16678.3,17315.1,15895.4,14912.1) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 12374.6 13820.5 14213.1 10086.9 11105.9 14210.8 15012.7 15146.9 NA [2,] 12864.7 13644.7 14683.3 10676.9 11841.6 15017.5 16293.2 15172.9 NA [3,] 14905.8 15684.1 14652.0 11332.1 14290.8 17157.8 17771.4 16981.4 NA [4,] 12259.7 13568.3 15623.1 10756.1 13271.7 15106.2 15582.8 16553.8 NA [5,] 14088.9 14531.1 14880.4 10450.5 12909.4 16696.1 16049.9 16438.5 NA [6,] 14243.7 15320.1 15765.7 11930.2 14924.1 16035.9 16105.8 15895.1 NA [7,] 12732.8 14344.2 15433.1 11419.9 13257.4 15418.9 15623.6 16989.0 NA [8,] 11612.0 12899.4 12402.6 9713.1 12184.4 13763.9 14254.9 13803.5 NA [9,] 14176.6 14462.0 15639.8 12608.5 15035.5 15595.2 15266.8 16678.3 NA [10,] 14452.6 16044.7 14861.7 12357.2 14401.0 15183.1 16671.0 17315.1 NA [11,] 14512.7 14731.2 11699.4 12107.9 14165.0 15515.9 15665.4 15895.4 NA [12,] 12645.1 12798.3 10651.9 11627.2 13375.6 14142.8 13949.5 14912.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 490.1 -175.8 470.2 590.0 735.7 806.7 1280.5 26.0 NA [2,] 2041.1 2039.4 -31.3 655.2 2449.2 2140.3 1478.2 1808.5 NA [3,] -2646.1 -2115.8 971.1 -576.0 -1019.1 -2051.6 -2188.6 -427.6 NA [4,] 1829.2 962.8 -742.7 -305.6 -362.3 1589.9 467.1 -115.3 NA [5,] 154.8 789.0 885.3 1479.7 2014.7 -660.2 55.9 -543.4 NA [6,] -1510.9 -975.9 -332.6 -510.3 -1666.7 -617.0 -482.2 1093.9 NA [7,] -1120.8 -1444.8 -3030.5 -1706.8 -1073.0 -1655.0 -1368.7 -3185.5 NA [8,] 2564.6 1562.6 3237.2 2895.4 2851.1 1831.3 1011.9 2874.8 NA [9,] 276.0 1582.7 -778.1 -251.3 -634.5 -412.1 1404.2 636.8 NA [10,] 60.1 -1313.5 -3162.3 -249.3 -236.0 332.8 -1005.6 -1419.7 NA [11,] -1867.6 -1932.9 -1047.5 -480.7 -789.4 -1373.1 -1715.9 -983.3 NA [12,] 1175.4 1414.8 -565.0 -521.3 835.2 869.9 1197.4 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/1cg1h1424985043.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/2rp6h1424985043.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/37gzz1424985043.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/407va1424985043.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] [1,] 10086.90 10676.90 11332.10 10756.10 10450.50 14243.7 11419.90 9713.1 [2,] 11740.25 12353.15 14471.40 12765.70 13499.15 14583.9 12995.10 11898.2 [3,] 14015.65 14164.00 15294.95 14337.25 14705.75 15542.9 14881.55 12651.0 [4,] 14612.90 15095.20 17069.60 15602.95 16244.20 15965.5 15528.35 13783.7 [5,] 15146.90 16293.20 17771.40 16553.80 16696.10 16105.8 16989.00 14254.9 [,9] [,10] [,11] [,12] [1,] 12608.50 12357.20 11699.40 10651.90 [2,] 14319.30 14426.80 13136.45 12136.15 [3,] 15151.15 15022.40 14621.95 13086.95 [4,] 15617.50 16357.85 15590.65 14046.15 [5,] 16678.30 17315.10 15895.40 14912.10 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12410.95 12632.25 13843.56 12752.32 13172.33 14771.12 13466.44 11597.73 [2,] 15620.35 15695.75 16746.34 15922.18 16239.17 16314.68 16296.66 13704.27 [,9] [,10] [,11] [,12] [1,] 14425.96 13943.69 13251.0 12020.0 [2,] 15876.34 16101.11 15992.9 14153.9 $out [1] 11930.2 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(10086.9, 11740.25, 14015.65, 14612.9, 15146.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50evr1424985043.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,] -175.80 -31.30 -2646.10 -742.70 -660.20 -1666.70 -3185.50 1011.90 -778.10 [2,] 248.10 1066.70 -2152.20 -333.95 -243.75 -1243.40 -2368.65 1696.95 -523.30 [3,] 540.05 1923.95 -1535.35 175.90 471.90 -563.65 -1549.90 2707.85 12.35 [4,] 771.20 2090.70 -501.80 1276.35 1182.50 -407.40 -1244.75 2885.10 1020.50 [5,] 1280.50 2449.20 971.10 1829.20 2014.70 -332.60 -1073.00 3237.20 1582.70 [,10] [,11] [,12] [1,] -3162.30 -1932.90 -565.00 [2,] -1366.60 -1791.75 156.95 [3,] -627.45 -1210.30 869.90 [4,] -87.95 -886.35 1186.40 [5,] 332.80 -480.70 1414.80 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 247.8388 1351.929 -2457.2871 -723.6367 -324.8237 -1030.6516 -2177.7267 [2,] 832.2612 2495.971 -613.4129 1075.4367 1268.6237 -96.6484 -922.0733 [,8] [,9] [,10] [,11] [,12] [1,] 2044.132 -850.0388 -1341.72225 -1716.0694 255.1291 [2,] 3371.568 874.7388 86.82225 -704.5306 1484.6709 $out [1] 1093.9 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-175.799999999999, 248.099999999999, 540.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67yre1424985043.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] [1,] 11612.00 12798.30 10651.90 9713.10 11105.90 13763.90 13949.50 13803.50 [2,] 12509.85 13606.50 13307.85 10563.70 12546.90 14614.15 15139.75 15159.90 [3,] 13476.80 14403.10 14772.50 11376.00 13323.65 15301.00 15644.50 16166.95 [4,] 14348.15 15025.65 15528.10 12019.05 14345.90 15815.55 16199.50 16829.85 [5,] 14905.80 16044.70 15765.70 12608.50 15035.50 17157.80 17771.40 17315.10 [,9] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12638.34 13755.82 13759.83 10712.21 12503.11 14753.03 15161.14 15405.27 [2,] 14315.26 15050.38 15785.17 12039.79 14144.19 15848.97 16127.86 16928.63 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(11612, 12509.85, 13476.8, 14348.15, 14905.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fkqr1424985043.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,] 12579.23 12651.00 12907.55 [2,] 13510.39 14089.83 13533.93 [3,] 14344.49 14663.85 14453.89 [4,] 14980.21 15086.78 15159.49 [5,] 15346.92 15542.90 15793.60 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 13674.09 14209.13 13712.46 [2,] 15014.88 15118.57 15195.33 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(12579.225, 13510.3875, 14344.4875, 14980.20625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cg1h1424985043.ps tmp/1cg1h1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/2rp6h1424985043.ps tmp/2rp6h1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/37gzz1424985043.ps tmp/37gzz1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/407va1424985043.ps tmp/407va1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/50evr1424985043.ps tmp/50evr1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/67yre1424985043.ps tmp/67yre1424985043.png",intern=TRUE)) character(0) > try(system("convert tmp/7fkqr1424985043.ps tmp/7fkqr1424985043.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.548 0.452 3.025