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(297295,295008,296917,298982,300562,294292,272817,274405,278601,283654,290770,290604,277466,274371,277686,282917,286692,285378,262433,266730,271980,277799,282329,285775,283495,279998,287224,296369,300653,302686,277891,277537,285383,292213,298522,300431,297584,286445,288576,293299,295881,292710,271993,267430,273963,273046,268347,264319,255765,246263,245098,246969,248333,247934,226839,225554,237085,237080,245039,248541,247105,243422,250643,254663,260993,258556,235372,246057,253353,255198,264176,269034,265861,269826,278506,292300,290726,289802,271311,274352,275216,276836,280408,280190) > 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,] 297295 277466 283495 297584 255765 247105 265861 NA [2,] 295008 274371 279998 286445 246263 243422 269826 NA [3,] 296917 277686 287224 288576 245098 250643 278506 NA [4,] 298982 282917 296369 293299 246969 254663 292300 NA [5,] 300562 286692 300653 295881 248333 260993 290726 NA [6,] 294292 285378 302686 292710 247934 258556 289802 NA [7,] 272817 262433 277891 271993 226839 235372 271311 NA [8,] 274405 266730 277537 267430 225554 246057 274352 NA [9,] 278601 271980 285383 273963 237085 253353 275216 NA [10,] 283654 277799 292213 273046 237080 255198 276836 NA [11,] 290770 282329 298522 268347 245039 264176 280408 NA [12,] 290604 285775 300431 264319 248541 269034 280190 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -2287 -3095 -3497 -11139 -9502 -3683 3965 NA [2,] 1909 3315 7226 2131 -1165 7221 8680 NA [3,] 2065 5231 9145 4723 1871 4020 13794 NA [4,] 1580 3775 4284 2582 1364 6330 -1574 NA [5,] -6270 -1314 2033 -3171 -399 -2437 -924 NA [6,] -21475 -22945 -24795 -20717 -21095 -23184 -18491 NA [7,] 1588 4297 -354 -4563 -1285 10685 3041 NA [8,] 4196 5250 7846 6533 11531 7296 864 NA [9,] 5053 5819 6830 -917 -5 1845 1620 NA [10,] 7116 4530 6309 -4699 7959 8978 3572 NA [11,] -166 3446 1909 -4028 3502 4858 -218 NA [12,] -13138 -2280 -2847 -8554 -1436 -3173 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/13c4t1389521657.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/2oada1389521657.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/3njrv1389521657.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/4yu7v1389521657.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] [1,] 247105 243422.0 245098.0 246969 248333.0 247934 226839.0 246057.0 253353.0 [2,] 260813 258044.5 264164.5 268790 273842.5 271967 248902.5 256393.5 262666.5 [3,] 277466 274371.0 278506.0 292300 290726.0 289802 271311.0 267430.0 273963.0 [4,] 290395 283221.5 287900.0 294834 298221.5 293501 272405.0 274378.5 276908.5 [5,] 297584 295008.0 296917.0 298982 300653.0 302686 277891.0 277537.0 285383.0 [,10] [,11] [,12] [1,] 255198.0 245039.0 248541.0 [2,] 264122.0 266261.5 266676.5 [3,] 276836.0 280408.0 280190.0 [4,] 280726.5 286549.5 288189.5 [5,] 292213.0 298522.0 300431.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,] 259800.1 259335.7 264331.5 276746.9 276167.3 276942.2 257275.7 256689.6 [2,] 295131.9 289406.3 292680.5 307853.1 305284.7 302661.8 285346.3 278170.4 [,9] [,10] [,11] [,12] [1,] 265457.9 266920.1 268292.3 267342.8 [2,] 282468.1 286751.9 292523.7 293037.2 $out [1] 225554 237085 237080 $group [1] 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(247105, 260813, 277466, 290395, 297584, 243422, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bkhq1389521657.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] [1,] -11139.0 -1165.0 1871.0 -1574.0 -3171.0 -24795.0 -4563.0 864 -917.0 [2,] -6592.5 2020.0 3042.5 1472.0 -2804.0 -23064.5 -819.5 4723 807.5 [3,] -3497.0 3315.0 4723.0 2582.0 -1314.0 -21475.0 1588.0 6533 1845.0 [4,] -2691.0 7223.5 7188.0 4029.5 -661.5 -20906.0 3669.0 7571 5436.0 [5,] -2287.0 8680.0 9145.0 6330.0 2033.0 -18491.0 4297.0 11531 6830.0 [,10] [,11] [,12] [1,] 3572.0 -4028 -13138 [2,] 4051.0 -192 -8554 [3,] 6309.0 1909 -3010 [4,] 7537.5 3474 -2280 [5,] 8978.0 4858 -1436 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -5826.913 207.5537 2247.374 1054.702 -2593.46644 -22764.02 -1092.46 [2,] -1167.087 6422.4463 7198.626 4109.298 -34.53356 -20185.98 4268.46 [,8] [,9] [,10] [,11] [,12] [1,] 4832.22 -919.0655 4226.918 -280.2761 -7056.933 [2,] 8233.78 4609.0655 8391.082 4098.2761 1036.933 $out [1] 3965 13794 -6270 10685 -4699 $group [1] 1 3 5 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-11139, -6592.5, -3497, -2691, -2287, -1165, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6hc5h1389521657.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,] 272817.0 262433.0 277537.0 264319.0 225554.0 235372.0 265861.0 NA [2,] 281127.5 273175.5 281746.5 270170.0 237082.5 246581.0 272831.5 NA [3,] 292531.0 277742.5 289718.5 280204.0 245680.5 254008.0 277671.0 NA [4,] 297106.0 284147.5 299476.5 293004.5 248133.5 259774.5 285105.0 NA [5,] 300562.0 286692.0 302686.0 297584.0 255765.0 269034.0 292300.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 285243.1 272738.1 281631.7 269789 240640.1 247990.4 272073 NA [2,] 299818.9 282746.9 297805.3 290619 250720.9 260025.6 283269 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(272817, 281127.5, 292531, 297106, 300562, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77xvi1389521657.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,] 259808.0 267430 260653.8 [2,] 269351.0 274167 270210.2 [3,] 274944.4 277986 275818.1 [4,] 278885.2 285105 279622.5 [5,] 283405.7 292300 286032.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 270595.7 272997.1 271525.1 [2,] 279293.0 282974.9 280111.1 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(259808, 269351, 274944.357142857, 278885.214285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13c4t1389521657.ps tmp/13c4t1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/2oada1389521657.ps tmp/2oada1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/3njrv1389521657.ps tmp/3njrv1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/4yu7v1389521657.ps tmp/4yu7v1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/5bkhq1389521657.ps tmp/5bkhq1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/6hc5h1389521657.ps tmp/6hc5h1389521657.png",intern=TRUE)) character(0) > try(system("convert tmp/77xvi1389521657.ps tmp/77xvi1389521657.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.669 0.931 5.583