R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 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(56,56,54,89,40,25,92,18,63,44,33,84,88,55,60,66,154,53,119,41,61,58,75,33,40,92,100,112,73,40,45,60,62,75,31,77,34,46,99,17,66,30,76,146,67,56,107,58,34,61,119,42,66,89,44,66,24,259,17,64,41,68,168,43,132,105,71,112,94,82,70,57,53,103,121,62,52,52,32,62,45,46,63,75,88,46,53,37,90,63,78,25,45,46,41,144,82,91,71,63,53,62,63,32,39,62,117,34,92,93,54,144,14,61,109,38,73,75,50,61,55,77,75,72,50,32,53,42,71,10,35,65,25,66,41,86,16,42,19,19,45,65,35,95,49,37,64,38,34,32,65,52,62,65,83,95,29,18,33,247,139,29,118,110,67,42,65,94,64,81,95,67,63,83,45,30,70,32,83,31,67,66,10,70,103,5,20,5,36,34,48,40,43,31,42,46,33,18,55,35,59,19,66,60,36,25,47,54,53,40,40,39,14,45,36,28,44,30,22,17,31,55,54,21,14,81,35,43,46,30,23,38,54,20,53,45,39,20,24,31,35,151,52,30,31,29,57,40,44,25,77,35,11,63,44,19,13,42,38,29,20,27,20,19,37,26,42,49,30,49,67,28,19,49,27,30,22,12,31,20,20,39,29,16,27,21,19,35,14) > 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] 289 > (np <- floor(n / par1)) [1] 24 > 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] 25 24 24 24 24 24 24 24 24 24 24 24 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 56 88 40 34 34 41 53 88 82 92 55 25 49 [2,] 56 55 92 46 61 68 103 46 91 93 77 66 37 [3,] 54 60 100 99 119 168 121 53 71 54 75 41 64 [4,] 89 66 112 17 42 43 62 37 63 144 72 86 38 [5,] 40 154 73 66 66 132 52 90 53 14 50 16 34 [6,] 25 53 40 30 89 105 52 63 62 61 32 42 32 [7,] 92 119 45 76 44 71 32 78 63 109 53 19 65 [8,] 18 41 60 146 66 112 62 25 32 38 42 19 52 [9,] 63 61 62 67 24 94 45 45 39 73 71 45 62 [10,] 44 58 75 56 259 82 46 46 62 75 10 65 65 [11,] 33 75 31 107 17 70 63 41 117 50 35 35 83 [12,] 84 33 77 58 64 57 75 144 34 61 65 95 95 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 29 64 67 43 36 44 46 35 11 37 22 14 [2,] 18 81 66 31 25 30 30 151 63 26 12 NA [3,] 33 95 10 42 47 22 23 52 44 42 31 NA [4,] 247 67 70 46 54 17 38 30 19 49 20 NA [5,] 139 63 103 33 53 31 54 31 13 30 20 NA [6,] 29 83 5 18 40 55 20 29 42 49 39 NA [7,] 118 45 20 55 40 54 53 57 38 67 29 NA [8,] 110 30 5 35 39 21 45 40 29 28 16 NA [9,] 67 70 36 59 14 14 39 44 20 19 27 NA [10,] 42 32 34 19 45 81 20 25 27 49 21 NA [11,] 65 83 48 66 36 35 24 77 20 27 19 NA [12,] 94 31 40 60 28 43 31 35 19 30 35 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0 -33 52 12 27 27 50 -42 9 1 22 41 -12 [2,] -2 5 8 53 58 100 18 7 -20 -39 -2 -25 27 [3,] 35 6 12 -82 -77 -125 -59 -16 -8 90 -3 45 -26 [4,] -49 88 -39 49 24 89 -10 53 -10 -130 -22 -70 -4 [5,] -15 -101 -33 -36 23 -27 0 -27 9 47 -18 26 -2 [6,] 67 66 5 46 -45 -34 -20 15 1 48 21 -23 33 [7,] -74 -78 15 70 22 41 30 -53 -31 -71 -11 0 -13 [8,] 45 20 2 -79 -42 -18 -17 20 7 35 29 26 10 [9,] -19 -3 13 -11 235 -12 1 1 23 2 -61 20 3 [10,] -11 17 -44 51 -242 -12 17 -5 55 -25 25 -30 18 [11,] 51 -42 46 -49 47 -13 12 103 -83 11 30 60 12 [12,] 4 7 -43 -24 -23 -4 13 -62 58 -6 -40 -46 -66 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] -11 17 -1 -12 -11 -14 -16 116 52 -11 -10 NA [2,] 15 14 -56 11 22 -8 -7 -99 -19 16 19 NA [3,] 214 -28 60 4 7 -5 15 -22 -25 7 -11 NA [4,] -108 -4 33 -13 -1 14 16 1 -6 -19 0 NA [5,] -110 20 -98 -15 -13 24 -34 -2 29 19 19 NA [6,] 89 -38 15 37 0 -1 33 28 -4 18 -10 NA [7,] -8 -15 -15 -20 -1 -33 -8 -17 -9 -39 -13 NA [8,] -43 40 31 24 -25 -7 -6 4 -9 -9 11 NA [9,] -25 -38 -2 -40 31 67 -19 -19 7 30 -6 NA [10,] 23 51 14 47 -9 -46 4 52 -7 -22 -2 NA [11,] 29 -52 -8 -6 -8 8 7 -42 -1 3 16 NA [12,] -30 36 3 -24 16 3 4 -24 18 -8 -21 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/fisher/rcomp/tmp/19c6p1355852355.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/fisher/rcomp/tmp/2nxla1355852355.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/fisher/rcomp/tmp/3eefh1355852355.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/fisher/rcomp/tmp/4uo8h1355852355.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,] 11 12.0 10.0 17.0 13.0 5.0 19.0 5.0 14.0 10.0 17.0 19.0 [2,] 34 30.5 41.5 37.5 31.0 29.5 42.0 26.5 31.5 29.5 32.0 33.5 [3,] 43 58.5 53.5 51.5 52.5 41.0 54.5 38.5 45.0 46.0 44.5 57.5 [4,] 56 79.0 85.0 71.0 69.5 58.0 73.5 56.0 65.0 65.0 72.5 76.0 [5,] 88 151.0 121.0 112.0 103.0 89.0 119.0 66.0 94.0 82.0 117.0 95.0 $n [1] 25 24 24 24 24 24 24 24 24 24 24 24 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 36.048 42.85797 39.47055 40.69571 40.08313 31.80829 44.34074 28.98577 [2,] 49.952 74.14203 67.52945 62.30429 64.91687 50.19171 64.65926 48.01423 [,9] [,10] [,11] [,12] [1,] 34.19571 34.55068 31.4381 43.79306 [2,] 55.80429 57.44932 57.5619 71.20694 $out [1] 92 168 144 247 154 132 139 105 146 112 110 259 144 $group [1] 1 3 4 4 5 5 5 6 8 8 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(11, 34, 43, 56, 88, 12, 30.5, 58.5, 79, 151, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5lllx1355852355.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,] -42.0 -56.0 -82.0 -70.0 -101.0 -45 -78.0 -43.0 -61.0 -46 -52.0 -66.0 [2,] -11.5 -13.5 -25.5 -20.5 -30.0 -7 -32.0 -13.0 -19.0 -17 -10.5 -27.0 [3,] 0.5 7.5 -4.0 -4.0 -7.5 15 -13.0 5.5 -0.5 1 7.5 -7.0 [4,] 27.0 18.5 13.5 20.0 19.5 35 -0.5 25.0 16.5 24 29.5 5.5 [5,] 52.0 58.0 60.0 53.0 47.0 89 41.0 45.0 67.0 55 60.0 36.0 $n [1] 24 24 24 24 24 24 24 24 24 24 24 24 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -11.91687 -2.820517 -16.57813 -17.061904 -23.464549 1.454322 -23.159259 [2,] 12.91687 17.820517 8.57813 9.061904 8.464549 28.545678 -2.840741 [,8] [,9] [,10] [,11] [,12] [1,] -6.755614 -11.94932 -12.22316 -5.400646 -17.481775 [2,] 17.755614 10.94932 14.22316 20.400646 3.481775 $out [1] 116 100 -99 -125 90 214 88 89 -130 -108 -110 70 -79 235 -242 [16] 103 -83 58 $group [1] 1 2 2 3 3 3 4 4 4 4 5 7 8 9 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-42, -11.5, 0.5, 27, 52, -56, -13.5, 7.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/67tec1355852355.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] [,10] [,11] [,12] [,13] [1,] 18.0 33.0 31.0 17.0 17.0 41.0 32.0 25.0 32.0 14.0 10.0 16.0 32.0 [2,] 36.5 54.0 42.5 40.0 38.0 62.5 49.0 43.0 46.0 52.0 38.5 22.0 37.5 [3,] 55.0 60.5 67.5 62.0 62.5 76.5 57.5 49.5 62.5 67.0 54.0 41.5 57.0 [4,] 73.5 81.5 84.5 87.5 77.5 108.5 69.0 83.0 76.5 92.5 71.5 65.5 65.0 [5,] 92.0 119.0 112.0 146.0 119.0 168.0 75.0 90.0 117.0 144.0 77.0 95.0 95.0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 18 30.0 5.0 18.0 14.0 14.0 20.0 25.0 11.0 19.0 12.0 14 [2,] 31 38.5 15.0 32.0 32.0 21.5 23.5 30.5 19.0 27.5 19.5 14 [3,] 66 65.5 38.0 42.5 39.5 33.0 34.5 37.5 23.5 33.5 21.5 14 [4,] 114 82.0 66.5 57.0 46.0 49.0 45.5 54.5 40.0 49.0 30.0 14 [5,] 139 95.0 103.0 66.0 54.0 81.0 54.0 77.0 63.0 67.0 39.0 14 $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 38.12405 47.95707 48.34352 40.33493 44.48378 55.51909 48.37787 31.25573 [2,] 71.87595 73.04293 86.65648 83.66507 80.51622 97.48091 66.62213 67.74427 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 48.58875 48.52768 38.94848 21.65936 44.45707 28.14314 45.65936 14.5105 [2,] 76.41125 85.47232 69.05152 61.34064 69.54293 103.85686 85.34064 61.4895 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 31.09733 33.11451 20.45707 24.46565 26.55344 13.92176 23.69371 16.71088 [2,] 53.90267 45.88549 45.54293 44.53435 48.44656 33.07824 43.30629 26.28912 [,25] [1,] 14 [2,] 14 $out [1] 154 259 103 121 144 247 151 $group [1] 2 5 7 7 8 14 21 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" NA Warning message: In bxp(list(stats = c(18, 36.5, 55, 73.5, 92, 33, 54, 60.5, 81.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7zcy31355852355.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,] 45.62500 38.50 40.6250 [2,] 47.86667 43.75 46.4375 [3,] 56.79167 48.75 50.6250 [4,] 59.70833 54.00 54.5000 [5,] 63.66667 58.50 60.8750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 51.39060 44.07491 46.94764 [2,] 62.19273 53.42509 54.30236 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(45.625, 47.8666666666667, 56.7916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19c6p1355852355.ps tmp/19c6p1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/2nxla1355852355.ps tmp/2nxla1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/3eefh1355852355.ps tmp/3eefh1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/4uo8h1355852355.ps tmp/4uo8h1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/5lllx1355852355.ps tmp/5lllx1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/67tec1355852355.ps tmp/67tec1355852355.png",intern=TRUE)) character(0) > try(system("convert tmp/7zcy31355852355.ps tmp/7zcy31355852355.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.579 1.056 4.628