R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538,27561,25985,34670,32066,27186,29586,21359,21553,19573,24256,22380,16167,27297,28287,33474,28229,28785,25597,18130,20198,22849,23118,21925,20801,18785,20659,29367,23992,20645,22356,17902,15879,16963,21035,17988,10437) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 31956 31124 31566 25447 27561 27297 18785 NA [2,] 29506 26551 30111 24090 25985 28287 20659 NA [3,] 34506 30651 30019 27786 34670 33474 29367 NA [4,] 27165 25859 31934 26195 32066 28229 23992 NA [5,] 26736 25100 25826 20516 27186 28785 20645 NA [6,] 23691 25778 26835 22759 29586 25597 22356 NA [7,] 18157 20418 20205 19028 21359 18130 17902 NA [8,] 17328 18688 17789 16971 21553 20198 15879 NA [9,] 18205 20424 20520 20036 19573 22849 16963 NA [10,] 20995 24776 22518 22485 24256 23118 21035 NA [11,] 17382 19814 15572 18730 22380 21925 17988 NA [12,] 9367 12738 11509 14538 16167 20801 10437 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -2450 -4573 -1455 -1357 -1576 990 1874 NA [2,] 5000 4100 -92 3696 8685 5187 8708 NA [3,] -7341 -4792 1915 -1591 -2604 -5245 -5375 NA [4,] -429 -759 -6108 -5679 -4880 556 -3347 NA [5,] -3045 678 1009 2243 2400 -3188 1711 NA [6,] -5534 -5360 -6630 -3731 -8227 -7467 -4454 NA [7,] -829 -1730 -2416 -2057 194 2068 -2023 NA [8,] 877 1736 2731 3065 -1980 2651 1084 NA [9,] 2790 4352 1998 2449 4683 269 4072 NA [10,] -3613 -4962 -6946 -3755 -1876 -1193 -3047 NA [11,] -8015 -7076 -4063 -4192 -6213 -1124 -7551 NA [12,] 21757 18828 13938 13023 11130 -2016 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/15llv1363114844.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/20uoz1363114844.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/3ns3g1363114844.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/4p1b81363114844.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,] 25447 20659.0 27786 23992.0 20516.0 22356.0 17902.0 15879.0 16963 20995 [2,] 26372 25037.5 29693 26027.0 22872.5 23225.0 18143.5 17149.5 18889 21760 [3,] 27561 26551.0 30651 27165.0 25826.0 25597.0 19028.0 17789.0 20036 22518 [4,] 31345 28896.5 33990 30081.5 26961.0 26306.5 20311.5 19443.0 20472 23687 [5,] 31956 30111.0 34670 32066.0 28785.0 29586.0 21359.0 21553.0 20520 24776 [,11] [,12] [1,] 15572.0 9367.0 [2,] 17685.0 10973.0 [3,] 18730.0 12738.0 [4,] 20869.5 15352.5 [5,] 22380.0 20801.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24591.2 24246.47 28084.9 24743.72 23384.41 23756.78 17733.31 16419.36 [2,] 30530.8 28855.53 33217.1 29586.28 28267.59 27437.22 20322.69 19158.64 [,9] [,10] [,11] [,12] [1,] 19090.66 21367.23 16828.27 10122.63 [2,] 20981.34 23668.77 20631.73 15353.37 $out [1] 18785 22849 $group [1] 1 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(25447, 26372, 27561, 31345, 31956, 20659, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5dk6z1363114844.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] [1,] -4573.0 -92 -7341.0 -6108.0 -3188.0 -8227.0 -2416.0 877.0 269.0 -6946.0 [2,] -2013.0 3898 -5310.0 -5279.5 -1183.5 -7048.5 -2040.0 980.5 2223.5 -4358.5 [3,] -1455.0 5000 -4792.0 -3347.0 1009.0 -5534.0 -1730.0 1736.0 2790.0 -3613.0 [4,] -183.5 6936 -2097.5 -594.0 1977.0 -4907.0 -317.5 2691.0 4212.0 -2461.5 [5,] 1874.0 8708 1915.0 556.0 2400.0 -3731.0 2068.0 3065.0 4683.0 -1193.0 [,11] [,12] [1,] -8015.0 11130.0 [2,] -7313.5 11130.0 [3,] -6213.0 13480.5 [4,] -4127.5 18828.0 [5,] -1124.0 21757.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2547.5479 3185.755 -6710.453 -6145.105 -878.3996 -6812.869 -2758.6492 [2,] -362.4521 6814.245 -2873.547 -548.895 2896.3996 -4255.131 -701.3508 [,8] [,9] [,10] [,11] [,12] [1,] 714.517 1602.5 -4745.858 -8115.628 8515.041 [2,] 2757.483 3977.5 -2480.142 -4310.372 18445.959 $out [1] -1980 -2016 $group [1] 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4573, -2013, -1455, -183.5, 1874, -92, 3898, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/69dpp1363114844.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,] 9367.0 12738 11509 14538.0 16167.0 18130.0 15879.0 NA [2,] 17769.5 20116 18997 18879.0 21456.0 21363.0 17432.5 NA [3,] 22343.0 24938 24172 21500.5 25120.5 24357.5 19715.0 NA [4,] 28335.5 26205 30065 24768.5 28573.5 28258.0 21695.5 NA [5,] 34506.0 31124 31934 27786.0 34670.0 33474.0 23992.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 17523.78 22160.77 19123.81 18814.26 21874.16 21212.64 17770.62 NA [2,] 27162.22 27715.23 29220.19 24186.74 28366.84 27502.36 21659.38 NA $out [1] 29367 10437 $group [1] 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(9367, 17769.5, 22343, 28335.5, 34506, 12738, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mfc51363114844.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,] 13651.00 12738.0 13162.75 [2,] 19213.57 18879.0 19252.38 [3,] 23855.50 24057.5 23744.62 [4,] 27066.07 26858.0 27510.62 [5,] 31496.14 30651.0 31841.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20273.92 20418.22 19977.98 [2,] 27437.08 27696.78 27511.27 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(13651, 19213.5714285714, 23855.5, 27066.0714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15llv1363114844.ps tmp/15llv1363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/20uoz1363114844.ps tmp/20uoz1363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/3ns3g1363114844.ps tmp/3ns3g1363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/4p1b81363114844.ps tmp/4p1b81363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/5dk6z1363114844.ps tmp/5dk6z1363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/69dpp1363114844.ps tmp/69dpp1363114844.png",intern=TRUE)) character(0) > try(system("convert tmp/7mfc51363114844.ps tmp/7mfc51363114844.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.322 0.535 3.843