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 = '4' > par1 <- '4' > #'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] 21 > 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] 21 21 21 21 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 280190 274352 292300 269034 246057 254663 248541 225554 246969 264319 [2,] 280408 271311 278506 264176 235372 250643 245039 226839 245098 268347 [3,] 276836 289802 269826 255198 258556 243422 237080 247934 246263 273046 [4,] 275216 290726 265861 253353 260993 247105 237085 248333 255765 273963 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 267430 293299 300431 277537 296369 285775 266730 282917 290604 274405 [2,] 271993 288576 298522 277891 287224 282329 262433 277686 290770 272817 [3,] 292710 286445 292213 302686 279998 277799 285378 274371 283654 294292 [4,] 295881 297584 285383 300653 283495 271980 286692 277466 278601 300562 [,21] [,22] [1,] 298982 NA [2,] 296917 NA [3,] 295008 NA [4,] 297295 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 218 -3041 -13794 -4858 -10685 -4020 -3502 1285 -1871 4028 4563 -4723 [2,] -3572 18491 -8680 -8978 23184 -7221 -7959 21095 1165 4699 20717 -2131 [3,] -1620 924 -3965 -1845 2437 3683 5 399 9502 917 3171 11139 [4,] -864 1574 3173 -7296 -6330 1436 -11531 -1364 8554 -6533 -2582 2847 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] -1909 354 -9145 -3446 -4297 -5231 166 -1588 -2065 NA [2,] -6309 24795 -7226 -4530 22945 -3315 -7116 21475 -1909 NA [3,] -6830 -2033 3497 -5819 1314 3095 -5053 6270 2287 NA [4,] -7846 -4284 2280 -5250 -3775 13138 -4196 -1580 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/fisher/rcomp/tmp/14zzs1384694091.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/2x3aq1384694091.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/3azw71384694091.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/4s0sl1384694091.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] [1,] 225554 235372 237080 237085 [2,] 264319 262433 258556 260993 [3,] 274405 272817 277799 277466 [4,] 290604 282329 289802 290726 [5,] 300431 298522 302686 300653 $n [1] 21 21 21 21 $conf [,1] [,2] [,3] [,4] [1,] 265342.3 265957.2 267025.9 267214.5 [2,] 283467.7 279676.8 288572.1 287717.5 $out [1] 226839 $group [1] 2 $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5z65t1384694091.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] [1,] -10685 -8978 -6830 -11531 [2,] -4723 -7116 -1845 -5790 [3,] -3041 -2131 924 -2081 [4,] 166 20717 3171 1927 [5,] 4563 24795 9502 13138 $n [1] 21 21 21 20 $conf [,1] [,2] [,3] [,4] [1,] -4726.65 -11727.38 -805.4379 -4807.4064 [2,] -1355.35 7465.38 2653.4379 645.4064 $out [1] -13794 11139 $group [1] 1 3 $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-10685, -4723, -3041, 166, 4563, -8978, -7116, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6pku21384694091.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,] 275216 271311.0 265861.0 253353.0 235372.0 243422.0 237080.0 225554.0 [2,] 276026 272831.5 267843.5 254275.5 240714.5 245263.5 237082.5 226196.5 [3,] 278513 282077.0 274166.0 259687.0 252306.5 248874.0 241062.0 237386.5 [4,] 280299 290264.0 285403.0 266605.0 259774.5 252653.0 246790.0 248133.5 [5,] 280408 290726.0 292300.0 269034.0 260993.0 254663.0 248541.0 248333.0 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 245098.0 264319.0 267430.0 286445.0 285383.0 277537.0 279998.0 271980.0 [2,] 245680.5 266333.0 269711.5 287510.5 288798.0 277714.0 281746.5 274889.5 [3,] 246616.0 270696.5 282351.5 290937.5 295367.5 289272.0 285359.5 280064.0 [4,] 251367.0 273504.5 294295.5 295441.5 299476.5 301669.5 291796.5 284052.0 [5,] 255765.0 273963.0 295881.0 297584.0 300431.0 302686.0 296369.0 285775.0 [,17] [,18] [,19] [,20] [,21] [,22] [1,] 262433.0 274371.0 278601.0 272817.0 295008.0 NA [2,] 264581.5 275918.5 281127.5 273611.0 295962.5 NA [3,] 276054.0 277576.0 287129.0 284348.5 297106.0 NA [4,] 286035.0 280301.5 290687.0 297427.0 298138.5 NA [5,] 286692.0 282917.0 290770.0 300562.0 298982.0 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 275137.3 268305.3 260294 249946.7 237249.1 243036.3 233393.1 220056.3 [2,] 281888.7 295848.7 288038 269427.3 267363.9 254711.7 248730.9 254716.7 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,] 242123.7 265031 262930.1 284672 286931.5 270347.2 277420 272825.6 259105.7 [2,] 251108.3 276362 301772.9 297203 303803.5 308196.8 293299 287302.4 293002.3 [,18] [,19] [,20] [,21] [,22] [1,] 274113.4 279577 265533.9 295387 NA [2,] 281038.6 294681 303163.1 298825 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" NA Warning message: In bxp(list(stats = c(275216, 276026, 278513, 280299, 280408, 271311, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7zqza1384694091.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,] 270138.0 272817.0 272381.0 [2,] 271651.3 273611.0 273280.0 [3,] 273785.1 275935.5 275019.2 [4,] 274916.9 277632.5 276660.5 [5,] 275428.2 277799.0 277461.5 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 271205.3 272758.5 272348.7 [2,] 276364.9 279112.5 277689.8 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(270137.952380952, 271651.30952381, 273785.119047619, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14zzs1384694091.ps tmp/14zzs1384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/2x3aq1384694091.ps tmp/2x3aq1384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/3azw71384694091.ps tmp/3azw71384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/4s0sl1384694091.ps tmp/4s0sl1384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/5z65t1384694091.ps tmp/5z65t1384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/6pku21384694091.ps tmp/6pku21384694091.png",intern=TRUE)) character(0) > try(system("convert tmp/7zqza1384694091.ps tmp/7zqza1384694091.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.515 0.791 4.318