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(106,105,104,102,122,121,106,96,97,97,98,100,106,104,107,112,140,140,134,128,133,139,140,143,152,146,146,155,180,182,177,165,174,174,175,180,184,186,186,192,215,221,222,207,215,212,206,219,222,217,218,225,251,264,264,258,267,258,253,272,275,268,286,293,314,328,326,325,333,332,320,338,344,338,363,375,403,414,411,405,410,416,396,412,422,418,444,453,491,498,489,494,497,500,481,499,509,499,528,537,576,582,584,594,594,598,580,589,595,584,616,622,662,669,679,688,689,690,672,690) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 106 106 152 184 222 275 344 422 509 595 NA [2,] 105 104 146 186 217 268 338 418 499 584 NA [3,] 104 107 146 186 218 286 363 444 528 616 NA [4,] 102 112 155 192 225 293 375 453 537 622 NA [5,] 122 140 180 215 251 314 403 491 576 662 NA [6,] 121 140 182 221 264 328 414 498 582 669 NA [7,] 106 134 177 222 264 326 411 489 584 679 NA [8,] 96 128 165 207 258 325 405 494 594 688 NA [9,] 97 133 174 215 267 333 410 497 594 689 NA [10,] 97 139 174 212 258 332 416 500 598 690 NA [11,] 98 140 175 206 253 320 396 481 580 672 NA [12,] 100 143 180 219 272 338 412 499 589 690 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -1 -2 -6 2 -5 -7 -6 -4 -10 -11 NA [2,] -1 3 0 0 1 18 25 26 29 32 NA [3,] -2 5 9 6 7 7 12 9 9 6 NA [4,] 20 28 25 23 26 21 28 38 39 40 NA [5,] -1 0 2 6 13 14 11 7 6 7 NA [6,] -15 -6 -5 1 0 -2 -3 -9 2 10 NA [7,] -10 -6 -12 -15 -6 -1 -6 5 10 9 NA [8,] 1 5 9 8 9 8 5 3 0 1 NA [9,] 0 6 0 -3 -9 -1 6 3 4 1 NA [10,] 1 1 1 -6 -5 -12 -20 -19 -18 -18 NA [11,] 2 3 5 13 19 18 16 18 9 18 NA [12,] 6 9 4 3 3 6 10 10 6 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/1ruwt1407922427.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/2zyaw1407922427.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/3ponj1407922427.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/402id1407922427.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,] 106.0 104.0 104 102 122.0 121 106 96.0 97 97 98.0 100 [2,] 152.0 146.0 146 155 180.0 182 177 165.0 174 174 175.0 180 [3,] 248.5 242.5 252 259 282.5 296 295 291.5 300 295 286.5 305 [4,] 422.0 418.0 444 453 491.0 498 489 494.0 497 500 481.0 499 [5,] 595.0 584.0 616 622 662.0 669 679 688.0 689 690 672.0 690 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 113.5972 106.598 103.1073 110.1073 127.112 138.1138 139.1124 127.1185 [2,] 383.4028 378.402 400.8927 407.8927 437.888 453.8862 450.8876 455.8815 [,9] [,10] [,11] [,12] [1,] 138.6163 132.1174 133.6102 145.6149 [2,] 461.3837 457.8826 439.3898 464.3851 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(106, 152, 248.5, 422, 595, 104, 146, 242.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5opcx1407922427.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,] -11.0 -1.0 5 20 -1.0 -15.0 -15 0 -3.0 -20 2.0 3 [2,] -7.0 0.0 6 23 2.0 -6.0 -10 1 -1.0 -18 5.0 4 [3,] -5.5 10.5 7 27 6.5 -2.5 -6 5 0.5 -9 14.5 6 [4,] -2.0 26.0 9 38 11.0 1.0 5 8 4.0 1 18.0 9 [5,] 2.0 32.0 12 40 14.0 10.0 10 9 6.0 1 19.0 10 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.998199 -2.490637 5.50108 19.5054 2.003241 -5.9974791 -13.494598 [2,] -3.001801 23.490637 8.49892 34.4946 10.996759 0.9974791 1.494598 [,8] [,9] [,10] [,11] [,12] [1,] 1.502521 -1.998199 -18.4931575 8.004682 3.366667 [2,] 8.497479 2.998199 0.4931575 20.995318 8.633333 $out [1] -2 -9 $group [1] 3 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-11, -7, -5.5, -2, 2, -1, 0, 10.5, 26, 32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ibg61407922427.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] [1,] 96.0 104.0 146.0 184.0 217.0 268.0 338.0 418.0 499.0 584.0 NA [2,] 97.5 109.5 153.5 189.0 223.5 289.5 369.0 448.5 532.5 619.0 NA [3,] 103.0 133.5 174.0 209.5 255.5 322.5 404.0 490.0 581.0 670.5 NA [4,] 106.0 140.0 178.5 217.0 264.0 330.0 411.5 497.5 591.5 688.5 NA [5,] 106.0 143.0 182.0 222.0 272.0 338.0 416.0 500.0 598.0 690.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 99.12309 119.5887 162.5973 196.729 237.0277 304.0277 384.6155 467.6508 [2,] 106.87691 147.4113 185.4027 222.271 273.9723 340.9723 423.3845 512.3492 [,9] [,10] [,11] [1,] 554.0897 638.8006 NA [2,] 607.9103 702.1994 NA $out [1] 122 121 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(96, 97.5, 103, 106, 106, 104, 109.5, 133.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7s88t1407922427.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,] 286.50 242.5 277.000 [2,] 303.20 255.5 294.375 [3,] 335.70 289.0 326.250 [4,] 341.25 295.5 330.500 [5,] 344.20 305.0 334.375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 318.3451 270.7557 309.7731 [2,] 353.0549 307.2443 342.7269 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(286.5, 303.2, 335.7, 341.25, 344.2, 242.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ruwt1407922427.ps tmp/1ruwt1407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/2zyaw1407922427.ps tmp/2zyaw1407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/3ponj1407922427.ps tmp/3ponj1407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/402id1407922427.ps tmp/402id1407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/5opcx1407922427.ps tmp/5opcx1407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/6ibg61407922427.ps tmp/6ibg61407922427.png",intern=TRUE)) character(0) > try(system("convert tmp/7s88t1407922427.ps tmp/7s88t1407922427.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.475 0.379 2.884