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(82,80,76,73,70,68,67,64,69,69,67,57,67,69,67,66,65,56,57,53,58,59,60,59,65,62,61,62,57,51,45,46,48,49,48,43,51,54,57,60,58,61,62,62,64,68,70,73,79,84,82,78,78,76,73,71,71,70,74,72,80,80,80,79,82,71,75,74,76,82,85,82,92,93,93,99,98,89,96,94,99,108,113,115,126,131,134,134,137,139,139,134,133,135,130,133) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 82 67 65 51 79 80 92 126 NA [2,] 80 69 62 54 84 80 93 131 NA [3,] 76 67 61 57 82 80 93 134 NA [4,] 73 66 62 60 78 79 99 134 NA [5,] 70 65 57 58 78 82 98 137 NA [6,] 68 56 51 61 76 71 89 139 NA [7,] 67 57 45 62 73 75 96 139 NA [8,] 64 53 46 62 71 74 94 134 NA [9,] 69 58 48 64 71 76 99 133 NA [10,] 69 59 49 68 70 82 108 135 NA [11,] 67 60 48 70 74 85 113 130 NA [12,] 57 59 43 73 72 82 115 133 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -2 2 -3 3 5 0 1 5 NA [2,] -4 -2 -1 3 -2 0 0 3 NA [3,] -3 -1 1 3 -4 -1 6 0 NA [4,] -3 -1 -5 -2 0 3 -1 3 NA [5,] -2 -9 -6 3 -2 -11 -9 2 NA [6,] -1 1 -6 1 -3 4 7 0 NA [7,] -3 -4 1 0 -2 -1 -2 -5 NA [8,] 5 5 2 2 0 2 5 -1 NA [9,] 0 1 1 4 -1 6 9 2 NA [10,] -2 1 -1 2 4 3 5 -5 NA [11,] -10 -1 -5 3 -2 -3 2 3 NA [12,] 10 6 8 6 8 10 11 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/1ppns1412949875.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/28ke71412949875.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/3v1ud1412949875.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/4jt011412949875.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,] 51.0 54.0 57.0 60.0 57.0 51.0 45.0 46.0 48.0 49.0 48.0 43.0 [2,] 66.0 65.5 64.0 64.0 61.5 58.5 59.5 57.5 61.0 63.5 63.5 58.0 [3,] 79.5 80.0 78.0 75.5 74.0 69.5 70.0 67.5 70.0 69.5 72.0 72.5 [4,] 87.0 88.5 87.5 89.0 90.0 82.5 85.5 84.0 87.5 95.0 99.0 98.5 [5,] 92.0 93.0 93.0 99.0 98.0 89.0 96.0 94.0 99.0 135.0 130.0 133.0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67.7691 67.15187 64.87256 61.53464 58.07949 56.09326 55.47603 52.69672 [2,] 91.2309 92.84813 91.12744 89.46536 89.92051 82.90674 84.52397 82.30328 [,9] [,10] [,11] [,12] [1,] 55.19672 51.90365 52.16919 49.87612 [2,] 84.80328 87.09635 91.83081 95.12388 $out [1] 126 131 134 134 137 139 139 134 133 $group [1] 1 2 3 4 5 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(51, 66, 79.5, 87, 92, 54, 65.5, 80, 88.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55ftg1412949875.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,] -3.0 -4.0 -4.0 -5.0 -11 -6.0 -5.0 -1 -1.0 -5.0 -10.0 6 [2,] -1.0 -2.0 -2.0 -2.5 -9 -2.0 -3.5 1 0.5 -1.5 -4.0 7 [3,] 1.5 -0.5 -0.5 -1.0 -4 0.5 -2.0 2 1.5 1.5 -1.5 8 [4,] 4.0 1.5 2.0 1.5 0 2.5 -0.5 5 5.0 3.5 2.5 10 [5,] 5.0 3.0 6.0 3.0 3 7.0 1.0 5 9.0 5.0 3.0 11 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.293072 -2.45515 -2.734457 -3.234457 -9.027529 -2.013765 -3.6758431 [2,] 4.293072 1.45515 1.734457 1.234457 1.027529 3.013765 -0.3241569 [,8] [,9] [,10] [,11] [,12] [1,] -0.2344574 -1.013765 -1.293072 -5.130993 6.208448 [2,] 4.2344574 4.013765 4.293072 2.130993 9.791552 $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(-3, -1, 1.5, 4, 5, -4, -2, -0.5, 1.5, 3, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6dn6l1412949875.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,] 57.0 53.0 43.0 51.0 70.0 71.0 89.0 126 NA [2,] 67.0 57.5 47.0 57.5 71.5 75.5 93.0 132 NA [3,] 69.0 59.5 50.0 61.5 75.0 80.0 97.0 134 NA [4,] 74.5 66.5 61.5 66.0 78.5 82.0 103.5 136 NA [5,] 82.0 69.0 65.0 73.0 84.0 85.0 115.0 139 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 65.5792 55.39504 43.38645 57.62309 71.80725 77.03531 92.21088 132.1756 [2,] 72.4208 63.60496 56.61355 65.37691 78.19275 82.96469 101.78912 135.8244 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(57, 67, 69, 74.5, 82, 53, 57.5, 59.5, 66.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kq601412949875.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,] 74.7500 67.50 69.3750 [2,] 77.0000 69.75 71.3125 [3,] 80.1250 72.25 74.5625 [4,] 81.0625 76.75 76.1250 [5,] 81.6250 80.00 78.6250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 78.27207 69.05725 72.36749 [2,] 81.97793 75.44275 76.75751 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(74.75, 77, 80.125, 81.0625, 81.625, 67.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ppns1412949875.ps tmp/1ppns1412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/28ke71412949875.ps tmp/28ke71412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/3v1ud1412949875.ps tmp/3v1ud1412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/4jt011412949875.ps tmp/4jt011412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/55ftg1412949875.ps tmp/55ftg1412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/6dn6l1412949875.ps tmp/6dn6l1412949875.png",intern=TRUE)) character(0) > try(system("convert tmp/7kq601412949875.ps tmp/7kq601412949875.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.365 2.882