R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(113149,112534,108783,106640,102617,102191,117359,116083,108666,105017,100918,103907,105732,103409,100255,97036,94055,92523,106380,104846,101411,98072,95678,99148,106813,106782,103496,100854,99592,98923,110497,114783,113551,112376,111683,113467,117277,117442,115640,114872,111628,111098,124301,125847,125323,122394,121164,123963,130549,128563,125418,121982,117708,116905,128862,129655,128649,126084,123725,123974) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 113149 105732 106813 117277 130549 NA [2,] 112534 103409 106782 117442 128563 NA [3,] 108783 100255 103496 115640 125418 NA [4,] 106640 97036 100854 114872 121982 NA [5,] 102617 94055 99592 111628 117708 NA [6,] 102191 92523 98923 111098 116905 NA [7,] 117359 106380 110497 124301 128862 NA [8,] 116083 104846 114783 125847 129655 NA [9,] 108666 101411 113551 125323 128649 NA [10,] 105017 98072 112376 122394 126084 NA [11,] 100918 95678 111683 121164 123725 NA [12,] 103907 99148 113467 123963 123974 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -615 -2323 -31 165 -1986 NA [2,] -3751 -3154 -3286 -1802 -3145 NA [3,] -2143 -3219 -2642 -768 -3436 NA [4,] -4023 -2981 -1262 -3244 -4274 NA [5,] -426 -1532 -669 -530 -803 NA [6,] 15168 13857 11574 13203 11957 NA [7,] -1276 -1534 4286 1546 793 NA [8,] -7417 -3435 -1232 -524 -1006 NA [9,] -3649 -3339 -1175 -2929 -2565 NA [10,] -4099 -2394 -693 -1230 -2359 NA [11,] 2989 3470 1784 2799 249 NA [12,] 1825 7665 3810 6586 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/1m7zj1457195640.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/24wg01457195640.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/3pj681457195640.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/4byny1457195640.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] [1,] 105732 103409 100255 97036 94055 92523 106380 104846 101411 98072 [2,] 106813 106782 103496 100854 99592 98923 110497 114783 108666 105017 [3,] 113149 112534 108783 106640 102617 102191 117359 116083 113551 112376 [4,] 117277 117442 115640 114872 111628 111098 124301 125847 125323 122394 [5,] 130549 128563 125418 121982 117708 116905 128862 129655 128649 126084 [,11] [,12] [1,] 95678 99148 [2,] 100918 103907 [3,] 111683 113467 [4,] 121164 123963 [5,] 123725 123974 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105755.2 105001.7 100202.1 96734.92 94112.39 93588.18 107605.1 108265.2 [2,] 120542.8 120066.3 117363.9 116545.08 111121.61 110793.82 127112.9 123900.8 [,9] [,10] [,11] [,12] [1,] 101781.2 100097.5 97377.23 99295.48 [2,] 125320.8 124654.5 125988.77 127638.52 $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(105732, 106813, 113149, 117277, 130549, 103409, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ur3g1457195640.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,] -2323 -3286 -3436 -4274 -803 11574 -1534 -3435 -3649 -4099 249 1825.0 [2,] -1986 -3286 -3219 -4023 -803 11957 -1276 -3435 -3339 -2394 1784 2817.5 [3,] -615 -3154 -2642 -3244 -669 13203 793 -1232 -2929 -2359 2799 5198.0 [4,] -31 -3145 -2143 -2981 -530 13857 1546 -1006 -2565 -1230 2989 7125.5 [5,] 165 -3145 -768 -2981 -426 15168 4286 -524 -2565 -693 3470 7665.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1996.3981 -3253.63 -3402.299 -3980.275 -861.9011 11860.46 -1201.018 [2,] 766.3981 -3054.37 -1881.701 -2507.725 -476.0989 14545.54 2787.018 [,8] [,9] [,10] [,11] [,12] [1,] -2948.3253 -3475.906 -3181.479 1947.55 1794.68 [2,] 484.3253 -2382.094 -1536.521 3650.45 8601.32 $out [1] -3751 -1802 -1262 -1532 -7417 -1175 $group [1] 2 2 4 5 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2323, -1986, -615, -31, 165, -3286, -3286, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63tuv1457195640.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] [1,] 100918.0 92523.0 98923.0 111098 116905.0 NA [2,] 103262.0 96357.0 102175.0 115256 122853.5 NA [3,] 107653.0 99701.5 108655.0 119303 125751.0 NA [4,] 112841.5 104127.5 112921.5 124132 128755.5 NA [5,] 117359.0 106380.0 114783.0 125847 130549.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103283.7 96157.32 103753.4 115254.6 123059.1 NA [2,] 112022.3 103245.68 113556.6 123351.4 128442.9 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(100918, 103262, 107653, 112841.5, 117359, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7im8g1457195640.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,] 104328.0 102191.0 105010.5 [2,] 109455.2 107711.5 108715.5 [3,] 112840.2 112455.0 112078.5 [4,] 115112.0 113509.0 115464.8 [5,] 118242.8 117359.0 120315.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110260.1 109810.7 109000.1 [2,] 115420.3 115099.3 115156.9 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104328, 109455.2, 112840.2, 115112, 118242.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1m7zj1457195640.ps tmp/1m7zj1457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/24wg01457195640.ps tmp/24wg01457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/3pj681457195640.ps tmp/3pj681457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/4byny1457195640.ps tmp/4byny1457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/5ur3g1457195640.ps tmp/5ur3g1457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/63tuv1457195640.ps tmp/63tuv1457195640.png",intern=TRUE)) character(0) > try(system("convert tmp/7im8g1457195640.ps tmp/7im8g1457195640.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.658 0.442 3.128