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(340,307,380,347,313,333,347,333,387,307,353,407,307,253,380,320,353,353,387,280,387,307,347,427,253,240,407,293,347,360,387,240,333,353,313,440,273,240,407,240,360,373,387,320,373,373,260,420,253,293,413,207,333,440,280,367,380,373,193,373,213,293,407,167,340,447,233,393,333,353,200,413,187,300,413,213,373,453,247,447,340,320,187,380,160,307,400,213,380,453,260,467,380,300,180,427,153,327,393,207,380,440,247,400,360,340,220,393) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 340 307 253 273 253 213 187 160 153 NA [2,] 307 253 240 240 293 293 300 307 327 NA [3,] 380 380 407 407 413 407 413 400 393 NA [4,] 347 320 293 240 207 167 213 213 207 NA [5,] 313 353 347 360 333 340 373 380 380 NA [6,] 333 353 360 373 440 447 453 453 440 NA [7,] 347 387 387 387 280 233 247 260 247 NA [8,] 333 280 240 320 367 393 447 467 400 NA [9,] 387 387 333 373 380 333 340 380 360 NA [10,] 307 307 353 373 373 353 320 300 340 NA [11,] 353 347 313 260 193 200 187 180 220 NA [12,] 407 427 440 420 373 413 380 427 393 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -33 -54 -13 -33 40 80 113 147 174 NA [2,] 73 127 167 167 120 114 113 93 66 NA [3,] -33 -60 -114 -167 -206 -240 -200 -187 -186 NA [4,] -34 33 54 120 126 173 160 167 173 NA [5,] 20 0 13 13 107 107 80 73 60 NA [6,] 14 34 27 14 -160 -214 -206 -193 -193 NA [7,] -14 -107 -147 -67 87 160 200 207 153 NA [8,] 54 107 93 53 13 -60 -107 -87 -40 NA [9,] -80 -80 20 0 -7 20 -20 -80 -20 NA [10,] 46 40 -40 -113 -180 -153 -133 -120 -120 NA [11,] 54 80 127 160 180 213 193 247 173 NA [12,] -100 -174 -167 -167 -160 -226 -220 -274 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/19n051407244985.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/2b1lx1407244985.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/365iy1407244985.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/49ovz1407244985.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,] 153 240 380 167 313 333 233 240 333 300 180 373 [2,] 187 253 393 207 340 360 247 320 340 307 193 393 [3,] 253 293 407 213 353 440 280 367 373 340 220 413 [4,] 273 307 407 293 373 447 387 400 380 353 313 427 [5,] 340 327 413 347 380 453 387 467 387 373 353 440 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 207.7067 264.56 399.6267 167.7067 335.62 394.18 206.2667 324.8667 351.9333 [2,] 298.2933 321.44 414.3733 258.2933 370.38 485.82 353.7333 409.1333 394.0667 [,10] [,11] [,12] [1,] 315.7733 156.8 395.0933 [2,] 364.2267 283.2 430.9067 $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(153, 187, 253, 273, 340, 240, 253, 293, 307, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vr3r1407244985.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,] -54 66 -240 -34 0 -214 -147 -107 -80 -180 54 -274.0 [2,] -33 93 -200 54 13 -193 -67 -60 -80 -133 127 -223.0 [3,] 40 114 -186 126 60 -160 87 13 -20 -120 173 -170.5 [4,] 113 127 -114 167 80 14 160 54 0 -40 193 -163.5 [5,] 174 167 -33 173 107 34 207 107 20 46 247 -100.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -36.89333 96.09333 -231.2933 66.48667 24.71333 -269.02 -32.55333 -47.04 [2,] 116.89333 131.90667 -140.7067 185.51333 95.28667 -50.98 206.55333 73.04 [,9] [,10] [,11] [,12] [1,] -62.13333 -168.98 138.24 -203.7376 [2,] 22.13333 -71.02 207.76 -137.2624 $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(-54, -33, 40, 113, 174, 66, 93, 114, 127, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nmdb1407244985.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] [1,] 307.0 253.0 240.0 240.0 193.0 167.0 187.0 160.0 153.0 NA [2,] 323.0 307.0 273.0 266.5 266.5 223.0 230.0 236.5 233.5 NA [3,] 343.5 350.0 340.0 366.5 350.0 336.5 330.0 343.5 350.0 NA [4,] 366.5 383.5 373.5 380.0 376.5 400.0 396.5 413.5 393.0 NA [5,] 407.0 427.0 440.0 420.0 440.0 447.0 453.0 467.0 440.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 323.6594 315.1078 294.1613 314.7319 299.8283 255.7691 254.0582 262.7691 [2,] 363.3406 384.8922 385.8387 418.2681 400.1717 417.2309 405.9418 424.2309 [,9] [,10] [1,] 277.251 NA [2,] 422.749 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(307, 323, 343.5, 366.5, 407, 253, 307, 350, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tl0s1407244985.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,] 237.6667 213.0 230.00 [2,] 267.3889 266.5 266.50 [3,] 344.7222 346.5 343.25 [4,] 381.8333 390.0 380.00 [5,] 408.8889 440.0 410.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 292.5233 290.1708 291.4819 [2,] 396.9211 402.8292 395.0181 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(237.666666666667, 267.388888888889, 344.722222222222, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19n051407244985.ps tmp/19n051407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/2b1lx1407244985.ps tmp/2b1lx1407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/365iy1407244985.ps tmp/365iy1407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/49ovz1407244985.ps tmp/49ovz1407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/5vr3r1407244985.ps tmp/5vr3r1407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/6nmdb1407244985.ps tmp/6nmdb1407244985.png",intern=TRUE)) character(0) > try(system("convert tmp/7tl0s1407244985.ps tmp/7tl0s1407244985.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.472 0.502 2.993