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(65,96,66,55,36,63,49,59,89,33,65,62,63,69,84,46,54,83,34,87,55,47,77,38,73,64,75,81,133,107,43,50,27,34,52,29,48,37,64,48,38,39,52,66,67,58,40,31,101,82,72,46,45,62,64,29,57,71,46,71,56,75,78,76,53,43,52,93,52,67,58,52) > 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,] 65 63 73 48 101 56 NA [2,] 96 69 64 37 82 75 NA [3,] 66 84 75 64 72 78 NA [4,] 55 46 81 48 46 76 NA [5,] 36 54 133 38 45 53 NA [6,] 63 83 107 39 62 43 NA [7,] 49 34 43 52 64 52 NA [8,] 59 87 50 66 29 93 NA [9,] 89 55 27 67 57 52 NA [10,] 33 47 34 58 71 67 NA [11,] 65 77 52 40 46 58 NA [12,] 62 38 29 31 71 52 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 31 6 -9 -11 -19 19 NA [2,] -30 15 11 27 -10 3 NA [3,] -11 -38 6 -16 -26 -2 NA [4,] -19 8 52 -10 -1 -23 NA [5,] 27 29 -26 1 17 -10 NA [6,] -14 -49 -64 13 2 9 NA [7,] 10 53 7 14 -35 41 NA [8,] 30 -32 -23 1 28 -41 NA [9,] -56 -8 7 -9 14 15 NA [10,] 32 30 18 -18 -25 -9 NA [11,] -3 -39 -23 -9 25 -6 NA [12,] 1 35 19 70 -15 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/1gatv1425556552.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/2kx8c1425556552.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/3f9a51425556552.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/4kcnx1425556552.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,] 48 37 64.0 46.0 36 39.0 34.0 29.0 52 33.0 40 29 [2,] 56 64 66.0 46.0 38 43.0 43.0 50.0 52 34.0 46 31 [3,] 64 72 73.5 51.5 49 62.5 50.5 62.5 56 52.5 55 45 [4,] 73 82 78.0 76.0 54 83.0 52.0 87.0 67 67.0 65 62 [5,] 73 96 84.0 81.0 54 107.0 64.0 93.0 89 71.0 77 71 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 53.03445 60.38942 65.75961 32.14903 38.67948 36.69871 44.69471 38.6338 [2,] 74.96555 83.61058 81.24039 70.85097 59.32052 88.30129 56.30529 86.3662 [,9] [,10] [,11] [,12] [1,] 46.32452 31.21393 42.74439 25.004 [2,] 65.67548 73.78607 67.25561 64.996 $out [1] 101 133 27 $group [1] 1 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(48, 56, 64, 73, 73, 37, 64, 72, 82, 96, 64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o1b01425556552.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,] -19.0 -30 -38.0 -23.0 -26 -64 -35 -41 -9.0 -25.0 -39.0 -15 [2,] -11.0 -10 -26.0 -19.0 -10 -49 7 -32 -9.0 -18.0 -23.0 1 [3,] -1.5 7 -13.5 -5.5 9 -6 12 -11 -0.5 4.5 -7.5 19 [4,] 19.0 15 -2.0 8.0 27 9 41 28 14.0 30.0 -3.0 35 [5,] 31.0 27 6.0 8.0 29 13 53 30 15.0 32.0 25.0 70 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -20.85097 -9.125807 -28.980775 -22.91587 -14.8662 -43.41187 -9.931098 [2,] 17.85097 23.125807 1.980775 11.91587 32.8662 31.41187 33.931098 [,8] [,9] [,10] [,11] [,12] [1,] -49.70194 -15.33574 -26.46155 -20.400646 -5.024314 [2,] 27.70194 14.33574 35.46155 5.400646 43.024314 $out [1] 52 -56 $group [1] 4 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-19, -11, -1.5, 19, 31, -30, -10, 7, 15, 27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gifj1425556552.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,] 33.0 34.0 27.0 31.0 29.0 43.0 NA [2,] 52.0 46.5 38.5 38.5 46.0 52.0 NA [3,] 62.5 59.0 58.0 48.0 63.0 57.0 NA [4,] 65.5 80.0 78.0 61.0 71.5 75.5 NA [5,] 66.0 87.0 133.0 67.0 101.0 93.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 56.34256 43.72043 39.98378 37.7376 51.36928 46.28149 NA [2,] 68.65744 74.27957 76.01622 58.2624 74.63072 67.71851 NA $out [1] 96 89 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(33, 52, 62.5, 65.5, 66, 34, 46.5, 59, 80, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zrap1425556552.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,] 47.16667 45.00 46.1250 [2,] 54.00000 51.00 49.6250 [3,] 59.25000 55.50 58.6250 [4,] 66.91667 63.25 65.6875 [5,] 73.16667 73.50 72.7500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 53.35862 49.91269 51.29879 [2,] 65.14138 61.08731 65.95121 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(47.1666666666667, 54, 59.25, 66.9166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gatv1425556552.ps tmp/1gatv1425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/2kx8c1425556552.ps tmp/2kx8c1425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/3f9a51425556552.ps tmp/3f9a51425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/4kcnx1425556552.ps tmp/4kcnx1425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/5o1b01425556552.ps tmp/5o1b01425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/6gifj1425556552.ps tmp/6gifj1425556552.png",intern=TRUE)) character(0) > try(system("convert tmp/7zrap1425556552.ps tmp/7zrap1425556552.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.438 0.492 2.950