R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(254,200,165,123,162,145,145,161,155,173,160,47,232,143,161,159,243,192,157,143,221,227,132,41,273,182,188,162,140,186,178,236,202,184,119,16,340,151,240,235,174,309,174,207,209,171,117,10,339,139,186,155,153,222,102,107,188,162,185,24,394,209,248,254,202,258,215,309,240,258,276,48,455,345,311,346,310,297,300,274,292,304,186,14,321,206,160,217,204,246,234,175,364,328,158,40,556,193,221,278,230,253,240,252,228,306,206,48,557,279,399,364,306,471,293,333,316,329,265,61,679,428,394,352,387,590,177,199,203,255,261,115) > par1 = '11' > par1 <- '11' > #'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] 132 > (np <- floor(n / par1)) [1] 12 > 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] 12 12 12 12 12 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 254 47 132 184 209 107 215 297 204 278 399 428 NA [2,] 200 232 41 119 171 188 309 300 246 230 364 394 NA [3,] 165 143 273 16 117 162 240 274 234 253 306 352 NA [4,] 123 161 182 340 10 185 258 292 175 240 471 387 NA [5,] 162 159 188 151 339 24 276 304 364 252 293 590 NA [6,] 145 243 162 240 139 394 48 186 328 228 333 177 NA [7,] 145 192 140 235 186 209 455 14 158 306 316 199 NA [8,] 161 157 186 174 155 248 345 321 40 206 329 203 NA [9,] 155 143 178 309 153 254 311 206 556 48 265 255 NA [10,] 173 221 236 174 222 202 346 160 193 557 61 261 NA [11,] 160 227 202 207 102 258 310 217 221 279 679 115 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -54 185 -91 -65 -38 81 94 3 42 -48 -35 -34 NA [2,] -35 -89 232 -103 -54 -26 -69 -26 -12 23 -58 -42 NA [3,] -42 18 -91 324 -107 23 18 18 -59 -13 165 35 NA [4,] 39 -2 6 -189 329 -161 18 12 189 12 -178 203 NA [5,] -17 84 -26 89 -200 370 -228 -118 -36 -24 40 -413 NA [6,] 0 -51 -22 -5 47 -185 407 -172 -170 78 -17 22 NA [7,] 16 -35 46 -61 -31 39 -110 307 -118 -100 13 4 NA [8,] -6 -14 -8 135 -2 6 -34 -115 516 -158 -64 52 NA [9,] 18 78 58 -135 69 -52 35 -46 -363 509 -204 6 NA [10,] -13 6 -34 33 -120 56 -36 57 28 -278 618 -146 NA [11,] -113 -95 -18 2 5 -43 -13 -13 57 120 -251 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/1ixqn1393872902.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/2zrrb1393872902.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/3nd1y1393872902.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/412de1393872902.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] [1,] 47.0 41.0 16.0 10.0 24.0 48.0 14.0 40.0 48 61.0 102.0 [2,] 158.0 179.5 152.5 168.0 160.5 153.5 151.5 159.0 154 173.5 181.0 [3,] 212.0 231.0 237.0 212.5 264.0 207.0 195.5 194.5 230 211.5 219.0 [4,] 287.5 304.5 273.5 316.0 321.5 285.5 270.5 284.5 287 248.5 268.5 [5,] 428.0 394.0 352.0 471.0 364.0 394.0 316.0 345.0 311 346.0 310.0 $n [1] 12 12 12 12 12 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 152.9342 173.9867 181.8111 144.9962 190.5668 146.7939 141.2233 137.2586 [2,] 271.0658 288.0133 292.1889 280.0038 337.4332 267.2061 249.7767 251.7414 [,9] [,10] [,11] [1,] 169.3378 177.292 179.0907 [2,] 290.6622 245.708 258.9093 $out [1] 590 455 556 557 679 $group [1] 5 7 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" Warning message: In bxp(list(stats = c(47, 158, 212, 287.5, 428, 41, 179.5, 231, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/570b11393872902.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] [1,] -91.0 -103.0 -107.0 -189.0 -413 -185.0 -118.0 -158 -204.0 -146.0 -113.0 [2,] -51.0 -63.5 -50.5 -81.5 -159 -110.5 -80.5 -49 -93.5 -78.0 -69.0 [3,] -34.5 -38.5 18.0 12.0 -25 -11.0 -13.5 -7 12.0 -3.5 -13.0 [4,] 61.5 -19.0 29.0 114.0 62 34.5 27.5 29 63.5 44.5 3.5 [5,] 185.0 23.0 35.0 329.0 370 78.0 46.0 135 78.0 57.0 57.0 $n [1] 12 12 12 12 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -85.81201 -58.79675 -18.26048 -77.16886 -125.79958 -77.13547 -62.75952 [2,] 16.81201 -18.20325 54.26048 101.16886 75.79958 55.13547 35.75952 [,8] [,9] [,10] [,11] [1,] -42.57632 -59.60875 -59.37307 -47.53812 [2,] 28.57632 83.60875 52.37307 21.53812 $out [1] 232 324 165 407 307 516 -363 509 -278 618 120 -251 $group [1] 2 3 3 6 7 8 9 9 10 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" Warning message: In bxp(list(stats = c(-91, -51, -34.5, 61.5, 185, -103, -63.5, -38.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/650ll1393872902.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,] 123 47 132 119.0 102.0 107.0 215 160.0 40 206.0 265.0 115.0 NA [2,] 150 150 151 162.5 128.0 173.5 249 196.0 184 229.0 299.5 201.0 NA [3,] 161 161 182 184.0 155.0 202.0 309 274.0 221 252.0 329.0 261.0 NA [4,] 169 224 195 237.5 197.5 251.0 328 298.5 287 278.5 381.5 390.5 NA [5,] 173 243 236 340.0 222.0 258.0 346 321.0 364 306.0 471.0 590.0 NA $n [1] 11 11 11 11 11 11 11 11 11 11 11 11 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 151.9486 125.7473 161.0389 148.2709 121.891 165.0799 271.3654 225.1702 [2,] 170.0514 196.2527 202.9611 219.7291 188.109 238.9201 346.6346 322.8298 [,9] [,10] [,11] [,12] [,13] [1,] 171.932 228.4188 289.9362 170.7245 NA [2,] 270.068 275.5812 368.0638 351.2755 NA $out [1] 254 200 41 273 16 10 339 24 394 48 455 14 556 48 557 61 679 $group [1] 1 1 3 3 4 5 5 6 6 7 7 8 9 10 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(123, 150, 161, 169, 173, 47, 150, 161, 224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7j7mb1393872902.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,] 210.4167 194.50 203.7500 [2,] 215.7500 209.25 212.0625 [3,] 232.8333 212.50 215.2500 [4,] 235.7083 230.50 232.1875 [5,] 258.5000 237.00 243.0000 $n [1] 11 11 11 $conf [,1] [,2] [,3] [1,] 223.3254 202.3768 205.6627 [2,] 242.3412 222.6232 224.8373 $out [1] 264 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(210.416666666667, 215.75, 232.833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ixqn1393872902.ps tmp/1ixqn1393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/2zrrb1393872902.ps tmp/2zrrb1393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/3nd1y1393872902.ps tmp/3nd1y1393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/412de1393872902.ps tmp/412de1393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/570b11393872902.ps tmp/570b11393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/650ll1393872902.ps tmp/650ll1393872902.png",intern=TRUE)) character(0) > try(system("convert tmp/7j7mb1393872902.ps tmp/7j7mb1393872902.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.935 0.948 5.909