R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(6848,5772,5251,11232,5908,6812,9962,6155,5673,7985,5780,11999,6973,5817,5844,11178,5533,6870,9521,5363,6031,9245,5621,11802,8364,6286,5071,10773,5821,7794,10636,6405,5811,8981,6228,11950,7523,6067,4825,12162,6989,8012,10893,6647,5938,9005,6262,12022,7683,6004,4724,10343,6604,7241,9331,6418,7094,10340,6814,12003,7481,5452,6380,11425,5905,8536,10785,6672,7293,9809,5658,12364,8078,5269,7787,11729,6236,8576,11216,6814,6019,9351,5464,12518) > 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,] 6848 6973 8364 7523 7683 7481 8078 NA [2,] 5772 5817 6286 6067 6004 5452 5269 NA [3,] 5251 5844 5071 4825 4724 6380 7787 NA [4,] 11232 11178 10773 12162 10343 11425 11729 NA [5,] 5908 5533 5821 6989 6604 5905 6236 NA [6,] 6812 6870 7794 8012 7241 8536 8576 NA [7,] 9962 9521 10636 10893 9331 10785 11216 NA [8,] 6155 5363 6405 6647 6418 6672 6814 NA [9,] 5673 6031 5811 5938 7094 7293 6019 NA [10,] 7985 9245 8981 9005 10340 9809 9351 NA [11,] 5780 5621 6228 6262 6814 5658 5464 NA [12,] 11999 11802 11950 12022 12003 12364 12518 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -1076 -1156 -2078 -1456 -1679 -2029 -2809 NA [2,] -521 27 -1215 -1242 -1280 928 2518 NA [3,] 5981 5334 5702 7337 5619 5045 3942 NA [4,] -5324 -5645 -4952 -5173 -3739 -5520 -5493 NA [5,] 904 1337 1973 1023 637 2631 2340 NA [6,] 3150 2651 2842 2881 2090 2249 2640 NA [7,] -3807 -4158 -4231 -4246 -2913 -4113 -4402 NA [8,] -482 668 -594 -709 676 621 -795 NA [9,] 2312 3214 3170 3067 3246 2516 3332 NA [10,] -2205 -3624 -2753 -2743 -3526 -4151 -3887 NA [11,] 6219 6181 5722 5760 5189 6706 7054 NA [12,] -5026 -3438 -4427 -4339 -4522 -4286 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/1xwo71350569523.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/21a571350569523.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/3cxbf1350569523.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/4ec9o1350569523.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] [1,] 6848.0 5269.0 4724 10343.0 5533 6812.0 9331.0 6155.0 5673.0 8981 5464.0 [2,] 7227.0 5612.0 4948 10975.5 5863 7055.5 9741.5 6280.0 5874.5 8993 5639.5 [3,] 7523.0 5817.0 5251 11232.0 5908 7794.0 10636.0 6418.0 6019.0 9245 5780.0 [4,] 7880.5 6035.5 6112 11577.0 6420 8274.0 10839.0 6659.5 6562.5 9580 6245.0 [5,] 8364.0 6286.0 7787 12162.0 6989 8576.0 11216.0 6814.0 7293.0 10340 6814.0 [,12] [1,] 11802.0 [2,] 11974.5 [3,] 12003.0 [4,] 12193.0 [5,] 12518.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,] 7132.74 5564.093 4555.878 10872.79 5575.369 7066.331 9980.591 6191.369 [2,] 7913.26 6069.907 5946.122 11591.21 6240.631 8521.669 11291.409 6644.631 [,9] [,10] [,11] [,12] [1,] 5608.137 8894.453 5418.405 11872.52 [2,] 6429.863 9595.547 6141.595 12133.48 $out [1] 5363 7985 $group [1] 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(6848, 7227, 7523, 7880.5, 8364, 5269, 5612, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5tywr1350569523.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] [1,] -2809.0 -1280.0 5045.0 -5645.0 637.0 2090.0 -4402.0 -795.0 2312.0 -4151.0 [2,] -2053.5 -1228.5 5189.5 -5506.5 963.5 2444.5 -4238.5 -651.5 2791.5 -3755.5 [3,] -1679.0 -521.0 5619.0 -5324.0 1337.0 2651.0 -4158.0 -482.0 3170.0 -3526.0 [4,] -1306.0 477.5 5841.5 -5062.5 2156.5 2861.5 -3960.0 644.5 3230.0 -2748.0 [5,] -1076.0 2518.0 5981.0 -4952.0 2631.0 3150.0 -3807.0 676.0 3332.0 -2205.0 [,11] [,12] [1,] 5189.0 -4522 [2,] 5741.0 -4522 [3,] 6181.0 -4383 [4,] 6462.5 -4286 [5,] 7054.0 -4286 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2125.395 -1539.7957 5229.636 -5589.15 624.5596 2401.974 -4324.316 [2,] -1232.605 497.7957 6008.364 -5058.85 2049.4404 2900.026 -3991.684 [,8] [,9] [,10] [,11] [,12] [1,] -1255.9503 2908.135 -4127.663 5750.132 -4535.228 [2,] 291.9503 3431.865 -2924.337 6611.868 -4230.772 $out [1] 7337 3942 -3739 -2913 -5026 -3438 $group [1] 3 3 4 7 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2809, -2053.5, -1679, -1306, -1076, -1280, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6963x1350569523.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,] 5251.0 5363.0 5071.0 4825.0 4724.0 5452.0 5269.0 NA [2,] 5776.0 5719.0 6024.5 6164.5 6511.0 6142.5 6127.5 NA [3,] 6483.5 6450.5 7099.5 7256.0 7167.5 7387.0 7932.5 NA [4,] 8973.5 9383.0 9808.5 9949.0 9835.5 10297.0 10283.5 NA [5,] 11999.0 11802.0 11950.0 12162.0 12003.0 12364.0 12518.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 5025.099 4779.325 5373.592 5529.864 5651.173 5492.105 6036.921 NA [2,] 7941.901 8121.675 8825.408 8982.136 8683.827 9281.895 9828.079 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(5251, 5776, 6483.5, 8973.5, 11999, 5363, 5719, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7l7hu1350569523.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,] 5697.429 5251.0 5530.000 [2,] 6058.786 5862.5 6041.875 [3,] 6958.857 6970.5 7011.750 [4,] 9790.000 9940.5 9788.375 [5,] 12094.000 12003.0 12083.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 5257.025 5110.497 5302.946 [2,] 8660.689 8830.503 8720.554 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(5697.42857142857, 6058.78571428571, 6958.85714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1xwo71350569523.ps tmp/1xwo71350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/21a571350569523.ps tmp/21a571350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/3cxbf1350569523.ps tmp/3cxbf1350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/4ec9o1350569523.ps tmp/4ec9o1350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/5tywr1350569523.ps tmp/5tywr1350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/6963x1350569523.ps tmp/6963x1350569523.png",intern=TRUE)) character(0) > try(system("convert tmp/7l7hu1350569523.ps tmp/7l7hu1350569523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.467 0.622 4.079