R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(78.7,75.7,77.1,86.1,86.8,86.3,91.5,90.7,78.2,73,73.7,77.3,67.5,72.7,76.6,82.4,82.3,86.3,93,88.8,96.9,103.9,115.7,112.8,114.7,118,129.3,137,156,166.2,167.8,144.3,126,90.4,67.5,52.4,54.6,52.9,59.1,63.3,73.8,87.6,81.8,90.7,86.3,93.6,98,94.3,97.6,94.2,100.2,106.7,95.7,94.6,94.7,96.2,96.3,103.3,106.8,113.7,117.4,123.6,137.6,147.4,137.2,133.8,136.7,127.3,128.7,127,133.7,132,135.1,142.6,149.3,143.5,131.4,114.7,122.3,133.4,134.6,130.9,127.9,128) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.7 67.5 114.7 54.6 97.6 117.4 135.1 NA [2,] 75.7 72.7 118.0 52.9 94.2 123.6 142.6 NA [3,] 77.1 76.6 129.3 59.1 100.2 137.6 149.3 NA [4,] 86.1 82.4 137.0 63.3 106.7 147.4 143.5 NA [5,] 86.8 82.3 156.0 73.8 95.7 137.2 131.4 NA [6,] 86.3 86.3 166.2 87.6 94.6 133.8 114.7 NA [7,] 91.5 93.0 167.8 81.8 94.7 136.7 122.3 NA [8,] 90.7 88.8 144.3 90.7 96.2 127.3 133.4 NA [9,] 78.2 96.9 126.0 86.3 96.3 128.7 134.6 NA [10,] 73.0 103.9 90.4 93.6 103.3 127.0 130.9 NA [11,] 73.7 115.7 67.5 98.0 106.8 133.7 127.9 NA [12,] 77.3 112.8 52.4 94.3 113.7 132.0 128.0 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -3.0 5.2 3.3 -1.7 -3.4 6.2 7.5 NA [2,] 1.4 3.9 11.3 6.2 6.0 14.0 6.7 NA [3,] 9.0 5.8 7.7 4.2 6.5 9.8 -5.8 NA [4,] 0.7 -0.1 19.0 10.5 -11.0 -10.2 -12.1 NA [5,] -0.5 4.0 10.2 13.8 -1.1 -3.4 -16.7 NA [6,] 5.2 6.7 1.6 -5.8 0.1 2.9 7.6 NA [7,] -0.8 -4.2 -23.5 8.9 1.5 -9.4 11.1 NA [8,] -12.5 8.1 -18.3 -4.4 0.1 1.4 1.2 NA [9,] -5.2 7.0 -35.6 7.3 7.0 -1.7 -3.7 NA [10,] 0.7 11.8 -22.9 4.4 3.5 6.7 -3.0 NA [11,] 3.6 -2.9 -15.1 -3.7 6.9 -1.7 0.1 NA [12,] -9.8 1.9 2.2 3.3 3.7 3.1 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/fisher/rcomp/tmp/1e1xj1381948625.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/fisher/rcomp/tmp/27tyq1381948625.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/fisher/rcomp/tmp/3r89h1381948625.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/fisher/rcomp/tmp/4mfak1381948625.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,] 54.60 52.9 59.10 63.30 73.80 86.30 81.80 88.80 78.20 73.00 [2,] 73.10 74.2 76.85 84.25 84.55 86.95 92.25 90.70 91.30 92.00 [3,] 97.60 94.2 100.20 106.70 95.70 94.60 94.70 96.20 96.90 103.30 [4,] 116.05 120.8 133.45 140.25 134.30 124.25 129.50 130.35 127.35 115.45 [5,] 135.10 142.6 149.30 147.40 156.00 166.20 167.80 144.30 134.60 130.90 [,11] [,12] [1,] 67.50 52.40 [2,] 85.85 85.80 [3,] 106.80 112.80 [4,] 121.80 120.85 [5,] 133.70 132.00 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 71.95095 66.37123 66.39939 73.2577 65.9901 72.32504 72.4549 [2,] 123.24905 122.02877 134.00061 140.1423 125.4099 116.87496 116.9451 [,8] [,9] [,10] [,11] [,12] [1,] 72.52166 75.37152 89.29604 85.33124 91.86871 [2,] 119.87834 118.42848 117.30396 128.26876 133.73129 $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(54.6, 73.1, 97.6, 116.05, 135.1, 52.9, 74.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/56tfq1381948625.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.40 1.40 4.20 -12.1 -3.40 -5.80 -23.5 -18.30 -5.20 -3.00 -3.70 1.90 [2,] -2.35 4.95 5.00 -10.6 -2.25 0.85 -6.8 -8.45 -4.45 -1.15 -3.30 1.90 [3,] 3.30 6.20 6.50 -0.1 -0.50 2.90 -0.8 0.10 -1.70 3.50 -1.70 2.65 [4,] 5.70 9.00 8.35 5.6 7.10 5.95 5.2 1.30 7.00 5.55 1.85 3.30 [5,] 7.50 14.00 9.80 19.0 13.80 7.60 11.1 8.10 7.30 11.80 6.90 3.70 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.50733 3.781405 4.499434 -9.774379 -6.083669 -0.1456377 -7.966206 [2,] 8.10733 8.618595 8.500566 9.574379 5.083669 5.9456377 6.366206 [,8] [,9] [,10] [,11] [,12] [1,] -5.722543 -8.537755 -0.5011319 -4.775497 1.746955 [2,] 5.922543 5.137755 7.5011319 1.375497 3.553045 $out [1] -5.8 -16.7 -35.6 -22.9 -15.1 -9.8 $group [1] 3 5 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.39999999999999, -2.35, 3.3, 5.7, 7.5, 1.39999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6u2dq1381948625.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] [1,] 73.00 67.50 52.40 52.90 94.20 117.40 114.70 NA [2,] 76.40 79.45 102.55 61.20 95.20 127.15 127.95 NA [3,] 78.45 87.55 127.65 84.05 96.95 132.85 132.40 NA [4,] 86.55 100.40 150.15 92.15 105.00 136.95 138.85 NA [5,] 91.50 115.70 167.80 98.00 113.70 147.40 149.30 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 73.82052 77.99456 105.9393 69.9335 92.48015 128.3802 127.4284 NA [2,] 83.07948 97.10544 149.3607 98.1665 101.41985 137.3198 137.3716 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(73, 76.4, 78.45, 86.55, 91.5, 67.5, 79.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7yyt41381948625.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,] 95.08571 94.20 94.575 [2,] 102.32857 95.20 103.525 [3,] 105.44286 97.25 105.375 [4,] 109.70714 105.00 109.975 [5,] 112.54286 112.80 112.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 102.0774 92.78015 102.4331 [2,] 108.8083 101.71985 108.3169 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.0857142857143, 102.328571428571, 105.442857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e1xj1381948625.ps tmp/1e1xj1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/27tyq1381948625.ps tmp/27tyq1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/3r89h1381948625.ps tmp/3r89h1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/4mfak1381948625.ps tmp/4mfak1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/56tfq1381948625.ps tmp/56tfq1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/6u2dq1381948625.ps tmp/6u2dq1381948625.png",intern=TRUE)) character(0) > try(system("convert tmp/7yyt41381948625.ps tmp/7yyt41381948625.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.241 0.557 3.792