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(71,77,76,69,74,101,105,73,68,65,70,65,80,92,93,90,96,125,134,100,97,97,101,90,108,113,112,103,103,125,128,91,84,83,83,69,77,83,78,70,75,101,117,80,87,81,78,73,93,105,102,97,100,127,138,107,107,106,109,107,129,138,137,134,134,166,180,131,135,127,121,116) > 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,] 71 80 108 77 93 129 NA [2,] 77 92 113 83 105 138 NA [3,] 76 93 112 78 102 137 NA [4,] 69 90 103 70 97 134 NA [5,] 74 96 103 75 100 134 NA [6,] 101 125 125 101 127 166 NA [7,] 105 134 128 117 138 180 NA [8,] 73 100 91 80 107 131 NA [9,] 68 97 84 87 107 135 NA [10,] 65 97 83 81 106 127 NA [11,] 70 101 83 78 109 121 NA [12,] 65 90 69 73 107 116 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 6 12 5 6 12 9 NA [2,] -1 1 -1 -5 -3 -1 NA [3,] -7 -3 -9 -8 -5 -3 NA [4,] 5 6 0 5 3 0 NA [5,] 27 29 22 26 27 32 NA [6,] 4 9 3 16 11 14 NA [7,] -32 -34 -37 -37 -31 -49 NA [8,] -5 -3 -7 7 0 4 NA [9,] -3 0 -1 -6 -1 -8 NA [10,] 5 4 0 -3 3 -6 NA [11,] -5 -11 -14 -5 -2 -5 NA [12,] 15 18 8 20 22 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/1au271413135872.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/2cta61413135872.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/3bcwf1413135872.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/4pk2z1413135872.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,] 71.0 77.0 76.0 69.0 74 101 105 73.0 68 65 70 65.0 [2,] 77.0 83.0 78.0 70.0 75 101 117 80.0 84 81 78 69.0 [3,] 86.5 98.5 97.5 93.5 98 125 131 95.5 92 90 92 81.5 [4,] 108.0 113.0 112.0 103.0 103 127 138 107.0 107 106 109 107.0 [5,] 129.0 138.0 137.0 134.0 134 166 138 131.0 135 127 121 116.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 66.504 79.14903 75.5689 72.21393 79.9391 108.2292 117.4543 78.08413 [2,] 106.496 117.85097 119.4311 114.78607 116.0609 141.7708 144.5457 112.91587 [,9] [,10] [,11] [,12] [1,] 77.16426 73.87419 72.004 56.98877 [2,] 106.83574 106.12581 111.996 106.01123 $out [1] 180 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(71, 77, 86.5, 108, 129, 77, 83, 98.5, 113, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fknl1413135872.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,] 5.0 -5 -9 0 22 3 -37.0 -7.0 -8 -6.0 -14 8 [2,] 6.0 -3 -8 0 26 4 -37.0 -5.0 -6 -3.0 -11 15 [3,] 7.5 -1 -6 4 27 10 -35.5 -1.5 -2 1.5 -5 18 [4,] 12.0 -1 -3 5 29 14 -32.0 4.0 -1 4.0 -5 20 [5,] 12.0 1 -3 6 32 16 -31.0 7.0 0 5.0 -2 22 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.629806 -2.2900646 -9.225161 0.7748385 25.0649 3.549677 -38.72516 [2,] 11.370194 0.2900646 -2.774839 7.2251615 28.9351 16.450323 -32.27484 [,8] [,9] [,10] [,11] [,12] [1,] -7.305291 -5.225161 -3.015226 -8.870194 14.46701 [2,] 4.305291 1.225161 6.015226 -1.129806 21.53299 $out [1] -49 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(5, 6, 7.5, 12, 12, -5, -3, -1, -1, 1, -9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cude1413135872.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,] 65.0 80.0 69.0 70 93.0 116.0 NA [2,] 68.5 91.0 83.5 76 101.0 128.0 NA [3,] 72.0 96.5 103.0 79 106.5 134.0 NA [4,] 76.5 100.5 112.5 85 108.0 137.5 NA [5,] 77.0 101.0 128.0 87 109.0 138.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 68.35115 92.16699 89.77291 74.89504 103.3073 129.667 NA [2,] 75.64885 100.83301 116.22709 83.10496 109.6927 138.333 NA $out [1] 101 105 125 134 101 117 127 138 166 180 $group [1] 1 1 2 2 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(65, 68.5, 72, 76.5, 77, 80, 91, 96.5, 100.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7p11y1413135872.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,] 86.66667 81.50 86.3750 [2,] 93.41667 91.00 91.1250 [3,] 96.66667 94.50 93.5625 [4,] 100.50000 98.25 96.8750 [5,] 101.33333 98.50 98.1250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.43591 91.19323 90.93989 [2,] 99.89742 97.80677 96.18511 $out [1] 124.1667 133.6667 125.0000 131.0000 116.7500 128.3750 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(86.6666666666667, 93.4166666666667, 96.6666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1au271413135872.ps tmp/1au271413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/2cta61413135872.ps tmp/2cta61413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/3bcwf1413135872.ps tmp/3bcwf1413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/4pk2z1413135872.ps tmp/4pk2z1413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/5fknl1413135872.ps tmp/5fknl1413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/6cude1413135872.ps tmp/6cude1413135872.png",intern=TRUE)) character(0) > try(system("convert tmp/7p11y1413135872.ps tmp/7p11y1413135872.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.355 0.432 2.819