R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(29054.50 + ,28543.50 + ,28032.00 + ,27009.50 + ,37356.00 + ,36844.50 + ,29054.50 + ,23881.50 + ,24392.50 + ,24392.50 + ,24904.00 + ,25982.00 + ,22859.00 + ,19731.00 + ,17169.50 + ,17169.50 + ,27009.50 + ,28032.00 + ,20242.00 + ,11429.50 + ,16091.50 + ,16091.50 + ,19731.00 + ,21831.50 + ,21320.00 + ,16091.50 + ,18708.50 + ,17681.00 + ,26493.50 + ,24392.50 + ,16091.50 + ,9891.00 + ,15580.00 + ,17169.50 + ,18708.50 + ,20753.50 + ,16602.50 + ,13019.00 + ,14558.00 + ,15069.00 + ,28543.50 + ,28543.50 + ,20753.50 + ,19731.00 + ,22859.00 + ,21320.00 + ,25471.00 + ,30644.00 + ,31671.50 + ,24392.50 + ,22342.50 + ,20242.00 + ,34283.50 + ,35311.00 + ,32694.00 + ,35311.00 + ,34794.50 + ,30644.00 + ,35311.00 + ,40484.00 + ,42584.50 + ,36333.50 + ,32182.50 + ,35311.00 + ,48785.00 + ,52936.00 + ,51913.50 + ,53958.00 + ,53447.00 + ,48274.00 + ,57086.50 + ,59187.00 + ,62259.50 + ,52936.00 + ,49296.50 + ,53447.00 + ,63337.50 + ,72150.00 + ,70049.50 + ,70049.50 + ,71077.00 + ,67488.00 + ,76817.00 + ,76817.00 + ,75227.50 + ,66410.00 + ,67999.50 + ,69027.00 + ,75789.50 + ,84602.00 + ,78350.50 + ,81479.00 + ,78862.00 + ,77328.00 + ,89269.00 + ,86652.00 + ,83012.50 + ,77839.50 + ,83012.50 + ,85629.50 + ,88752.50 + ,92903.00 + ,88752.50 + ,91314.00 + ,88190.50 + ,87679.50 + ,100642.50 + ,101720.50 + ,97570.00 + ,90291.50 + ,96492.00 + ,99104.00 + ,102232.00 + ,106894.00 + ,102232.00 + ,105871.50 + ,104282.00 + ,98592.50 + ,110533.00 + ,110533.00) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (n <- length(x)) [1] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 29054.5 22859.0 21320.0 16602.5 31671.5 42584.5 62259.5 75227.5 83012.5 [2,] 28543.5 19731.0 16091.5 13019.0 24392.5 36333.5 52936.0 66410.0 77839.5 [3,] 28032.0 17169.5 18708.5 14558.0 22342.5 32182.5 49296.5 67999.5 83012.5 [4,] 27009.5 17169.5 17681.0 15069.0 20242.0 35311.0 53447.0 69027.0 85629.5 [5,] 37356.0 27009.5 26493.5 28543.5 34283.5 48785.0 63337.5 75789.5 88752.5 [6,] 36844.5 28032.0 24392.5 28543.5 35311.0 52936.0 72150.0 84602.0 92903.0 [7,] 29054.5 20242.0 16091.5 20753.5 32694.0 51913.5 70049.5 78350.5 88752.5 [8,] 23881.5 11429.5 9891.0 19731.0 35311.0 53958.0 70049.5 81479.0 91314.0 [9,] 24392.5 16091.5 15580.0 22859.0 34794.5 53447.0 71077.0 78862.0 88190.5 [10,] 24392.5 16091.5 17169.5 21320.0 30644.0 48274.0 67488.0 77328.0 87679.5 [11,] 24904.0 19731.0 18708.5 25471.0 35311.0 57086.5 76817.0 89269.0 100642.5 [12,] 25982.0 21831.5 20753.5 30644.0 40484.0 59187.0 76817.0 86652.0 101720.5 [,10] [,11] [1,] 97570.0 NA [2,] 90291.5 NA [3,] 96492.0 NA [4,] 99104.0 NA [5,] 102232.0 NA [6,] 106894.0 NA [7,] 102232.0 NA [8,] 105871.5 NA [9,] 104282.0 NA [10,] 98592.5 NA [11,] 110533.0 NA [12,] 110533.0 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -511.0 -3128.0 -5228.5 -3583.5 -7279.0 -6251.0 -9323.5 -8817.5 -5173.0 [2,] -511.5 -2561.5 2617.0 1539.0 -2050.0 -4151.0 -3639.5 1589.5 5173.0 [3,] -1022.5 0.0 -1027.5 511.0 -2100.5 3128.5 4150.5 1027.5 2617.0 [4,] 10346.5 9840.0 8812.5 13474.5 14041.5 13474.0 9890.5 6762.5 3123.0 [5,] -511.5 1022.5 -2101.0 0.0 1027.5 4151.0 8812.5 8812.5 4150.5 [6,] -7790.0 -7790.0 -8301.0 -7790.0 -2617.0 -1022.5 -2100.5 -6251.5 -4150.5 [7,] -5173.0 -8812.5 -6200.5 -1022.5 2617.0 2044.5 0.0 3128.5 2561.5 [8,] 511.0 4662.0 5689.0 3128.0 -516.5 -511.0 1027.5 -2617.0 -3123.5 [9,] 0.0 0.0 1589.5 -1539.0 -4150.5 -5173.0 -3589.0 -1534.0 -511.0 [10,] 511.5 3639.5 1539.0 4151.0 4667.0 8812.5 9329.0 11941.0 12963.0 [11,] 1078.0 2100.5 2045.0 5173.0 5173.0 2100.5 0.0 -2617.0 1078.0 [12,] -3123.0 -511.5 -4151.0 1027.5 2100.5 3072.5 -1589.5 -3639.5 -4150.5 [,10] [,11] [1,] -7278.5 NA [2,] 6200.5 NA [3,] 2612.0 NA [4,] 3128.0 NA [5,] 4662.0 NA [6,] -4662.0 NA [7,] 3639.5 NA [8,] -1589.5 NA [9,] -5689.5 NA [10,] 11940.5 NA [11,] 0.0 NA [12,] 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/1hpkz1470781938.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/29moi1470781938.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/35y1q1470781938.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/4mlmc1470781938.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,] 16602.5 13019.0 14558.00 15069.00 26493.5 24392.50 16091.50 9891.0 [2,] 22859.0 19731.0 18708.50 17681.00 28543.5 28543.50 20753.50 19731.0 [3,] 37128.0 32438.5 30107.25 31160.25 43070.5 44890.25 42303.75 44634.5 [4,] 75227.5 66410.0 67999.50 69027.00 75789.5 84602.00 78350.50 81479.0 [5,] 97570.0 90291.5 96492.00 99104.00 102232.0 106894.00 102232.00 105871.5 [,9] [,10] [,11] [,12] [1,] 15580.00 16091.5 18708.50 20753.5 [2,] 22859.00 21320.0 24904.00 25982.0 [3,] 44120.75 39459.0 46198.75 49835.5 [4,] 78862.00 77328.0 89269.00 86652.0 [5,] 104282.00 98592.5 110533.00 110533.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 10962.61 9115.81 5479.501 5505.741 19464.51 16881.19 13525.99 13782.74 [2,] 63293.39 55761.19 54734.999 56814.759 66676.49 72899.31 71081.51 75486.26 [,9] [,10] [,11] [,12] [1,] 16139.42 11475.17 14039.43 19522.35 [2,] 72102.08 67442.83 78358.07 80148.65 $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(16602.5, 22859, 37128, 75227.5, 97570, 13019, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5w9oo1470781938.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,] -9323.50 -4151.00 -2100.50 3123.00 -2101.0 -8301.00 -8812.50 -3123.5 [2,] -7279.00 -2561.50 -1022.50 6762.50 0.0 -7790.00 -5173.00 -1589.5 [3,] -5739.75 513.75 769.25 9865.25 2589.0 -5456.75 1022.25 0.0 [4,] -3583.50 2617.00 2617.00 13474.00 4662.0 -2617.00 2617.00 3128.0 [5,] -511.00 6200.50 4150.50 14041.50 8812.5 -1022.50 3639.50 5689.0 [,9] [,10] [,11] [,12] [1,] -5689.5 511.50 -2617.0 -4151.0 [2,] -4150.5 3639.50 0.0 -3639.5 [3,] -1536.5 6739.75 1561.5 -1589.5 [4,] 0.0 11940.50 2100.5 1027.5 [5,] 1589.5 12963.00 5173.0 3072.5 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7586.169 -2073.635 -1049.189 6511.917 259.6789 -8041.387 -2869.945 [2,] -3893.331 3101.135 2587.689 13218.583 4918.3211 -2872.113 4914.445 [,8] [,9] [,10] [,11] [,12] [1,] -2357.051 -3610.2553 2592.239 512.0065 -4047.4533 [2,] 2357.051 537.2553 10887.261 2610.9935 868.4533 $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(-9323.5, -7279, -5739.75, -3583.5, -511, -4151, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cf6i1470781938.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,] 23881.50 11429.50 9891.00 13019.00 20242.00 32182.50 49296.50 66410.00 [2,] 24648.25 16630.50 16091.50 15835.75 27518.25 39459.00 57853.25 72127.25 [3,] 27520.75 19731.00 18194.75 21036.75 33488.75 50349.25 68768.75 77839.25 [4,] 29054.50 22345.25 21036.75 27007.25 35311.00 53702.50 71613.50 83040.50 [5,] 29054.50 28032.00 26493.50 30644.00 40484.00 59187.00 76817.00 89269.00 [,9] [,10] [,11] [1,] 77839.5 90291.50 NA [2,] 84321.0 98081.25 NA [3,] 88471.5 102232.00 NA [4,] 92108.5 106382.75 NA [5,] 101720.5 110533.00 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25511.03 17124.46 15939.19 15941.35 29934.42 43852.69 62492.61 72861.64 [2,] 29530.47 22337.54 20450.31 26132.15 37043.08 56845.81 75044.89 82816.86 [,9] [,10] [,11] [1,] 84919.57 98445.63 NA [2,] 92023.43 106018.37 NA $out [1] 37356.0 36844.5 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(23881.5, 24648.25, 27520.75, 29054.5, 29054.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tsmw1470781938.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,] 42558.80 30107.25 41470.38 [2,] 46092.55 34783.25 45082.81 [3,] 50624.60 42687.12 49623.56 [4,] 54552.80 44762.38 53464.19 [5,] 57460.45 49835.50 55862.19 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 46765.82 38135.58 45800.76 [2,] 54483.38 47238.67 53446.36 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(42558.8, 46092.55, 50624.6, 54552.8, 57460.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hpkz1470781938.ps tmp/1hpkz1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/29moi1470781938.ps tmp/29moi1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/35y1q1470781938.ps tmp/35y1q1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/4mlmc1470781938.ps tmp/4mlmc1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/5w9oo1470781938.ps tmp/5w9oo1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/6cf6i1470781938.ps tmp/6cf6i1470781938.png",intern=TRUE)) character(0) > try(system("convert tmp/7tsmw1470781938.ps tmp/7tsmw1470781938.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.516 0.222 2.778