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(39690,43129,37863,35953,29133,24693,22205,21725,27192,21790,13253,37702,30364,32609,30212,29965,28352,25814,22414,20506,28806,22228,13971,36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698) > 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] 71 > (np <- floor(n / par1)) [1] 5 > 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] 6 6 6 6 6 6 6 6 6 6 6 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 39690 30364 35338 27071 29383 25591 [2,] 43129 32609 35022 29462 36438 29096 [3,] 37863 30212 34777 26105 32034 26482 [4,] 35953 29965 26887 22397 22679 22405 [5,] 29133 28352 23970 23843 24319 27044 [6,] 24693 25814 22780 21705 18004 17970 [7,] 22205 22414 17351 18089 17537 18730 [8,] 21725 20506 21382 20764 20366 19684 [9,] 27192 28806 24561 25316 22782 19785 [10,] 21790 22228 17409 17704 19169 18479 [11,] 13253 13971 11514 15548 13807 10698 [12,] 37702 36845 31514 28029 29743 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 3439 2245 -316 2391 7055 3505 [2,] -5266 -2397 -245 -3357 -4404 -2614 [3,] -1910 -247 -7890 -3708 -9355 -4077 [4,] -6820 -1613 -2917 1446 1640 4639 [5,] -4440 -2538 -1190 -2138 -6315 -9074 [6,] -2488 -3400 -5429 -3616 -467 760 [7,] -480 -1908 4031 2675 2829 954 [8,] 5467 8300 3179 4552 2416 101 [9,] -5402 -6578 -7152 -7612 -3613 -1306 [10,] -8537 -8257 -5895 -2156 -5362 -7781 [11,] 24449 22874 20000 12481 15936 NA [12,] -7338 -1507 -4443 1354 -4152 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/1h4ef1350387998.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/2pfib1350387998.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/3fqez1350387998.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/4f2ou1350387998.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,] 25591.0 29096.0 26105 22397 23843.0 17970.0 17351.0 19684 19785.0 17409 [2,] 27071.0 29462.0 26482 22405 23970.0 18004.0 17537.0 20366 22782.0 17704 [3,] 29873.5 33815.5 31123 24783 25681.5 22242.5 18409.5 20635 24938.5 18824 [4,] 35338.0 36438.0 34777 29965 28352.0 24693.0 22205.0 21382 27192.0 21790 [5,] 39690.0 43129.0 37863 35953 29133.0 25814.0 22414.0 21725 28806.0 22228 [,11] [,12] [1,] 10698 28029 [2,] 11514 29743 [3,] 13530 31514 [4,] 13971 36845 [5,] 15548 37702 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24541.02 29315.75 25772.46 19906.56 22854.97 17927.88 15398.49 19979.65 [2,] 35205.98 38315.25 36473.54 29659.44 28508.03 26557.12 21420.51 21290.35 [,9] [,10] [,11] [,12] [1,] 22093.91 16188.4 11945.16 26495.74 [2,] 27783.09 21459.6 15114.84 36532.26 $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(25591, 27071, 29873.5, 35338, 39690, 29096, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5mcpf1350387998.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] [1,] 2245 -5266.0 -9355.0 -6820.0 -9074 -5429 -1908.0 101.0 -7612 -8537 12481 [2,] 2245 -4404.0 -7890.0 -2917.0 -6315 -3616 -480.0 2416.0 -7152 -8257 15936 [3,] 2915 -2985.5 -3892.5 -83.5 -3489 -2944 1814.5 3865.5 -5990 -6838 20000 [4,] 3505 -2397.0 -1910.0 1640.0 -2138 -467 2829.0 5467.0 -3613 -5362 22874 [5,] 3505 -245.0 -247.0 4639.0 -1190 760 4031.0 8300.0 -1306 -2156 24449 [,12] [1,] -7338 [2,] -4443 [3,] -4152 [4,] -1507 [5,] 1354 $n [1] 6 6 6 6 6 6 6 6 6 6 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2102.259 -4280.08 -7749.79315 -3022.912 -6183.2999 -4975.2067 -319.9119 [2,] 3727.741 -1690.92 -35.20685 2855.912 -794.7001 -912.7933 3948.9119 [,8] [,9] [,10] [,11] [,12] [1,] 1897.506 -8272.769 -8705.369 15097.63 -6226.57 [2,] 5833.494 -3707.231 -4970.631 24902.37 -2077.43 $out [1] -316 7055 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(2245, 2245, 2915, 3505, 3505, -5266, -4404, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uw9r1350387998.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] [1,] 13253.0 13971 11514.0 15548.0 13807.0 10698.0 [2,] 21997.5 22321 19395.5 19426.5 18586.5 18604.5 [3,] 28162.5 28579 24265.5 23120.0 22730.5 19785.0 [4,] 37782.5 30288 33145.5 26588.0 29563.0 26036.5 [5,] 43129.0 36845 35338.0 29462.0 36438.0 29096.0 $n [1] 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 20962.86 24945.2 17994.03 19853.59 17724.04 16244.48 [2,] 35362.14 32212.8 30536.97 26386.41 27736.96 23325.52 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(13253, 21997.5, 28162.5, 37782.5, 43129, 13971, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7v4fr1350387998.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,] 13131.83 13530.00 12939.38 [2,] 20100.50 19729.50 20165.25 [3,] 25425.25 24860.75 25404.69 [4,] 31242.50 30498.25 30812.31 [5,] 34292.67 33815.50 33294.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20343.31 19949.05 20548.49 [2,] 30507.19 29772.45 30260.88 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1h4ef1350387998.ps tmp/1h4ef1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/2pfib1350387998.ps tmp/2pfib1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/3fqez1350387998.ps tmp/3fqez1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/4f2ou1350387998.ps tmp/4f2ou1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/5mcpf1350387998.ps tmp/5mcpf1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/6uw9r1350387998.ps tmp/6uw9r1350387998.png",intern=TRUE)) character(0) > try(system("convert tmp/7v4fr1350387998.ps tmp/7v4fr1350387998.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.690 0.820 4.516