R version 2.15.2 (2012-10-26) -- "Trick or Treat" 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(14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650,20830,23595,22937,21814,21928,21777,21383,21467,22052,22680,24320,24977,25204,25739,26434,27525,30695,32436,30160,30236,31293,31077,32226,33865,32810,32242,32700,32819,33947,34148,35261,39506,41591,39148,41216,40225) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 14544 15579 19394 20830 25204 32810 NA [2,] 14931 16348 20148 23595 25739 32242 NA [3,] 14886 15928 20108 22937 26434 32700 NA [4,] 16005 16171 18584 21814 27525 32819 NA [5,] 17064 15937 18441 21928 30695 33947 NA [6,] 15168 15713 18391 21777 32436 34148 NA [7,] 16050 15594 19178 21383 30160 35261 NA [8,] 15839 15683 18079 21467 30236 39506 NA [9,] 15137 16438 18483 22052 31293 41591 NA [10,] 14954 17032 19644 22680 31077 39148 NA [11,] 15648 17696 19195 24320 32226 41216 NA [12,] 15305 17745 19650 24977 33865 40225 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 387 769 754 2765 535 -568 NA [2,] -45 -420 -40 -658 695 458 NA [3,] 1119 243 -1524 -1123 1091 119 NA [4,] 1059 -234 -143 114 3170 1128 NA [5,] -1896 -224 -50 -151 1741 201 NA [6,] 882 -119 787 -394 -2276 1113 NA [7,] -211 89 -1099 84 76 4245 NA [8,] -702 755 404 585 1057 2085 NA [9,] -183 594 1161 628 -216 -2443 NA [10,] 694 664 -449 1640 1149 2068 NA [11,] -343 49 455 657 1639 -991 NA [12,] 274 1649 1180 227 -1055 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/1ng0q1353277301.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/2q9b21353277301.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/39h4w1353277301.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/4ajif1353277301.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,] 14544 14931.0 14886.0 16005 15937.0 15168 15594.0 15683 15137.0 14954 [2,] 15579 16348.0 15928.0 16171 17064.0 15713 16050.0 15839 16438.0 17032 [3,] 20112 21871.5 21522.5 20199 20184.5 20084 20280.5 19773 20267.5 21162 [4,] 25204 25739.0 26434.0 27525 30695.0 32436 30160.0 30236 31293.0 31077 [5,] 32810 32242.0 32700.0 32819 33947.0 34148 35261.0 39506 41591.0 39148 [,11] [,12] [1,] 15648.0 15305.0 [2,] 17696.0 17745.0 [3,] 21757.5 22313.5 [4,] 32226.0 33865.0 [5,] 41216.0 40225.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13903.56 15814 14745.79 12875.3 11392.06 9297.125 11179.09 10486.47 [2,] 26320.44 27929 28299.21 27522.7 28976.94 30870.875 29381.91 29059.53 [,9] [,10] [,11] [,12] [1,] 10685.55 12102.52 12385.18 11915.58 [2,] 29849.45 30221.48 31129.82 32711.42 $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(14544, 15579, 20112, 25204, 32810, 14931, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55nd31353277301.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,] 387.0 -658.0 -1524 -234.0 -224.0 -2276 -211 404 -216.0 -449.0 -991 -1055 [2,] 387.0 -420.0 -1123 -143.0 -224.0 -394 -211 404 -216.0 664.0 -343 227 [3,] 644.5 -42.5 181 586.5 -100.5 334 80 670 205.5 921.5 252 274 [4,] 769.0 458.0 1091 1128.0 201.0 882 89 1057 628.0 1640.0 657 1180 [5,] 769.0 695.0 1119 1128.0 201.0 1113 89 1057 1161.0 2068.0 1639 1649 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 398.0977 -608.8384 -1247.102 -233.3361 -374.6387 -489.0612 -113.5097 [2,] 890.9023 523.8384 1609.102 1406.3361 173.6387 1157.0612 273.5097 [,8] [,9] [,10] [,11] [,12] [1,] 248.7939 -338.9073 291.9485 -393.0323 -399.3874 [2,] 1091.2061 749.9073 1551.0515 897.0323 947.3874 $out [1] 2765 -568 3170 -1896 1741 -1099 4245 -702 2085 -2443 $group [1] 1 1 4 5 5 7 7 8 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(387, 387, 644.5, 769, 769, -658, -420, -42.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64nzu1353277301.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] [1,] 14544.0 15579 18079.0 20830 25204.0 32242.0 NA [2,] 14942.5 15698 18462.0 21622 26979.5 32814.5 NA [3,] 15236.5 16054 19186.5 21990 30465.5 34704.5 NA [4,] 15922.0 16735 19647.0 23266 31759.5 39865.5 NA [5,] 17064.0 17745 20148.0 24977 33865.0 41591.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 14789.74 15581.02 18646.01 21240.16 28285.31 31488.49 NA [2,] 15683.26 16526.98 19726.99 22739.84 32645.69 37920.51 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(14544, 14942.5, 15236.5, 15922, 17064, 15579, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75wqt1353277301.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,] 21393.50 19773.00 20321.62 [2,] 22166.33 20148.25 21351.06 [3,] 22970.42 20274.00 22677.31 [4,] 24127.42 21640.00 23204.12 [5,] 25294.50 22313.50 24932.12 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 22075.95 19593.6 21832.12 [2,] 23864.88 20954.4 23522.51 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(21393.5, 22166.3333333333, 22970.4166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ng0q1353277301.ps tmp/1ng0q1353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/2q9b21353277301.ps tmp/2q9b21353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/39h4w1353277301.ps tmp/39h4w1353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/4ajif1353277301.ps tmp/4ajif1353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/55nd31353277301.ps tmp/55nd31353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/64nzu1353277301.ps tmp/64nzu1353277301.png",intern=TRUE)) character(0) > try(system("convert tmp/75wqt1353277301.ps tmp/75wqt1353277301.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.318 0.556 3.918