R version 3.0.1 (2013-05-16) -- "Good Sport" 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(84728,84412,84092,83430,89981,89635,84728,81466,81781,81781,82133,82764,83746,83746,83115,81466,89981,91279,89319,84728,86692,83746,85075,85710,86372,84728,85075,82764,89981,92261,90301,86692,90617,86372,90301,89981,90964,87355,91279,90964,96852,95523,90301,87670,91279,86372,89981,90617,91946,89004,90617,91599,95208,92261,88337,84092,88021,77221,82448,85390,88337,84092,84092,84092,86372,83115,78839,75261,77857,67724,73933,77541,78204,74595,74910,73933,77221,74910,70355,67062,72630,60537,68390,71968,71968,67724,63799,63484,67062,63799,57595,53319,57911,47115,56928,62150,63799,60191,55631,58893,60191,59208,49391,44835,48093,38280,48413,52022,54964,50057,45466,48093,49391,46795,36982,32706,36631,25835,37613,44835) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 84728 83746 86372 90964 91946 88337 78204 71968 63799 54964 NA [2,] 84412 83746 84728 87355 89004 84092 74595 67724 60191 50057 NA [3,] 84092 83115 85075 91279 90617 84092 74910 63799 55631 45466 NA [4,] 83430 81466 82764 90964 91599 84092 73933 63484 58893 48093 NA [5,] 89981 89981 89981 96852 95208 86372 77221 67062 60191 49391 NA [6,] 89635 91279 92261 95523 92261 83115 74910 63799 59208 46795 NA [7,] 84728 89319 90301 90301 88337 78839 70355 57595 49391 36982 NA [8,] 81466 84728 86692 87670 84092 75261 67062 53319 44835 32706 NA [9,] 81781 86692 90617 91279 88021 77857 72630 57911 48093 36631 NA [10,] 81781 83746 86372 86372 77221 67724 60537 47115 38280 25835 NA [11,] 82133 85075 90301 89981 82448 73933 68390 56928 48413 37613 NA [12,] 82764 85710 89981 90617 85390 77541 71968 62150 52022 44835 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -316 0 -1644 -3609 -2942 -4245 -3609 -4244 -3608 -4907 NA [2,] -320 -631 347 3924 1613 0 315 -3925 -4560 -4591 NA [3,] -662 -1649 -2311 -315 982 0 -977 -315 3262 2627 NA [4,] 6551 8515 7217 5888 3609 2280 3288 3578 1298 1298 NA [5,] -346 1298 2280 -1329 -2947 -3257 -2311 -3263 -983 -2596 NA [6,] -4907 -1960 -1960 -5222 -3924 -4276 -4555 -6204 -9817 -9813 NA [7,] -3262 -4591 -3609 -2631 -4245 -3578 -3293 -4276 -4556 -4276 NA [8,] 315 1964 3925 3609 3929 2596 5568 4592 3258 3925 NA [9,] 0 -2946 -4245 -4907 -10800 -10133 -12093 -10796 -9813 -10796 NA [10,] 352 1329 3929 3609 5227 6209 7853 9813 10133 11778 NA [11,] 631 635 -320 636 2942 3608 3578 5222 3609 7222 NA [12,] 982 662 983 1329 2947 663 0 1649 2942 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/17ffu1375791230.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/2tv8k1375791230.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/3fqrl1375791230.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/4llcf1375791230.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] [1,] 54964 50057 45466.0 48093 49391.0 46795 36982.0 32706.0 36631 25835.0 [2,] 71968 67724 63799.0 63484 67062.0 63799 57595.0 53319.0 57911 47115.0 [3,] 84237 83919 83603.5 82115 88176.5 86375 81783.5 78363.5 79819 72472.5 [4,] 88337 84728 85075.0 84092 89981.0 92261 89319.0 84728.0 88021 83746.0 [5,] 91946 89004 91279.0 91599 96852.0 95523 90301.0 87670.0 91279 86372.0 [,11] [,12] [1,] 37613 44835.0 [2,] 56928 62150.0 [3,] 78033 80152.5 [4,] 85075 85710.0 [5,] 90301 90617.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 76058.39 75423.12 72973.16 71818.42 76725.25 72154.25 65932.92 62670.31 [2,] 92415.61 92414.88 94233.84 92411.58 99627.75 100595.75 97634.08 94056.69 [,9] [,10] [,11] [,12] [1,] 64774.84 54170.19 63969.64 68380.98 [2,] 94863.16 90774.81 92096.36 91924.02 $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(54964, 71968, 84237, 88337, 91946, 50057, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5djwc1375791230.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,] -4907.0 -4591 -2311 1298.0 -3263 -6204 -4591 1964 -12093 352 -320 0 [2,] -4244.0 -3925 -977 2280.0 -2947 -6204 -4276 2596 -10796 3609 635 663 [3,] -3608.5 -160 -315 3593.5 -1820 -4731 -3927 3767 -9973 5718 3260 983 [4,] -1644.0 347 982 6551.0 -346 -3924 -3293 3929 -4245 9813 3609 1649 [5,] 0.0 3924 3262 8515.0 2280 -1960 -2631 5568 0 11778 7222 2947 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4907.564 -2294.462 -1293.7945 1459.538 -3119.5633 -5870.179 -4418.146 [2,] -2309.436 1974.462 663.7945 5727.462 -520.4367 -3591.821 -3435.854 [,8] [,9] [,10] [,11] [,12] [1,] 3100.98 -13246.141 2618.234 1774.071 463.7067 [2,] 4433.02 -6699.859 8817.766 4745.929 1502.2933 $out [1] -9817 -9813 315 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4907, -4244, -3608.5, -1644, 0, -4591, -3925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/621r91375791230.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] [1,] 81466 81466.0 82764.0 86372.0 77221.0 67724 67062.0 47115.0 38280.0 [2,] 81957 83746.0 85723.5 88825.5 84741.0 76401 69372.5 57261.5 48253.0 [3,] 83761 84901.5 88336.5 90790.5 88670.5 80977 73281.5 62817.0 53826.5 [4,] 84728 88005.5 90301.0 91279.0 91772.5 84092 74910.0 65430.5 59699.5 [5,] 84728 91279.0 92261.0 91279.0 95208.0 88337 78204.0 71968.0 63799.0 [,10] [,11] [1,] 25835.0 NA [2,] 36806.5 NA [3,] 45150.5 NA [4,] 48742.0 NA [5,] 54964.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82497.13 82958.71 86248.67 89671.44 85463.39 77469.08 70755.81 59091.06 [2,] 85024.87 86844.29 90424.33 91909.56 91877.61 84484.92 75807.19 66542.94 [,9] [,10] [,11] [1,] 48605.67 39706.64 NA [2,] 59047.33 50594.36 NA $out [1] 89981 89635 96852 95523 60537 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(81466, 81957, 83761, 84728, 84728, 81466, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7ypk61375791230.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,] 65498.30 72472.50 66862.62 [2,] 72336.35 79091.25 73372.81 [3,] 75052.70 81949.25 75064.31 [4,] 77734.50 84078.00 78170.75 [5,] 80224.00 88176.50 80686.38 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 72590.57 79674.76 72875.94 [2,] 77514.83 84223.74 77252.68 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(65498.3, 72336.35, 75052.7, 77734.5, 80224, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17ffu1375791230.ps tmp/17ffu1375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/2tv8k1375791230.ps tmp/2tv8k1375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/3fqrl1375791230.ps tmp/3fqrl1375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/4llcf1375791230.ps tmp/4llcf1375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/5djwc1375791230.ps tmp/5djwc1375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/621r91375791230.ps tmp/621r91375791230.png",intern=TRUE)) character(0) > try(system("convert tmp/7ypk61375791230.ps tmp/7ypk61375791230.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.381 0.834 5.197