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(86.5,86.6,98.8,84.4,91.4,95.7,78.5,81.7,94.3,98.5,95.4,91.7,92.8,90.6,102.2,91.8,95,102,88.9,89.6,97.9,108.6,100.8,95.1,101,100.9,102.5,105.4,98.4,105.3,96.5,88.1,107.9,107.1,92.5,95.7,85.2,85.5,94.7,86.2,88.8,93.4,83.4,82.9,96.7,96.2,92.8,92.8,90.2,95.9,107.5,98,95,108.5,91.8,91.7,108.3,105.1,104.8,103.2,98.6,102.4,121.2,102.6,108.9,105.5,90.8,99.6,111.6,104.7,103.1,101.7,98.8,101.4,114.2,96.9,98.3,104.8,94.4,94.5,102.4,105.5,101.2,99.5) > par1 = '4' > par1 <- '4' > #'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] 21 > 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] 21 21 21 21 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 86.5 91.4 94.3 92.8 95.0 97.9 101.0 98.4 107.9 85.2 88.8 96.7 90.2 [2,] 86.6 95.7 98.5 90.6 102.0 108.6 100.9 105.3 107.1 85.5 93.4 96.2 95.9 [3,] 98.8 78.5 95.4 102.2 88.9 100.8 102.5 96.5 92.5 94.7 83.4 92.8 107.5 [4,] 84.4 81.7 91.7 91.8 89.6 95.1 105.4 88.1 95.7 86.2 82.9 92.8 98.0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 95.0 108.3 98.6 108.9 111.6 98.8 98.3 102.4 NA [2,] 108.5 105.1 102.4 105.5 104.7 101.4 104.8 105.5 NA [3,] 91.8 104.8 121.2 90.8 103.1 114.2 94.4 101.2 NA [4,] 91.7 103.2 102.6 99.6 101.7 96.9 94.5 99.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.1 4.3 4.2 -2.2 7.0 10.7 -0.1 6.9 -0.8 0.3 4.6 -0.5 5.7 [2,] 12.2 -17.2 -3.1 11.6 -13.1 -7.8 1.6 -8.8 -14.6 9.2 -10.0 -3.4 11.6 [3,] -14.4 3.2 -3.7 -10.4 0.7 -5.7 2.9 -8.4 3.2 -8.5 -0.5 0.0 -9.5 [4,] 7.0 12.6 1.1 3.2 8.3 5.9 -7.0 19.8 -10.5 2.6 13.8 -2.6 -3.0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 13.5 -3.2 3.8 -3.4 -6.9 2.6 6.5 3.1 NA [2,] -16.7 -0.3 18.8 -14.7 -1.6 12.8 -10.4 -4.3 NA [3,] -0.1 -1.6 -18.6 8.8 -1.4 -17.3 0.1 -1.7 NA [4,] 16.6 -4.6 6.3 12.0 -2.9 1.4 7.9 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/1uy1z1382177298.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/2wb6b1382177298.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/3mcw61382177298.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/46rad1382177298.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] [1,] 85.2 85.5 78.5 81.7 [2,] 92.8 95.9 92.5 89.6 [3,] 97.9 102.0 96.5 94.5 [4,] 101.0 105.3 102.5 99.5 [5,] 111.6 108.6 114.2 105.4 $n [1] 21 21 21 21 $conf [,1] [,2] [,3] [,4] [1,] 95.07277 98.75903 93.05216 91.08664 [2,] 100.72723 105.24097 99.94784 97.91336 $out [1] 121.2 $group [1] 3 $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/57zaj1382177298.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] [1,] -6.9 -17.2 -18.6 -10.50 [2,] -0.5 -10.4 -8.5 -2.75 [3,] 3.1 -3.4 -1.6 4.55 [4,] 5.7 9.2 0.1 10.15 [5,] 13.5 18.8 8.8 19.80 $n [1] 21 21 21 20 $conf [,1] [,2] [,3] [,4] [1,] 0.9623375 -10.157772 -4.565145 -0.007553752 [2,] 5.2376625 3.357772 1.365145 9.107553752 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(-6.89999999999999, -0.5, 3.09999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6vup51382177298.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] [,10] [,11] [1,] 84.40 78.50 91.70 90.6 88.90 95.10 100.90 88.10 92.5 85.20 82.90 [2,] 85.45 80.10 93.00 91.2 89.25 96.50 100.95 92.30 94.1 85.35 83.15 [3,] 86.55 86.55 94.85 92.3 92.30 99.35 101.75 97.45 101.4 85.85 86.10 [4,] 92.70 93.55 96.95 97.5 98.50 104.70 103.95 101.85 107.5 90.45 91.10 [5,] 98.80 95.70 98.50 102.2 102.00 108.60 105.40 105.30 107.9 94.70 93.40 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 92.80 90.20 91.70 103.20 98.6 90.80 101.70 96.90 94.40 99.50 NA [2,] 92.80 93.05 91.75 104.00 100.5 95.20 102.40 97.85 94.45 100.35 NA [3,] 94.50 96.95 93.40 104.95 102.5 102.55 103.90 100.10 96.40 101.80 NA [4,] 96.45 102.75 101.75 106.70 111.9 107.20 108.15 107.80 101.55 103.95 NA [5,] 96.70 107.50 108.50 108.30 121.2 108.90 111.60 114.20 104.80 105.50 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 80.8225 75.9245 91.7295 87.323 84.9925 92.872 99.38 89.9055 90.814 [2,] 92.2775 97.1755 97.9705 97.277 99.6075 105.828 104.12 104.9945 111.986 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 81.821 79.8195 91.6165 89.287 85.5 102.817 93.494 93.07 99.3575 [2,] 89.879 92.3805 97.3835 104.613 101.3 107.083 111.506 112.03 108.4425 [,19] [,20] [,21] [,22] [1,] 92.2395 90.791 98.956 NA [2,] 107.9605 102.009 104.644 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" NA Warning message: In bxp(list(stats = c(84.4, 85.45, 86.55, 92.7, 98.8, 78.5, 80.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7cj9e1382177298.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,] 93.95714 94.50 94.550 [2,] 95.74048 95.50 95.725 [3,] 97.71429 97.20 97.200 [4,] 99.05238 99.95 99.050 [5,] 100.20000 102.00 100.600 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 95.09788 93.6845 94.57325 [2,] 100.33069 100.7155 99.82675 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.9571428571429, 95.7404761904762, 97.7142857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1uy1z1382177298.ps tmp/1uy1z1382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/2wb6b1382177298.ps tmp/2wb6b1382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/3mcw61382177298.ps tmp/3mcw61382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/46rad1382177298.ps tmp/46rad1382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/57zaj1382177298.ps tmp/57zaj1382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/6vup51382177298.ps tmp/6vup51382177298.png",intern=TRUE)) character(0) > try(system("convert tmp/7cj9e1382177298.ps tmp/7cj9e1382177298.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.169 0.584 3.743