R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(46626,46018,42408,42483,40113,41381,62348,63611,58389,46175,40555,37909,37866,34418,31736,29533,27604,30575,51345,52455,43367,37077,33016,33117,32279,30369,28983,27864,24591,29528,46549,47932,41584,37295,34666,36773,39591,39833,39280,37742,35602,40096,57284,59961,53802,47364,44964,48612,45570,45118,41921,40167,37315,39206,57075,58664,51705,45527,41057,40867,41484,39738,37254,35177,32846,34079,51287,52800,48443,42223,38796,38952,42343,42023,39340,37149,35431,36537,49626,58677,56009,50069,46470,45603,46729,46989,44666,42920,40125,40941,57748,61246,59809,52682,48394,47436,49750,48172,44960,41831,38672,39704,56207,59254,57374,51309,47083,45092) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 46626 37866 32279 39591 45570 41484 42343 46729 49750 NA [2,] 46018 34418 30369 39833 45118 39738 42023 46989 48172 NA [3,] 42408 31736 28983 39280 41921 37254 39340 44666 44960 NA [4,] 42483 29533 27864 37742 40167 35177 37149 42920 41831 NA [5,] 40113 27604 24591 35602 37315 32846 35431 40125 38672 NA [6,] 41381 30575 29528 40096 39206 34079 36537 40941 39704 NA [7,] 62348 51345 46549 57284 57075 51287 49626 57748 56207 NA [8,] 63611 52455 47932 59961 58664 52800 58677 61246 59254 NA [9,] 58389 43367 41584 53802 51705 48443 56009 59809 57374 NA [10,] 46175 37077 37295 47364 45527 42223 50069 52682 51309 NA [11,] 40555 33016 34666 44964 41057 38796 46470 48394 47083 NA [12,] 37909 33117 36773 48612 40867 38952 45603 47436 45092 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -608 -3448 -1910 242 -452 -1746 -320 260 -1578 NA [2,] -3610 -2682 -1386 -553 -3197 -2484 -2683 -2323 -3212 NA [3,] 75 -2203 -1119 -1538 -1754 -2077 -2191 -1746 -3129 NA [4,] -2370 -1929 -3273 -2140 -2852 -2331 -1718 -2795 -3159 NA [5,] 1268 2971 4937 4494 1891 1233 1106 816 1032 NA [6,] 20967 20770 17021 17188 17869 17208 13089 16807 16503 NA [7,] 1263 1110 1383 2677 1589 1513 9051 3498 3047 NA [8,] -5222 -9088 -6348 -6159 -6959 -4357 -2668 -1437 -1880 NA [9,] -12214 -6290 -4289 -6438 -6178 -6220 -5940 -7127 -6065 NA [10,] -5620 -4061 -2629 -2400 -4470 -3427 -3599 -4288 -4226 NA [11,] -2646 101 2107 3648 -190 156 -867 -958 -1991 NA [12,] -43 -838 2818 -3042 617 3391 1126 2314 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/1d3261444813669.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/2pshw1444813669.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/3636l1444813669.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/49fjp1444813669.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] [,11] [,12] [1,] 32279 30369 31736 27864 24591 29528 46549 47932 41584 37077 33016 33117 [2,] 39591 39738 37254 35177 32846 34079 51287 52800 48443 42223 38796 37909 [3,] 42343 42023 39340 37742 35602 39206 56207 58677 53802 46175 41057 40867 [4,] 46626 46018 42408 41831 38672 40096 57284 59961 57374 50069 46470 45603 [5,] 49750 48172 44960 42920 40125 41381 62348 63611 59809 52682 48394 48612 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 38637.9 38715.53 36625.56 34237.56 32533.64 36037.05 53048.58 54905.54 [2,] 46048.1 45330.47 42054.44 41246.44 38670.36 42374.95 59365.42 62448.46 [,9] [,10] [,11] [,12] [1,] 49098.34 42042.77 37015.36 36814.83 [2,] 58505.66 50307.23 45098.64 44919.17 $out [1] 28983 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(32279, 39591, 42343, 46626, 49750, 30369, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52y6z1444813669.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,] -3448 -3610 -3129 -3273 816 16503 1110 -9088 -6438 -4470 -1991 -3042.0 [2,] -1746 -3197 -2191 -2852 1106 16807 1383 -6348 -6438 -4288 -958 -440.5 [3,] -608 -2682 -1754 -2370 1268 17188 1589 -5222 -6220 -4061 -190 871.5 [4,] -320 -2323 -1538 -2140 2971 17869 3047 -2668 -6065 -3427 156 2566.0 [5,] 260 -1386 -1119 -1718 4937 17869 3498 -1437 -5940 -2400 156 3391.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1359.0267 -3142.307 -2097.913 -2744.987 285.7667 16628.68 712.6267 [2,] 143.0267 -2221.693 -1410.087 -1995.013 2250.2333 17747.32 2465.3733 [,8] [,9] [,10] [,11] [,12] [1,] -7160.133 -6416.447 -4514.46 -776.7067 -807.9741 [2,] -3283.867 -6023.553 -3607.54 396.7067 2550.9741 $out [1] -553 75 20967 20770 13089 9051 -12214 -4289 -7127 -5620 [11] -2646 2107 3648 $group [1] 2 3 6 6 6 7 9 9 9 10 11 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3448, -1746, -608, -320, 260, -3610, -3197, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60vme1444813669.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,] 37909.0 27604.0 24591.0 35602.0 37315.0 32846.0 35431.0 40125.0 38672.0 [2,] 40968.0 31155.5 29255.5 39435.5 40517.0 36215.5 38244.5 43793.0 43395.5 [3,] 44250.5 33767.5 33472.5 42530.0 43519.5 39345.0 43973.0 47212.5 47627.5 [4,] 52507.5 40616.5 39439.5 51207.0 48637.5 45333.0 49847.5 55215.0 53758.0 [5,] 63611.0 52455.0 47932.0 59961.0 58664.0 52800.0 58677.0 61246.0 59254.0 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 38987.26 29452.27 28827.51 37160.94 39815.69 35186.45 38680.79 42002.85 [2,] 49513.74 38082.73 38117.49 47899.06 47223.31 43503.55 49265.21 52422.15 [,9] [,10] [1,] 42901.09 NA [2,] 52353.91 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(37909, 40968, 44250.5, 52507.5, 63611, 27604, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qemq1444813669.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,] 34699.89 35602.0 35759.00 [2,] 38078.56 39273.0 39167.50 [3,] 41631.22 41540.0 42755.50 [4,] 48900.17 49988.5 49527.25 [5,] 57177.78 58677.0 56380.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 36695.41 36652.59 38030.35 [2,] 46567.03 46427.41 47480.65 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(34699.8888888889, 38078.5555555556, 41631.2222222222, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d3261444813669.ps tmp/1d3261444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/2pshw1444813669.ps tmp/2pshw1444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/3636l1444813669.ps tmp/3636l1444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/49fjp1444813669.ps tmp/49fjp1444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/52y6z1444813669.ps tmp/52y6z1444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/60vme1444813669.ps tmp/60vme1444813669.png",intern=TRUE)) character(0) > try(system("convert tmp/7qemq1444813669.ps tmp/7qemq1444813669.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.458 0.429 2.919