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(219,231,247,259,278,289,252,224,242,303,305,283,259,224,252,273,252,265,285,224,283,279,296,269,252,226,259,301,260,282,311,263,276,296,310,290,273,267,302,322,314,300,316,299,295,340,333,316,294,309,354,335,313,338,357,324,296,378,343,301,309,271,308,326,336,310,335,298,288,319,328,315) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 219 259 252 273 294 309 NA [2,] 231 224 226 267 309 271 NA [3,] 247 252 259 302 354 308 NA [4,] 259 273 301 322 335 326 NA [5,] 278 252 260 314 313 336 NA [6,] 289 265 282 300 338 310 NA [7,] 252 285 311 316 357 335 NA [8,] 224 224 263 299 324 298 NA [9,] 242 283 276 295 296 288 NA [10,] 303 279 296 340 378 319 NA [11,] 305 296 310 333 343 328 NA [12,] 283 269 290 316 301 315 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 12 -35 -26 -6 15 -38 NA [2,] 16 28 33 35 45 37 NA [3,] 12 21 42 20 -19 18 NA [4,] 19 -21 -41 -8 -22 10 NA [5,] 11 13 22 -14 25 -26 NA [6,] -37 20 29 16 19 25 NA [7,] -28 -61 -48 -17 -33 -37 NA [8,] 18 59 13 -4 -28 -10 NA [9,] 61 -4 20 45 82 31 NA [10,] 2 17 14 -7 -35 9 NA [11,] -22 -27 -20 -17 -42 -13 NA [12,] -24 -17 -17 -22 8 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/1kzbh1412953518.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/20mcq1412953518.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/39nyi1412953518.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/4tk6e1412953518.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,] 219 224 247.0 259.0 252.0 265.0 252.0 224.0 276.0 279 296 269.0 [2,] 252 226 252.0 273.0 260.0 282.0 285.0 224.0 276.0 296 305 283.0 [3,] 266 249 280.5 311.5 295.5 294.5 313.5 280.5 285.5 311 319 295.5 [4,] 294 271 308.0 326.0 314.0 310.0 335.0 299.0 295.0 340 333 315.0 [5,] 309 309 354.0 335.0 336.0 338.0 357.0 324.0 296.0 378 343 316.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 238.9086 219.9735 244.3782 277.3133 260.6683 276.4391 281.2484 232.1226 [2,] 293.0914 278.0265 316.6218 345.6867 330.3317 312.5609 345.7516 328.8774 [,9] [,10] [,11] [,12] [1,] 273.2444 282.6186 300.9391 274.859 [2,] 297.7556 339.3814 337.0609 316.141 $out [1] 242 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(219, 252, 266, 294, 309, 224, 226, 249, 271, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5c1rt1412953518.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,] -38 16 12 -41.0 -26 16.0 -61 -28.0 -4 -35.0 -42 -24 [2,] -35 28 12 -22.0 -14 16.0 -48 -10.0 20 -7.0 -27 -22 [3,] -16 34 19 -14.5 12 19.5 -35 4.5 38 5.5 -21 -17 [4,] 12 37 21 10.0 22 25.0 -28 18.0 61 14.0 -17 -17 [5,] 15 45 21 19.0 25 29.0 -17 59.0 82 17.0 -13 -17 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -46.31652 28.19471 13.19471 -35.141034 -11.22116 13.69471 -47.90065 [2,] 14.31652 39.80529 24.80529 6.141034 35.22116 25.30529 -22.09935 [,8] [,9] [,10] [,11] [,12] [1,] -13.5609 11.55368 -8.045678 -27.45032 -20.53299 [2,] 22.5609 64.44632 19.045678 -14.54968 -13.46701 $out [1] 42 -19 -37 8 $group [1] 3 3 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-38, -35, -16, 12, 15, 16, 28, 34, 37, 45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ipn51412953518.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] [1,] 219.0 224 226.0 267 294.0 271.0 NA [2,] 236.5 252 259.5 297 305.0 303.0 NA [3,] 255.5 267 279.0 308 329.5 312.5 NA [4,] 286.0 281 298.5 319 348.5 327.0 NA [5,] 305.0 296 311.0 340 378.0 336.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 232.9227 253.7729 261.2118 297.9657 309.6594 301.5534 NA [2,] 278.0773 280.2271 296.7882 318.0343 349.3406 323.4466 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(219, 236.5, 255.5, 286, 305, 224, 252, 267, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rin31412953518.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,] 254.6667 249.00 248.6250 [2,] 276.0000 280.50 275.6875 [3,] 293.9167 295.00 292.3750 [4,] 306.0000 311.25 306.6875 [5,] 319.1667 319.00 319.0000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 280.2335 280.9747 278.2357 [2,] 307.5999 309.0253 306.5143 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(254.666666666667, 276, 293.916666666667, 306, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kzbh1412953518.ps tmp/1kzbh1412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/20mcq1412953518.ps tmp/20mcq1412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/39nyi1412953518.ps tmp/39nyi1412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/4tk6e1412953518.ps tmp/4tk6e1412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/5c1rt1412953518.ps tmp/5c1rt1412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/6ipn51412953518.ps tmp/6ipn51412953518.png",intern=TRUE)) character(0) > try(system("convert tmp/7rin31412953518.ps tmp/7rin31412953518.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.539 0.412 2.970