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(75.6,74,75.3,83.1,84.9,83.5,88.2,87.4,77.8,74.5,75.3,78.7,71.4,75.8,79.2,84.4,84.4,87.2,92.4,88.5,94.8,100.9,110,107.9,111.2,116.7,125.8,131.5,146.2,155.4,157.5,137.2,121.3,89.1,69.6,56.7,58.5,56.4,60.5,64.6,73.2,84.6,80.4,88.4,84.6,90.8,94.9,93.1,96.6,93.1,98.3,105,95.6,94.3,95.3,97.1,98.1,104.4,107.8,114.3,118.7,124.1,134.2,142.4,133.8,131,133.2,125.9,126.2,122.7,126.6,124.8,128,134.1,138.8,134,124,110.4,116.7,124.7,126,122.8,120.2,121.2,125.4,127.9,122,117.5,117.9,117.9,122.7,125.7,126.1,123.2,120.6,123.5) > 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,] 75.6 71.4 111.2 58.5 96.6 118.7 128.0 125.4 NA [2,] 74.0 75.8 116.7 56.4 93.1 124.1 134.1 127.9 NA [3,] 75.3 79.2 125.8 60.5 98.3 134.2 138.8 122.0 NA [4,] 83.1 84.4 131.5 64.6 105.0 142.4 134.0 117.5 NA [5,] 84.9 84.4 146.2 73.2 95.6 133.8 124.0 117.9 NA [6,] 83.5 87.2 155.4 84.6 94.3 131.0 110.4 117.9 NA [7,] 88.2 92.4 157.5 80.4 95.3 133.2 116.7 122.7 NA [8,] 87.4 88.5 137.2 88.4 97.1 125.9 124.7 125.7 NA [9,] 77.8 94.8 121.3 84.6 98.1 126.2 126.0 126.1 NA [10,] 74.5 100.9 89.1 90.8 104.4 122.7 122.8 123.2 NA [11,] 75.3 110.0 69.6 94.9 107.8 126.6 120.2 120.6 NA [12,] 78.7 107.9 56.7 93.1 114.3 124.8 121.2 123.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -1.6 4.4 5.5 -2.1 -3.5 5.4 6.1 2.5 NA [2,] 1.3 3.4 9.1 4.1 5.2 10.1 4.7 -5.9 NA [3,] 7.8 5.2 5.7 4.1 6.7 8.2 -4.8 -4.5 NA [4,] 1.8 0.0 14.7 8.6 -9.4 -8.6 -10.0 0.4 NA [5,] -1.4 2.8 9.2 11.4 -1.3 -2.8 -13.6 0.0 NA [6,] 4.7 5.2 2.1 -4.2 1.0 2.2 6.3 4.8 NA [7,] -0.8 -3.9 -20.3 8.0 1.8 -7.3 8.0 3.0 NA [8,] -9.6 6.3 -15.9 -3.8 1.0 0.3 1.3 0.4 NA [9,] -3.3 6.1 -32.2 6.2 6.3 -3.5 -3.2 -2.9 NA [10,] 0.8 9.1 -19.5 4.1 3.4 3.9 -2.6 -2.6 NA [11,] 3.4 -2.1 -12.9 -1.8 6.5 -1.8 1.0 2.9 NA [12,] -7.3 3.3 1.8 3.5 4.4 3.2 4.2 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/1bbrz1424952912.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/2dfms1424952912.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/3rpqs1424952912.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/4f5ro1424952912.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] [1,] 58.50 56.4 60.50 64.60 73.20 83.50 80.40 87.40 77.80 74.50 69.6 [2,] 73.50 74.9 77.25 83.75 84.65 85.90 90.30 88.45 89.70 89.95 85.1 [3,] 103.90 104.9 110.15 111.25 106.75 102.35 106.00 110.90 109.70 102.65 108.9 [4,] 122.05 126.0 130.00 132.75 128.90 124.45 127.95 125.80 126.05 122.75 120.4 [5,] 128.00 134.1 138.80 142.40 146.20 155.40 157.50 137.20 126.20 123.20 126.6 [,12] [1,] 56.70 [2,] 85.90 [3,] 111.10 [4,] 122.35 [5,] 124.80 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 76.77927 76.35481 80.68309 83.8779 82.03131 80.81542 84.96817 [2,] 131.02073 133.44519 139.61691 138.6221 131.46869 123.88458 127.03183 [,8] [,9] [,10] [,11] [,12] [1,] 90.03575 89.39437 84.32745 89.18091 90.73851 [2,] 131.76425 130.00563 120.97255 128.61909 131.46149 $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(58.5, 73.5, 103.9, 122.05, 128, 56.4, 74.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50auc1424952912.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.50 1.30 -4.80 -10.0 -13.60 1.00 -20.3 -15.90 -3.50 -2.6 -2.10 1.80 [2,] -1.85 2.35 -0.20 -9.0 -2.10 1.55 -5.6 -6.70 -3.40 -2.6 -1.95 2.50 [3,] 3.45 4.40 5.45 0.2 -0.65 3.45 0.5 0.35 -3.05 2.1 -0.40 3.30 [4,] 5.45 7.15 7.25 5.2 6.00 5.00 5.5 1.15 6.15 4.0 3.15 3.85 [5,] 6.10 10.10 8.20 14.7 11.40 6.30 8.0 6.30 6.30 9.1 6.50 4.40 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.6278848 1.718651 1.288323 -7.732324 -5.174776 1.52278 -5.700619 [2,] 7.5278848 7.081349 9.611677 8.132324 3.874776 5.37722 6.700619 [,8] [,9] [,10] [,11] [,12] [1,] -4.035123 -8.384767 -1.586855 -3.248933 2.493802 [2,] 4.735123 2.284767 5.786855 2.448933 4.106198 $out [1] -5.9 -4.2 -32.2 -19.5 -12.9 -7.3 $group [1] 2 6 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.5, -1.85, 3.45, 5.45, 6.09999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6935g1424952912.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,] 74.00 71.40 56.70 56.40 93.10 118.70 110.40 117.50 NA [2,] 75.30 81.80 100.15 62.55 95.45 124.45 120.70 119.25 NA [3,] 78.25 87.85 123.55 82.50 97.60 126.40 124.35 122.95 NA [4,] 84.20 97.85 141.70 89.60 104.70 133.50 131.00 125.55 NA [5,] 88.20 110.00 157.50 94.90 114.30 142.40 138.80 127.90 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 74.19065 80.52949 104.5988 70.16231 93.38101 122.2722 119.6521 120.0765 [2,] 82.30935 95.17051 142.5012 94.83769 101.81899 130.5278 129.0479 125.8235 [,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(74, 75.3, 78.25, 84.2, 88.2, 71.4, 81.8, 87.85, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/731lj1424952912.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,] 98.1750 102.350 97.4625 [2,] 102.8250 104.400 103.4625 [3,] 105.5625 107.825 105.6250 [4,] 107.9250 110.525 107.6062 [5,] 110.8000 111.250 109.1375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103.2364 105.0313 103.735 [2,] 107.8886 110.6187 107.515 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.175, 102.825, 105.5625, 107.925, 110.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bbrz1424952912.ps tmp/1bbrz1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/2dfms1424952912.ps tmp/2dfms1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/3rpqs1424952912.ps tmp/3rpqs1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/4f5ro1424952912.ps tmp/4f5ro1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/50auc1424952912.ps tmp/50auc1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/6935g1424952912.ps tmp/6935g1424952912.png",intern=TRUE)) character(0) > try(system("convert tmp/731lj1424952912.ps tmp/731lj1424952912.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.628 0.462 3.116