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(3221816.00 + ,3209817.00 + ,3197649.00 + ,3172468.00 + ,3421574.00 + ,3408392.00 + ,3221816.00 + ,3097770.00 + ,3109769.00 + ,3109769.00 + ,3123120.00 + ,3147118.00 + ,3184467.00 + ,3184467.00 + ,3160469.00 + ,3097770.00 + ,3421574.00 + ,3470922.00 + ,3396393.00 + ,3221816.00 + ,3296514.00 + ,3184467.00 + ,3234998.00 + ,3259165.00 + ,3284346.00 + ,3221816.00 + ,3234998.00 + ,3147118.00 + ,3421574.00 + ,3508271.00 + ,3433742.00 + ,3296514.00 + ,3445741.00 + ,3284346.00 + ,3433742.00 + ,3421574.00 + ,3458923.00 + ,3321695.00 + ,3470922.00 + ,3458923.00 + ,3682848.00 + ,3632317.00 + ,3433742.00 + ,3333694.00 + ,3470922.00 + ,3284346.00 + ,3421574.00 + ,3445741.00 + ,3496272.00 + ,3384394.00 + ,3445741.00 + ,3483090.00 + ,3620318.00 + ,3508271.00 + ,3359044.00 + ,3197649.00 + ,3347045.00 + ,2936375.00 + ,3135119.00 + ,3246997.00 + ,3359044.00 + ,3197649.00 + ,3197649.00 + ,3197649.00 + ,3284346.00 + ,3160469.00 + ,2997891.00 + ,2861846.00 + ,2960542.00 + ,2575222.00 + ,2811315.00 + ,2948543.00 + ,2973724.00 + ,2836496.00 + ,2848495.00 + ,2811315.00 + ,2936375.00 + ,2848495.00 + ,2675270.00 + ,2550041.00 + ,2761798.00 + ,2301949.00 + ,2600572.00 + ,2736617.00 + ,2736617.00 + ,2575222.00 + ,2425995.00 + ,2413996.00 + ,2550041.00 + ,2425995.00 + ,2190071.00 + ,2027493.00 + ,2202070.00 + ,1791569.00 + ,2164721.00 + ,2363296.00 + ,2425995.00 + ,2288767.00 + ,2115373.00 + ,2239419.00 + ,2288767.00 + ,2251418.00 + ,1878097.00 + ,1704872.00 + ,1828749.00 + ,1455597.00 + ,1840917.00 + ,1978145.00 + ,2090023.00 + ,1903447.00 + ,1728870.00 + ,1828749.00 + ,1878097.00 + ,1779401.00 + ,1406249.00 + ,1243671.00 + ,1392898.00 + ,982397.00 + ,1430247.00 + ,1704872.00) > 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] 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,] 3221816 3184467 3284346 3458923 3496272 3359044 2973724 2736617 2425995 [2,] 3209817 3184467 3221816 3321695 3384394 3197649 2836496 2575222 2288767 [3,] 3197649 3160469 3234998 3470922 3445741 3197649 2848495 2425995 2115373 [4,] 3172468 3097770 3147118 3458923 3483090 3197649 2811315 2413996 2239419 [5,] 3421574 3421574 3421574 3682848 3620318 3284346 2936375 2550041 2288767 [6,] 3408392 3470922 3508271 3632317 3508271 3160469 2848495 2425995 2251418 [7,] 3221816 3396393 3433742 3433742 3359044 2997891 2675270 2190071 1878097 [8,] 3097770 3221816 3296514 3333694 3197649 2861846 2550041 2027493 1704872 [9,] 3109769 3296514 3445741 3470922 3347045 2960542 2761798 2202070 1828749 [10,] 3109769 3184467 3284346 3284346 2936375 2575222 2301949 1791569 1455597 [11,] 3123120 3234998 3433742 3421574 3135119 2811315 2600572 2164721 1840917 [12,] 3147118 3259165 3421574 3445741 3246997 2948543 2736617 2363296 1978145 [,10] [,11] [1,] 2090023 NA [2,] 1903447 NA [3,] 1728870 NA [4,] 1828749 NA [5,] 1878097 NA [6,] 1779401 NA [7,] 1406249 NA [8,] 1243671 NA [9,] 1392898 NA [10,] 982397 NA [11,] 1430247 NA [12,] 1704872 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -11999 0 -62530 -137228 -111878 -161395 -137228 -161395 -137228 [2,] -12168 -23998 13182 149227 61347 0 11999 -149227 -173394 [3,] -25181 -62699 -87880 -11999 37349 0 -37180 -11999 124046 [4,] 249106 323804 274456 223925 137228 86697 125060 136045 49348 [5,] -13182 49348 86697 -50531 -112047 -123877 -87880 -124046 -37349 [6,] -186576 -74529 -74529 -198575 -149227 -162578 -173225 -235924 -373321 [7,] -124046 -174577 -137228 -100048 -161395 -136045 -125229 -162578 -173225 [8,] 11999 74698 149227 137228 149396 98696 211757 174577 123877 [9,] 0 -112047 -161395 -186576 -410670 -385320 -459849 -410501 -373152 [10,] 13351 50531 149396 137228 198744 236093 298623 373152 385320 [11,] 23998 24167 -12168 24167 111878 137228 136045 198575 137228 [12,] 37349 25181 37349 50531 112047 25181 0 62699 111878 [,10] [,11] [1,] -186576 NA [2,] -174577 NA [3,] 99879 NA [4,] 49348 NA [5,] -98696 NA [6,] -373152 NA [7,] -162578 NA [8,] 149227 NA [9,] -410501 NA [10,] 447850 NA [11,] 274625 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/137581438957145.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/2hqqj1438957145.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/36dz31438957145.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/47ig01438957145.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,] 2090023 1903447 1728870 1828749 1878097 1779401 1406249 1243671 1392898 [2,] 2736617 2575222 2425995 2413996 2550041 2425995 2190071 2027493 2202070 [3,] 3203142 3191058 3179059 3122444 3352960 3284430 3109854 2979808 3035156 [4,] 3359044 3221816 3234998 3197649 3421574 3508271 3396393 3221816 3347045 [5,] 3496272 3384394 3470922 3483090 3682848 3632317 3433742 3333694 3470922 [,10] [,11] [,12] [1,] 982397 1430247 1704872 [2,] 1791569 2164721 2363296 [3,] 2755798 2967218 3047830 [4,] 3184467 3234998 3259165 [5,] 3284346 3433742 3445741 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 2892152 2867994 2774849 2730900 2917507 2743682 2507127 2383077 2463080 [2,] 3514131 3514122 3583269 3513988 3788413 3825179 3712580 3576539 3607231 [,10] [,11] [,12] [1,] 2059851 2432464 2600219 [2,] 3451746 3501971 3495442 $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(2090023, 2736617, 3203141.5, 3359044, 3496272, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kcxj1438957145.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,] -186576 -174577 -87880 49348.0 -124046.0 -235924.0 -174577.0 74698.0 [2,] -161395 -149227 -37180 86697.0 -112047.0 -235924.0 -162578.0 98696.0 [3,] -137228 -6084 -11999 136636.5 -69205.5 -179900.5 -149311.5 143227.5 [4,] -62530 13182 37349 249106.0 -13182.0 -149227.0 -125229.0 149396.0 [5,] 0 149227 124046 323804.0 86697.0 -74529.0 -100048.0 211757.0 [,9] [,10] [,11] [,12] [1,] -459849 13351.0 -12168.0 0 [2,] -410501 137228.0 24167.0 25181 [3,] -379236 217418.5 123961.5 37349 [4,] -161395 373152.0 137228.0 62699 [5,] 0 447850.0 274625.0 112047 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -186624.9 -87230.01 -49236.66 55490.49 -118602.4 -223217.8 -167972.5 [2,] -87831.1 75062.01 25238.66 217782.51 -19808.6 -136583.2 -130650.5 [,8] [,9] [,10] [,11] [,12] [1,] 117895.8 -503699.3 99541.46 67471.72 17589.52 [2,] 168559.2 -254772.7 335295.54 180451.28 57108.48 $out [1] -373321 -373152 11999 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-186576, -161395, -137228, -62530, 0, -174577, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60m1y1438957145.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,] 3097770 3097770 3147118 3284346 2936375 2575222 2550041 1791569 1455597 [2,] 3116444 3184467 3259672 3377634 3222323 2905194 2637921 2177396 1834833 [3,] 3185058 3228407 3359044 3452332 3371719 3079180 2786556 2388646 2046759 [4,] 3221816 3346454 3433742 3470922 3489681 3197649 2848495 2488018 2270092 [5,] 3221816 3470922 3508271 3470922 3620318 3359044 2973724 2736617 2425995 [,10] [,11] [1,] 982397 NA [2,] 1399574 NA [3,] 1716871 NA [4,] 1853423 NA [5,] 2090023 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3136998 3154524 3279650 3409783 3249775 2945790 2690512 2246969 1848234 [2,] 3233119 3302290 3438438 3494881 3493663 3212570 2882601 2530323 2245284 [,10] [,11] [1,] 1509867 NA [2,] 1923875 NA $out [1] 3421574 3408392 3682848 3632317 2301949 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(3097770, 3116444.5, 3185058.5, 3221816, 3221816, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/763ci1438957145.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,] 2490604 2755798 2542478 [2,] 2750619 3007482 2790032 [3,] 2853911 3116149 2854357 [4,] 2955886 3197100 2972478 [5,] 3050551 3352960 3068132 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2760288 3029663 2771142 [2,] 2947535 3202635 2937572 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2490603.7, 2750618.65, 2853911.45, 2955886.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/137581438957145.ps tmp/137581438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/2hqqj1438957145.ps tmp/2hqqj1438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/36dz31438957145.ps tmp/36dz31438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/47ig01438957145.ps tmp/47ig01438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/5kcxj1438957145.ps tmp/5kcxj1438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/60m1y1438957145.ps tmp/60m1y1438957145.png",intern=TRUE)) character(0) > try(system("convert tmp/763ci1438957145.ps tmp/763ci1438957145.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.548 0.422 2.989