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 = '10' > par1 <- '10' > #'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] 13 > 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] 14 14 13 13 13 13 13 13 13 13 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 254 160 221 178 174 186 394 276 292 234 230 399 679 [2,] 200 47 227 236 309 155 209 48 304 175 253 364 428 [3,] 165 232 132 202 174 153 248 455 186 364 240 306 394 [4,] 123 143 41 184 207 222 254 345 14 328 252 471 352 [5,] 162 161 273 119 209 102 202 311 321 158 228 293 387 [6,] 145 159 182 16 171 107 258 346 206 40 306 333 590 [7,] 145 243 188 340 117 188 215 310 160 556 206 316 177 [8,] 161 192 162 151 10 162 309 297 217 193 48 329 199 [9,] 155 157 140 240 339 185 240 300 204 221 557 265 203 [10,] 173 143 186 235 139 24 258 274 246 278 279 61 255 [,14] [1,] 261 [2,] 115 [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -54 -113 6 58 135 -31 -185 -228 12 -59 23 -35 -251 [2,] -35 185 -95 -34 -135 -2 39 407 -118 189 -13 -58 -34 [3,] -42 -89 -91 -18 33 69 6 -110 -172 -36 12 165 -42 [4,] 39 18 232 -65 2 -120 -52 -34 307 -170 -24 -178 35 [5,] -17 -2 -91 -103 -38 5 56 35 -115 -118 78 40 203 [6,] 0 84 6 324 -54 81 -43 -36 -46 516 -100 -17 -413 [7,] 16 -51 -26 -189 -107 -26 94 -13 57 -363 -158 13 22 [8,] -6 -35 -22 89 329 23 -69 3 -13 28 509 -64 4 [9,] 18 -14 46 -5 -200 -161 18 -26 42 57 -278 -204 52 [10,] -13 78 -8 -61 47 370 18 18 -12 -48 120 618 6 [,14] [1,] -146 [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] 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/12thz1393875289.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/2eha01393875289.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/3ssih1393875289.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/4pxdx1393875289.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,] 160 47 132 14 102 16 117 151 140 24 [2,] 186 155 174 143 161 145 177 161 185 143 [3,] 244 218 232 222 209 182 206 192 221 235 [4,] 292 304 306 328 293 306 310 217 265 258 [5,] 399 428 455 471 387 346 340 297 339 279 $n [1] 14 14 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 199.2391 155.0814 174.1559 140.9306 151.1559 111.4477 147.7177 167.4601 [2,] 288.7609 280.9186 289.8441 303.0694 266.8441 252.5523 264.2823 216.5399 [,9] [,10] [1,] 185.9429 184.6055 [2,] 256.0571 285.3945 $out [1] 679 590 556 10 309 48 329 557 $group [1] 1 6 7 8 8 8 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" Warning message: In bxp(list(stats = c(160, 186, 244, 292, 399, 47, 155, 218, 304, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mnyd1393875289.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,] -251.0 -135 -172 -178 -118 -100 -189 -69 -278 -61 [2,] -146.0 -58 -89 -65 -91 -46 -107 -22 -161 -12 [3,] -44.5 -34 -36 -24 -2 -17 -26 3 -5 18 [4,] 12.0 39 12 35 40 81 16 28 42 78 [5,] 135.0 39 69 39 203 84 94 89 57 120 $n [1] 14 13 13 13 13 13 13 13 13 13 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -111.2191 -76.506676 -80.259529 -67.82132 -59.40592 -72.65307 -79.90022 [2,] 22.2191 8.506676 8.259529 19.82132 55.40592 38.65307 27.90022 [,8] [,9] [,10] [1,] -18.91066 -93.95727 -21.43918 [2,] 24.91066 83.95727 57.43918 $out [1] 185 407 189 165 232 307 324 516 -413 -363 329 509 370 618 $group [1] 2 2 2 3 4 4 6 6 6 7 8 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" Warning message: In bxp(list(stats = c(-251, -146, -44.5, 12, 135, -135, -58, -34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nuke1393875289.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.0 143.0 41 119 117 24.0 202 274 160.0 40.0 206 265.0 177.0 [2,] 145.0 143.0 140 151 139 107.0 215 276 186.0 175.0 228 293.0 203.0 [3,] 161.5 159.5 184 193 174 158.5 251 305 211.5 227.5 246 322.5 369.5 [4,] 173.0 192.0 221 236 209 186.0 258 345 292.0 328.0 279 364.0 428.0 [5,] 200.0 243.0 273 340 309 222.0 309 346 321.0 556.0 306 399.0 679.0 [,14] [1,] 115 [2,] 115 [3,] 188 [4,] 261 [5,] 261 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 10 2 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 147.5101 135.0176 143.5292 150.5306 139.0252 119.0285 229.5155 270.5248 [2,] 175.4899 183.9824 224.4708 235.4694 208.9748 197.9715 272.4845 339.4752 [,9] [,10] [,11] [,12] [,13] [,14] [1,] 158.5382 151.0551 220.5184 287.0256 257.081 24.88461 [2,] 264.4618 303.9449 271.4816 357.9744 481.919 351.11539 $out [1] 254 47 16 10 339 394 48 455 14 48 557 471 61 $group [1] 1 2 4 5 5 7 8 8 9 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" NA Warning message: In bxp(list(stats = c(123, 145, 161.5, 173, 200, 143, 143, 159.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vo3i1393875289.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,] 186.9231 182.0 225.0000 [2,] 219.2857 206.0 225.0000 [3,] 225.4615 219.5 226.3125 [4,] 246.6154 232.0 240.0000 [5,] 281.2857 244.0 243.5000 $n [1] 10 10 10 $conf [,1] [,2] [,3] [1,] 211.8065 206.5094 218.8179 [2,] 239.1165 232.4906 233.8071 $out [1] 189.0 200.5 $group [1] 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(186.923076923077, 219.285714285714, 225.461538461538, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12thz1393875289.ps tmp/12thz1393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/2eha01393875289.ps tmp/2eha01393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/3ssih1393875289.ps tmp/3ssih1393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/4pxdx1393875289.ps tmp/4pxdx1393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/5mnyd1393875289.ps tmp/5mnyd1393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/6nuke1393875289.ps tmp/6nuke1393875289.png",intern=TRUE)) character(0) > try(system("convert tmp/7vo3i1393875289.ps tmp/7vo3i1393875289.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.999 0.939 5.955