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(280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319,268347,273046,273963,267430,271993,292710,295881,293299,288576,286445,297584,300431,298522,292213,285383,277537,277891,302686,300653,296369,287224,279998,283495,285775,282329,277799,271980,266730,262433,285378,286692,282917,277686,274371,277466,290604,290770,283654,278601,274405,272817,294292,300562,298982,296917,295008,297295) > par1 = '7' > par1 <- '7' > #'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] 12 > 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] 12 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 280190 290726 255198 250643 225554 255765 292710 298522 296369 271980 [2,] 280408 292300 253353 243422 226839 264319 295881 292213 287224 266730 [3,] 276836 278506 246057 247105 247934 268347 293299 285383 279998 262433 [4,] 275216 269826 235372 248541 248333 273046 288576 277537 283495 285378 [5,] 274352 265861 258556 245039 246969 273963 286445 277891 285775 286692 [6,] 271311 269034 260993 237080 245098 267430 297584 302686 282329 282917 [7,] 289802 264176 254663 237085 246263 271993 300431 300653 277799 277686 [,11] [,12] [,13] [1,] 274371 272817 NA [2,] 277466 294292 NA [3,] 290604 300562 NA [4,] 290770 298982 NA [5,] 283654 296917 NA [6,] 278601 295008 NA [7,] 274405 297295 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 218 1574 -1845 -7221 1285 8554 3171 -6309 -9145 -5250 3095 21475 [2,] -3572 -13794 -7296 3683 21095 4028 -2582 -6830 -7226 -4297 13138 6270 [3,] -1620 -8680 -10685 1436 399 4699 -4723 -7846 3497 22945 166 -1580 [4,] -864 -3965 23184 -3502 -1364 917 -2131 354 2280 1314 -7116 -2065 [5,] -3041 3173 2437 -7959 -1871 -6533 11139 24795 -3446 -3775 -5053 -1909 [6,] 18491 -4858 -6330 5 1165 4563 2847 -2033 -4530 -5231 -4196 2287 [7,] 924 -8978 -4020 -11531 9502 20717 -1909 -4284 -5819 -3315 -1588 NA [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] 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/fisher/rcomp/tmp/1zxxc1381957105.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/fisher/rcomp/tmp/2yr9p1381957105.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/fisher/rcomp/tmp/3t6l11381957105.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/fisher/rcomp/tmp/4ef2o1381957105.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] [1,] 225554.0 226839.0 246057.0 235372.0 245039.0 237080.0 237085.0 [2,] 255481.5 258836.0 255183.5 259183.5 262208.5 264211.5 259419.5 [3,] 273594.0 278937.0 277671.0 276376.5 276121.5 274956.0 276045.5 [4,] 291718.0 292256.5 287993.5 286977.0 286110.0 288962.5 293548.5 [5,] 298522.0 295881.0 300562.0 298982.0 296917.0 302686.0 300653.0 $n [1] 12 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 257066.3 263693.7 262706.1 263699.7 265219.9 263666.9 260479 [2,] 290121.7 294180.3 292635.9 289053.3 287023.1 286245.1 291612 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" Warning message: In bxp(list(stats = c(225554, 255481.5, 273594, 291718, 298522, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5zakt1381957105.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] [1,] -9145.0 -13794 -10685.0 -7116.0 -7959 -6330 -11531.0 [2,] -5779.5 -7028 -6284.5 -2816.5 -4414 -4694 -5051.5 [3,] 751.5 -3077 -707.0 -1114.0 -2475 -1014 -3315.0 [4,] 3133.0 5149 2466.5 1115.5 2805 2567 -332.0 [5,] 8554.0 21095 4699.0 2280.0 11139 4563 924.0 $n [1] 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3313.551 -8631.011 -4698.39 -2907.4116 -5767.6344 -4325.791 -5563.313 [2,] 4816.551 2477.011 3284.39 679.4116 817.6344 2297.791 -1066.687 $out [1] 21475 22945 23184 24795 18491 9502 20717 $group [1] 1 3 4 5 6 7 7 $names [1] "1" "2" "3" "4" "5" "6" "7" Warning message: In bxp(list(stats = c(-9145, -5779.5, 751.5, 3133, 8554, -13794, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6o1kj1381957105.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,] 271311 264176.0 246057 237080.0 225554.0 264319.0 286445.0 277537.0 [2,] 274784 267447.5 249705 240253.5 235968.5 265874.5 290643.0 281637.0 [3,] 276836 269826.0 254663 245039.0 246263.0 268347.0 293299.0 292213.0 [4,] 280299 284616.0 256877 247823.0 247451.5 272519.5 296732.5 299587.5 [5,] 280408 292300.0 260993 250643.0 248333.0 273963.0 300431.0 302686.0 [,9] [,10] [,11] [,12] [,13] [1,] 277799.0 262433.0 274371.0 294292.0 NA [2,] 281163.5 269355.0 275935.5 294650.0 NA [3,] 283495.0 277686.0 278601.0 296917.0 NA [4,] 286499.5 284147.5 287129.0 298138.5 NA [5,] 287224.0 286692.0 290770.0 300562.0 NA $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 273542.5 259573.2 250380 240518.6 239405.5 264378.7 289662.4 281493.3 [2,] 280129.5 280078.8 258946 249559.4 253120.5 272315.3 296935.6 302932.7 [,9] [,10] [,11] [,12] [,13] [1,] 280308.4 268852.2 271916.4 294833.7 NA [2,] 286681.6 286519.8 285285.6 299000.3 NA $out [1] 289802 235372 255765 296369 272817 $group [1] 1 3 6 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(271311, 274784, 276836, 280299, 280408, 264176, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/73lhc1381957105.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,] 272070.4 273594.0 272748.2 [2,] 272896.6 275500.8 274205.6 [3,] 273088.7 276121.5 275341.1 [4,] 273841.0 277023.8 276308.4 [5,] 274354.2 278937.0 276906.1 $n [1] 7 7 7 $conf [,1] [,2] [,3] [1,] 272524.7 275212 274085.4 [2,] 273652.7 277031 276596.9 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(272070.416666667, 272896.625, 273088.666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zxxc1381957105.ps tmp/1zxxc1381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/2yr9p1381957105.ps tmp/2yr9p1381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/3t6l11381957105.ps tmp/3t6l11381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/4ef2o1381957105.ps tmp/4ef2o1381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/5zakt1381957105.ps tmp/5zakt1381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/6o1kj1381957105.ps tmp/6o1kj1381957105.png",intern=TRUE)) character(0) > try(system("convert tmp/73lhc1381957105.ps tmp/73lhc1381957105.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.069 0.502 3.561