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(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] 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,] 339 394 455 321 556 557 679 NA [2,] 139 209 345 206 193 279 428 NA [3,] 186 248 311 160 221 399 394 NA [4,] 155 254 346 217 278 364 352 NA [5,] 153 202 310 204 230 306 387 NA [6,] 222 258 297 246 253 471 590 NA [7,] 102 215 300 234 240 293 177 NA [8,] 107 309 274 175 252 333 199 NA [9,] 188 240 292 364 228 316 203 NA [10,] 162 258 304 328 306 329 255 NA [11,] 185 276 186 158 206 265 261 NA [12,] 24 48 14 40 48 61 115 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -200 -185 -110 -115 -363 -278 -251 NA [2,] 47 39 -34 -46 28 120 -34 NA [3,] -31 6 35 57 57 -35 -42 NA [4,] -2 -52 -36 -13 -48 -58 35 NA [5,] 69 56 -13 42 23 165 203 NA [6,] -120 -43 3 -12 -13 -178 -413 NA [7,] 5 94 -26 -59 12 40 22 NA [8,] 81 -69 18 189 -24 -17 4 NA [9,] -26 18 12 -36 78 13 52 NA [10,] 23 18 -118 -170 -100 -64 6 NA [11,] -161 -228 -172 -118 -158 -204 -146 NA [12,] 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/1hsk21382101794.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/25pw31382101794.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/36mwp1382101794.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/4qi4y1382101794.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,] 321.0 139.0 160.0 155.0 153 222.0 102.0 107.0 188.0 255.0 158.0 14.0 [2,] 366.5 199.5 203.5 235.5 203 249.5 196.0 187.0 215.5 256.5 185.5 32.0 [3,] 455.0 209.0 248.0 278.0 230 258.0 234.0 252.0 240.0 304.0 206.0 48.0 [4,] 556.5 312.0 352.5 349.0 308 384.0 266.5 291.5 304.0 317.0 263.0 54.5 [5,] 679.0 428.0 399.0 364.0 387 471.0 300.0 333.0 364.0 329.0 276.0 61.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 341.5351 141.8168 159.0196 210.2196 167.2957 177.6788 191.8985 189.5943 [2,] 568.4649 276.1832 336.9804 345.7804 292.7043 338.3212 276.1015 314.4057 [,9] [,10] [,11] [,12] [1,] 187.1492 267.8704 159.7183 34.56336 [2,] 292.8508 340.1296 252.2817 61.43664 $out [1] 590 162 115 $group [1] 6 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(321, 366.5, 455, 556.5, 679, 139, 199.5, 209, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s6h11382101794.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 -58.0 -13.0 -178.0 -59.0 -69.0 -36 -170 -228 307 [2,] -264.5 -34 -33 -50.0 32.5 -149.0 -10.5 -20.5 -7 -109 -188 370 [3,] -200.0 28 6 -36.0 56.0 -43.0 12.0 4.0 13 -64 -161 458 [4,] -150.0 43 46 -7.5 117.0 -12.5 31.0 49.5 35 12 -152 516 [5,] -110.0 120 57 35.0 203.0 3.0 40.0 81.0 78 23 -118 618 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -268.3776 -17.98316 -41.17753 -61.38031 5.537963 -124.5156 -12.78313 [2,] -131.6224 73.98316 53.17753 -10.61969 106.462037 38.5156 36.78313 [,8] [,9] [,10] [,11] [,12] [1,] -37.80287 -12.08172 -136.259248 -182.4986 363.8253 [2,] 45.80287 38.08172 8.259248 -139.5014 552.1747 $out [1] -413 94 189 $group [1] 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-363, -264.5, -200, -150, -110, -46, -34, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6aowj1382101794.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,] 102.0 202 274 40.0 193.0 265.0 115.0 NA [2,] 123.0 212 283 167.5 213.5 286.0 201.0 NA [3,] 158.5 251 302 211.5 235.0 322.5 306.5 NA [4,] 187.0 267 328 283.5 265.5 381.5 411.0 NA [5,] 222.0 309 346 364.0 306.0 471.0 679.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 129.3092 225.9141 281.4752 158.5916 211.2825 278.9418 210.7176 NA [2,] 187.6908 276.0859 322.5248 264.4084 258.7175 366.0582 402.2824 NA $out [1] 339 24 394 48 455 186 14 556 48 557 61 $group [1] 1 1 2 2 3 3 3 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(102, 123, 158.5, 187, 222, 202, 212, 251, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79qnz1382101794.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,] 219.5714 206.0 224.25 [2,] 229.2857 219.5 235.25 [3,] 259.2857 244.0 257.75 [4,] 279.1429 268.0 289.50 [5,] 333.8571 304.0 316.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 236.5455 221.8788 233.0062 [2,] 282.0259 266.1212 282.4938 $out [1] 471.5714 50.0000 455.0000 48.0000 461.5000 43.2500 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(219.571428571429, 229.285714285714, 259.285714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1hsk21382101794.ps tmp/1hsk21382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/25pw31382101794.ps tmp/25pw31382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/36mwp1382101794.ps tmp/36mwp1382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/4qi4y1382101794.ps tmp/4qi4y1382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/5s6h11382101794.ps tmp/5s6h11382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/6aowj1382101794.ps tmp/6aowj1382101794.png",intern=TRUE)) character(0) > try(system("convert tmp/79qnz1382101794.ps tmp/79qnz1382101794.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.327 0.946 5.245