R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(13953.3,14657.7,16686.2,15232.4,15014.1,16688.6,13969.6,14546.8,16292,15039,17433.8,17798.4,16870.9,16659.3,19620.4,15953.5,17420.9,17647.5,15200.8,15637.3,17124.5,17659.4,17815,16165.6,17416.6,16823.9,19171.2,16806.8,18112.8,18485.5,17668,16324.3,17877.5,20136.7,19307,17776.3,19861.3,18757,19879.3,21068.4,19358,20639.2,20008.1,18150.1,21180.4,20428.9,17241.2,15969.3,14972.4,14488.3,15885.1,14305.3,13891.5,15431.6,14199.3,13542.6,16226.3,16786.1,16034.3,16744.5,15896.5,15781.8,18590.3,17416.8,16983,18829.4,16748.6,16502.8,18616.6,19136.4,19523.9,18970.2,20118.2,20125.4,23117.8,20014.6,22228.5,20819.1,19208.9,19953.3,21041.3,20006.8,21045.1,20496.3,20873.5,21304.2,23137.8,20514.2,21343.5,20967.2,20024.4,19602.7,19804.1,22173.9,21802.6,19452.2) > 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,] 13953.3 16870.9 17416.6 19861.3 14972.4 15896.5 20118.2 20873.5 NA [2,] 14657.7 16659.3 16823.9 18757.0 14488.3 15781.8 20125.4 21304.2 NA [3,] 16686.2 19620.4 19171.2 19879.3 15885.1 18590.3 23117.8 23137.8 NA [4,] 15232.4 15953.5 16806.8 21068.4 14305.3 17416.8 20014.6 20514.2 NA [5,] 15014.1 17420.9 18112.8 19358.0 13891.5 16983.0 22228.5 21343.5 NA [6,] 16688.6 17647.5 18485.5 20639.2 15431.6 18829.4 20819.1 20967.2 NA [7,] 13969.6 15200.8 17668.0 20008.1 14199.3 16748.6 19208.9 20024.4 NA [8,] 14546.8 15637.3 16324.3 18150.1 13542.6 16502.8 19953.3 19602.7 NA [9,] 16292.0 17124.5 17877.5 21180.4 16226.3 18616.6 21041.3 19804.1 NA [10,] 15039.0 17659.4 20136.7 20428.9 16786.1 19136.4 20006.8 22173.9 NA [11,] 17433.8 17815.0 19307.0 17241.2 16034.3 19523.9 21045.1 21802.6 NA [12,] 17798.4 16165.6 17776.3 15969.3 16744.5 18970.2 20496.3 19452.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 704.4 -211.6 -592.7 -1104.3 -484.1 -114.7 7.2 430.7 NA [2,] 2028.5 2961.1 2347.3 1122.3 1396.8 2808.5 2992.4 1833.6 NA [3,] -1453.8 -3666.9 -2364.4 1189.1 -1579.8 -1173.5 -3103.2 -2623.6 NA [4,] -218.3 1467.4 1306.0 -1710.4 -413.8 -433.8 2213.9 829.3 NA [5,] 1674.5 226.6 372.7 1281.2 1540.1 1846.4 -1409.4 -376.3 NA [6,] -2719.0 -2446.7 -817.5 -631.1 -1232.3 -2080.8 -1610.2 -942.8 NA [7,] 577.2 436.5 -1343.7 -1858.0 -656.7 -245.8 744.4 -421.7 NA [8,] 1745.2 1487.2 1553.2 3030.3 2683.7 2113.8 1088.0 201.4 NA [9,] -1253.0 534.9 2259.2 -751.5 559.8 519.8 -1034.5 2369.8 NA [10,] 2394.8 155.6 -829.7 -3187.7 -751.8 387.5 1038.3 -371.3 NA [11,] 364.6 -1649.4 -1530.7 -1271.9 710.2 -553.7 -548.8 -2350.4 NA [12,] -927.5 1251.0 2085.0 -996.9 -848.0 1148.0 377.2 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/1tt061382103049.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/2gxm81382103049.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/3qad01382103049.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/4142x1382103049.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,] 13953.30 14488.30 15885.10 14305.30 13891.50 15431.60 13969.60 13542.60 [2,] 15434.45 15219.75 17638.25 15592.95 15998.55 17168.05 14700.05 15092.05 [3,] 17143.75 16741.60 19395.80 17111.80 17766.85 18657.45 17208.30 16413.55 [4,] 19989.75 19441.20 21498.55 20264.40 20350.75 20729.15 19608.50 18876.40 [5,] 20873.50 21304.20 23137.80 21068.40 22228.50 20967.20 20024.40 19953.30 [,9] [,10] [,11] [,12] [1,] 16226.30 15039.00 16034.3 15969.30 [2,] 16708.25 17222.75 17337.5 16455.05 [3,] 18247.05 19571.60 18561.0 17787.35 [4,] 20422.70 20282.80 20284.5 19211.20 [5,] 21180.40 22173.90 21802.6 20496.30 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 14599.09 14383.44 17239.38 14502.26 15335.65 16668.17 14466.37 14299.56 [2,] 19688.41 19099.76 21552.22 19721.34 20198.05 20646.73 19950.23 18527.54 [,9] [,10] [,11] [,12] [1,] 16172.1 17862.21 16914.76 16247.73 [2,] 20322.0 21280.99 20207.24 19326.97 $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(13953.3, 15434.45, 17143.75, 19989.75, 20873.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/569pj1382103049.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] [1,] -1104.30 1122.3 -3666.90 -1710.4 -1409.40 -2719.00 -1858.00 201.40 [2,] -538.40 1615.2 -2863.40 -423.8 -74.85 -2263.75 -1000.20 1287.60 [3,] -163.15 2187.9 -1972.10 305.5 826.95 -1421.25 -333.75 1649.20 [4,] 218.95 2884.8 -1313.65 1386.7 1607.30 -880.15 506.85 2398.75 [5,] 704.40 2992.4 -1173.50 2213.9 1846.40 -631.10 744.40 3030.30 [,9] [,10] [,11] [,12] [1,] -1253.00 -829.70 -2350.40 -996.90 [2,] -893.00 -790.75 -1590.05 -887.75 [3,] 527.35 -107.85 -912.80 377.20 [4,] 1409.50 712.90 -92.10 1199.50 [5,] 2369.80 2394.80 710.20 2085.00 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -586.2166 1478.683 -2837.813 -705.8713 -112.7231 -2194.1488 -1175.6098 [2,] 259.9166 2897.117 -1106.387 1316.8713 1766.6231 -648.3512 508.1098 [,8] [,9] [,10] [,11] [,12] [1,] 1028.496 -758.8596 -947.8105 -1749.57638 -869.272 [2,] 2269.904 1813.5596 732.1105 -76.02362 1623.672 $out [1] 1189.1 -3187.7 $group [1] 3 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1104.3, -538.399999999999, -163.150000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68a7n1382103049.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,] 13953.30 15200.80 16324.30 15969.30 13542.6 15781.80 19208.90 19452.20 [2,] 14602.25 16059.55 17120.25 18453.55 14252.3 16625.70 20010.70 19914.25 [3,] 15135.70 16997.70 17826.90 19870.30 15202.0 18003.55 20310.85 20920.35 [4,] 16687.40 17653.45 18828.35 20534.05 16130.3 18899.80 21043.20 21573.05 [5,] 17798.40 19620.40 20136.70 21180.40 16786.1 19523.90 22228.50 23137.80 [,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,] 14184.65 16270.71 17047.82 18921.37 14345.43 16966.32 19839.92 20163.76 [2,] 16086.75 17724.69 18605.98 20819.23 16058.57 19040.78 20781.78 21676.94 [,9] [1,] NA [2,] NA $out [1] 23117.8 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(13953.3, 14602.25, 15135.7, 16687.4, 17798.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71kjw1382103049.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,] 16782.49 16413.55 16938.96 [2,] 17410.02 17127.78 17547.72 [3,] 17982.82 17777.10 18064.47 [4,] 18731.94 18609.22 18735.17 [5,] 19511.01 19571.60 19401.60 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17379.88 17101.4 17522.86 [2,] 18585.75 18452.8 18606.07 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(16782.4875, 17410.01875, 17982.81875, 18731.9375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tt061382103049.ps tmp/1tt061382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/2gxm81382103049.ps tmp/2gxm81382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/3qad01382103049.ps tmp/3qad01382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/4142x1382103049.ps tmp/4142x1382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/569pj1382103049.ps tmp/569pj1382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/68a7n1382103049.ps tmp/68a7n1382103049.png",intern=TRUE)) character(0) > try(system("convert tmp/71kjw1382103049.ps tmp/71kjw1382103049.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.319 1.085 6.388