R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(1095,1085,1075,1054,1261,1250,1095,992,1002,1002,1013,1033,1095,1075,1106,1157,1447,1447,1385,1323,1374,1436,1447,1478,1571,1509,1509,1602,1860,1881,1829,1705,1798,1798,1808,1860,1901,1922,1922,1984,2222,2284,2294,2139,2222,2191,2129,2263,2294,2242,2253,2325,2594,2728,2728,2666,2759,2666,2614,2811,2842,2769,2955,3028,3245,3389,3369,3358,3441,3431,3307,3493,3555,3493,3751,3875,4164,4278,4247,4185,4237,4299,4092,4257,4361,4319,4588,4681,5074,5146,5053,5105,5136,5167,4970,5156,5259,5156,5456,5549,5952,6014,6034,6138,6138,6179,5993,6086,6148,6034,6365,6427,6840,6913,7016,7109,7119,7130,6944,7130) > 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,] 1095 1095 1571 1901 2294 2842 3555 4361 5259 6148 NA [2,] 1085 1075 1509 1922 2242 2769 3493 4319 5156 6034 NA [3,] 1075 1106 1509 1922 2253 2955 3751 4588 5456 6365 NA [4,] 1054 1157 1602 1984 2325 3028 3875 4681 5549 6427 NA [5,] 1261 1447 1860 2222 2594 3245 4164 5074 5952 6840 NA [6,] 1250 1447 1881 2284 2728 3389 4278 5146 6014 6913 NA [7,] 1095 1385 1829 2294 2728 3369 4247 5053 6034 7016 NA [8,] 992 1323 1705 2139 2666 3358 4185 5105 6138 7109 NA [9,] 1002 1374 1798 2222 2759 3441 4237 5136 6138 7119 NA [10,] 1002 1436 1798 2191 2666 3431 4299 5167 6179 7130 NA [11,] 1013 1447 1808 2129 2614 3307 4092 4970 5993 6944 NA [12,] 1033 1478 1860 2263 2811 3493 4257 5156 6086 7130 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -10 -20 -62 21 -52 -73 -62 -42 -103 -114 NA [2,] -10 31 0 0 11 186 258 269 300 331 NA [3,] -21 51 93 62 72 73 124 93 93 62 NA [4,] 207 290 258 238 269 217 289 393 403 413 NA [5,] -11 0 21 62 134 144 114 72 62 73 NA [6,] -155 -62 -52 10 0 -20 -31 -93 20 103 NA [7,] -103 -62 -124 -155 -62 -11 -62 52 104 93 NA [8,] 10 51 93 83 93 83 52 31 0 10 NA [9,] 0 62 0 -31 -93 -10 62 31 41 11 NA [10,] 11 11 10 -62 -52 -124 -207 -197 -186 -186 NA [11,] 20 31 52 134 197 186 165 186 93 186 NA [12,] 62 93 41 31 31 62 104 103 62 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/1i1cx1408296463.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/2rme01408296463.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/3fr821408296463.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/4mp9y1408296463.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] [,12] [1,] 1095 1075.0 1075 1054.0 1261.0 1250.0 1095.0 992 1002 1002.0 1013.0 1033 [2,] 1571 1509.0 1509 1602.0 1860.0 1881.0 1829.0 1705 1798 1798.0 1808.0 1860 [3,] 2568 2505.5 2604 2676.5 2919.5 3058.5 3048.5 3012 3100 3048.5 2960.5 3152 [4,] 4361 4319.0 4588 4681.0 5074.0 5146.0 5053.0 5105 5136 5167.0 4970.0 5156 [5,] 6148 6034.0 6365 6427.0 6840.0 6913.0 7016.0 7109 7119 7130.0 6944.0 7130 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1174.005 1101.512 1065.609 1138.109 1313.657 1427.176 1437.661 1313.224 [2,] 3961.995 3909.488 4142.391 4214.891 4525.343 4689.824 4659.339 4710.776 [,9] [,10] [,11] [,12] [1,] 1432.202 1365.213 1380.639 1505.187 [2,] 4767.798 4731.787 4540.361 4798.813 $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(1095, 1571, 2568, 4361, 6148, 1075, 1509, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nxhi1408296463.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,] -114 -10.0 51.0 207 -11 -155.0 -155 0.0 -31.0 -207 20.0 31 [2,] -73 0.0 62.0 238 21 -62.0 -103 10.0 -10.0 -186 52.0 41 [3,] -57 108.5 72.5 279 67 -25.5 -62 51.5 5.5 -93 149.5 62 [4,] -20 269.0 93.0 393 114 10.0 52 83.0 41.0 10 186.0 93 [5,] 21 331.0 124.0 413 144 103.0 104 93.0 62.0 11 197.0 104 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -83.48091 -25.90313 57.01116 201.5558 20.53349 -61.47407 -139.44418 [2,] -30.51909 242.90313 87.98884 356.4442 113.46651 10.47407 15.44418 [,8] [,9] [,10] [,11] [,12] [1,] 15.02629 -19.98163 -190.929415 82.54826 34.61333 [2,] 87.97371 30.98163 4.929415 216.45174 89.38667 $out [1] -21 -93 $group [1] 3 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-114, -73, -57, -20, 21, -10, 0, 108.5, 269, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fpb01408296463.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] [,10] [1,] 992.0 1075.0 1509.0 1901.0 2242.0 2769.0 3493.0 4319.0 5156.0 6034.0 [2,] 1007.5 1131.5 1586.5 1953.0 2309.5 2991.5 3813.0 4634.5 5502.5 6396.0 [3,] 1064.5 1379.5 1798.0 2165.0 2640.0 3332.5 4174.5 5063.5 6003.5 6928.5 [4,] 1095.0 1447.0 1844.5 2242.5 2728.0 3410.0 4252.0 5141.0 6112.0 7114.0 [5,] 1095.0 1478.0 1881.0 2294.0 2811.0 3493.0 4299.0 5167.0 6179.0 7130.0 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1024.591 1235.598 1680.324 2032.957 2449.119 3141.619 3974.269 4832.482 [2,] 1104.409 1523.402 1915.676 2297.043 2830.881 3523.381 4374.731 5294.518 [,9] [,10] [,11] [1,] 5725.503 6601.015 NA [2,] 6281.497 7255.985 NA $out [1] 1261 1250 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(992, 1007.5, 1064.5, 1095, 1095, 1075, 1131.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qcrs1408296463.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,] 2960.40 2505.50 2862.375 [2,] 3133.10 2640.25 3042.000 [3,] 3468.95 2986.25 3371.312 [4,] 3526.25 3053.50 3415.375 [5,] 3556.70 3152.00 3455.375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3289.632 2797.764 3201.014 [2,] 3648.268 3174.736 3541.611 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2960.4, 3133.1, 3468.95, 3526.25, 3556.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i1cx1408296463.ps tmp/1i1cx1408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/2rme01408296463.ps tmp/2rme01408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/3fr821408296463.ps tmp/3fr821408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/4mp9y1408296463.ps tmp/4mp9y1408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/5nxhi1408296463.ps tmp/5nxhi1408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/6fpb01408296463.ps tmp/6fpb01408296463.png",intern=TRUE)) character(0) > try(system("convert tmp/7qcrs1408296463.ps tmp/7qcrs1408296463.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.482 0.375 2.893