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(507,233,346,159,225,146,253,169,246,129,318,378,580,336,468,229,189,181,210,270,229,319,377,275,365,269,377,194,337,212,278,197,305,343,588,382,266,305,345,249,253,167,149,286,260,375,339,322,396,421,254,279,347,264,324,243,324,420,295,731,576,391,229,347,262,317,249,211,303,337,383,588,456,375,507,405,363,394,166,217,299,549,395,730) > 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,] 507 580 365 266 396 576 456 NA [2,] 233 336 269 305 421 391 375 NA [3,] 346 468 377 345 254 229 507 NA [4,] 159 229 194 249 279 347 405 NA [5,] 225 189 337 253 347 262 363 NA [6,] 146 181 212 167 264 317 394 NA [7,] 253 210 278 149 324 249 166 NA [8,] 169 270 197 286 243 211 217 NA [9,] 246 229 305 260 324 303 299 NA [10,] 129 319 343 375 420 337 549 NA [11,] 318 377 588 339 295 383 395 NA [12,] 378 275 382 322 731 588 730 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -274 -244 -96 39 25 -185 -81 NA [2,] 113 132 108 40 -167 -162 132 NA [3,] -187 -239 -183 -96 25 118 -102 NA [4,] 66 -40 143 4 68 -85 -42 NA [5,] -79 -8 -125 -86 -83 55 31 NA [6,] 107 29 66 -18 60 -68 -228 NA [7,] -84 60 -81 137 -81 -38 51 NA [8,] 77 -41 108 -26 81 92 82 NA [9,] -117 90 38 115 96 34 250 NA [10,] 189 58 245 -36 -125 46 -154 NA [11,] 60 -102 -206 -17 436 205 335 NA [12,] 202 90 -116 74 -155 -132 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/174461424884132.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/2x5no1424884132.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/3evkm1424884132.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/4gm961424884132.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,] 266.0 233 229.0 159.0 189 146.0 149.0 169.0 229 319.0 295.0 275 [2,] 380.5 287 299.5 211.5 239 174.0 188.0 204.0 253 328.0 328.5 350 [3,] 456.0 336 346.0 249.0 262 212.0 249.0 217.0 299 343.0 377.0 382 [4,] 541.5 383 422.5 313.0 342 290.5 265.5 256.5 304 397.5 389.0 659 [5,] 580.0 421 507.0 405.0 363 394.0 324.0 286.0 324 420.0 395.0 731 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 359.8534 278.6703 272.5464 188.3858 200.4901 142.4281 202.7183 185.6478 [2,] 552.1466 393.3297 419.4536 309.6142 323.5099 281.5719 295.2817 248.3522 [,9] [,10] [,11] [,12] [1,] 268.5436 301.4957 340.8704 197.4702 [2,] 329.4564 384.5043 413.1296 566.5298 $out [1] 129 549 588 $group [1] 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(266, 380.5, 456, 541.5, 580, 233, 287, 336, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5r7zd1424884132.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,] -274.0 -167.0 -239.0 -85 -125.0 -68 -84.0 -41.0 34.0 -154.0 -206.0 [2,] -214.5 -61.0 -185.0 -41 -84.5 -43 -81.0 25.5 36.0 -80.5 -59.5 [3,] -96.0 108.0 -102.0 4 -79.0 29 -38.0 81.0 90.0 46.0 60.0 [4,] -28.0 122.5 -35.5 67 11.5 63 55.5 87.0 105.5 123.5 270.0 [5,] 39.0 132.0 118.0 143 55.0 107 137.0 108.0 115.0 245.0 436.0 [,12] [1,] -155 [2,] -132 [3,] -21 [4,] 90 [5,] 202 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -207.37479 -1.58324 -191.27899 -60.49586 -136.32965 -34.30149 -119.5156 [2,] 15.37479 217.58324 -12.72101 68.49586 -21.67035 92.30149 43.5156 [,8] [,9] [,10] [,11] [,12] [1,] 44.27319 48.49572 -75.82551 -136.7721 -164.1972 [2,] 117.72681 131.50428 167.82551 256.7721 122.1972 $out [1] -228 -117 250 $group [1] 6 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-274, -214.5, -96, -28, 39, -167, -61, 108, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qob51424884132.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,] 129.0 181.0 194.0 149.0 243.0 211.0 166.0 NA [2,] 164.0 219.5 240.5 251.0 271.5 255.5 331.0 NA [3,] 239.5 272.5 321.0 276.0 324.0 327.0 394.5 NA [4,] 332.0 356.5 371.0 330.5 408.0 387.0 481.5 NA [5,] 507.0 468.0 382.0 375.0 421.0 576.0 549.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 162.8741 210.0134 261.4781 239.7395 261.7414 267.022 325.8559 NA [2,] 316.1259 334.9866 380.5219 312.2605 386.2586 386.978 463.1441 NA $out [1] 580 588 731 588 730 $group [1] 2 3 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(129, 164, 239.5, 332, 507, 181, 219.5, 272.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wego1424884132.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,] 227.5714 212.0 226.750 [2,] 253.0714 249.0 247.250 [3,] 307.5714 317.5 312.750 [4,] 372.9286 361.5 361.875 [5,] 486.5714 456.0 504.500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 252.9038 266.188 260.4688 [2,] 362.2391 368.812 365.0312 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(227.571428571429, 253.071428571429, 307.571428571429, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/174461424884132.ps tmp/174461424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/2x5no1424884132.ps tmp/2x5no1424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/3evkm1424884132.ps tmp/3evkm1424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/4gm961424884132.ps tmp/4gm961424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/5r7zd1424884132.ps tmp/5r7zd1424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/6qob51424884132.ps tmp/6qob51424884132.png",intern=TRUE)) character(0) > try(system("convert tmp/7wego1424884132.ps tmp/7wego1424884132.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.592 0.429 3.040