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 = '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] 132 > (np <- floor(n / par1)) [1] 11 > 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] 11 11 11 11 11 11 11 11 11 11 11 11 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 254 232 273 340 339 394 455 321 556 557 679 NA [2,] 200 143 182 151 139 209 345 206 193 279 428 NA [3,] 165 161 188 240 186 248 311 160 221 399 394 NA [4,] 123 159 162 235 155 254 346 217 278 364 352 NA [5,] 162 243 140 174 153 202 310 204 230 306 387 NA [6,] 145 192 186 309 222 258 297 246 253 471 590 NA [7,] 145 157 178 174 102 215 300 234 240 293 177 NA [8,] 161 143 236 207 107 309 274 175 252 333 199 NA [9,] 155 221 202 209 188 240 292 364 228 316 203 NA [10,] 173 227 184 171 162 258 304 328 306 329 255 NA [11,] 160 132 119 117 185 276 186 158 206 265 261 NA [12,] 47 41 16 10 24 48 14 40 48 61 115 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -54 -89 -91 -189 -200 -185 -110 -115 -363 -278 -251 NA [2,] -35 18 6 89 47 39 -34 -46 28 120 -34 NA [3,] -42 -2 -26 -5 -31 6 35 57 57 -35 -42 NA [4,] 39 84 -22 -61 -2 -52 -36 -13 -48 -58 35 NA [5,] -17 -51 46 135 69 56 -13 42 23 165 203 NA [6,] 0 -35 -8 -135 -120 -43 3 -12 -13 -178 -413 NA [7,] 16 -14 58 33 5 94 -26 -59 12 40 22 NA [8,] -6 78 -34 2 81 -69 18 189 -24 -17 4 NA [9,] 18 6 -18 -38 -26 18 12 -36 78 13 52 NA [10,] -13 -95 -65 -54 23 18 -118 -170 -100 -64 6 NA [11,] -113 -91 -103 -107 -161 -228 -172 -118 -158 -204 -146 NA [12,] 185 232 324 329 370 407 307 516 509 618 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/149k91393875082.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/2p3tn1393875082.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/3p9ls1393875082.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/4yv6a1393875082.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,] 232.0 139.0 160.0 123.0 140.0 145 102.0 107 155.0 162.0 117.0 10 [2,] 297.0 166.5 175.5 160.5 168.0 207 165.5 168 202.5 178.5 145.0 20 [3,] 340.0 200.0 221.0 235.0 204.0 253 178.0 207 221.0 255.0 185.0 41 [4,] 505.5 244.0 279.5 312.0 274.5 303 237.0 263 266.0 305.0 233.5 48 [5,] 679.0 345.0 399.0 364.0 387.0 309 300.0 333 316.0 329.0 276.0 61 $n [1] 11 11 11 11 11 11 11 11 11 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 240.6731 163.0799 171.4557 162.8272 153.2647 207.2668 143.9383 161.7431 [2,] 439.3269 236.9201 270.5443 307.1728 254.7353 298.7332 212.0617 252.2569 [,9] [,10] [,11] [,12] [1,] 190.7494 194.7369 142.8397 27.66114 [2,] 251.2506 315.2631 227.1603 54.33886 $out [1] 428 471 590 364 115 $group [1] 2 6 6 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(232, 297, 340, 505.5, 679, 139, 166.5, 200, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52v9l1393875082.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,] -363.0 -46 -42.0 -61.0 -51 -178.0 -59.0 -69.0 -38 -170.0 -228.0 185.0 [2,] -225.5 -34 -33.0 -50.0 5 -127.5 -4.5 -20.5 -22 -97.5 -166.5 307.0 [3,] -185.0 18 -5.0 -22.0 46 -35.0 16.0 2.0 12 -64.0 -146.0 349.5 [4,] -100.5 43 20.5 16.5 102 -10.0 36.5 48.0 18 -3.5 -110.0 509.0 [5,] -54.0 120 57.0 84.0 203 3.0 94.0 81.0 78 23.0 -91.0 618.0 $n [1] 11 11 11 11 11 11 11 11 11 11 11 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -244.5485 -18.68187 -30.48675 -53.679797 -0.2096287 -90.97558 -3.531905 [2,] -125.4515 54.68187 20.48675 9.679797 92.2096287 20.97558 35.531905 [,8] [,9] [,10] [,11] [,12] [1,] -30.63257 -7.055517 -108.78046 -172.9159 248.5727 [2,] 34.63257 31.055517 -19.21954 -119.0841 450.4273 $out [1] -413 189 $group [1] 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-363, -225.5, -185, -100.5, -54, -46, -34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vmu31393875082.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] [1,] 123.0 41 119 117.0 102.0 202 274 40.0 193.0 265.0 115.0 NA [2,] 145.0 143 151 161.0 123.0 212 283 167.5 213.5 286.0 201.0 NA [3,] 160.5 160 183 190.5 158.5 251 302 211.5 235.0 322.5 306.5 NA [4,] 169.0 224 195 237.5 187.0 267 328 283.5 265.5 381.5 411.0 NA [5,] 200.0 243 236 340.0 222.0 309 346 364.0 306.0 471.0 679.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 149.5534 123.0554 162.9313 155.6078 129.3092 225.9141 281.4752 158.5916 [2,] 171.4466 196.9446 203.0687 225.3922 187.6908 276.0859 322.5248 264.4084 [,9] [,10] [,11] [,12] [1,] 211.2825 278.9418 210.7176 NA [2,] 258.7175 366.0582 402.2824 NA $out [1] 254 47 273 16 10 339 24 394 48 455 186 14 556 48 557 61 $group [1] 1 1 3 3 4 5 5 6 6 7 7 7 9 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" NA Warning message: In bxp(list(stats = c(123, 145, 160.5, 169, 200, 41, 143, 160, 224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wl4s1393875082.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,] 187.7273 178.0 189.250 [2,] 209.5909 192.5 203.250 [3,] 233.1364 214.0 224.375 [4,] 244.0909 244.0 239.000 [5,] 288.0909 255.0 255.000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 217.4007 190.5105 208.0692 [2,] 248.8720 237.4895 240.6808 $out [1] 400.00000 42.18182 340.00000 41.00000 401.25000 34.00000 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(187.727272727273, 209.590909090909, 233.136363636364, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/149k91393875082.ps tmp/149k91393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/2p3tn1393875082.ps tmp/2p3tn1393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/3p9ls1393875082.ps tmp/3p9ls1393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/4yv6a1393875082.ps tmp/4yv6a1393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/52v9l1393875082.ps tmp/52v9l1393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/6vmu31393875082.ps tmp/6vmu31393875082.png",intern=TRUE)) character(0) > try(system("convert tmp/7wl4s1393875082.ps tmp/7wl4s1393875082.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.835 0.955 5.812