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(105,101,95,93,84,87,116,120,117,109,105,107,109,109,108,107,99,103,131,137,135,124,118,121,121,118,113,107,100,102,130,136,133,120,112,109,110,106,102,98,92,92,120,127,124,114,108,106,111,110,104,100,96,98,122,134,133,125,118,116,118,116,111,108,102,102,129,136,137,126,119,117,120,116,110,104,98,98,124,130,131,121,114,111) > 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,] 105 109 121 110 111 118 120 NA [2,] 101 109 118 106 110 116 116 NA [3,] 95 108 113 102 104 111 110 NA [4,] 93 107 107 98 100 108 104 NA [5,] 84 99 100 92 96 102 98 NA [6,] 87 103 102 92 98 102 98 NA [7,] 116 131 130 120 122 129 124 NA [8,] 120 137 136 127 134 136 130 NA [9,] 117 135 133 124 133 137 131 NA [10,] 109 124 120 114 125 126 121 NA [11,] 105 118 112 108 118 119 114 NA [12,] 107 121 109 106 116 117 111 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -4 0 -3 -4 -1 -2 -4 NA [2,] -6 -1 -5 -4 -6 -5 -6 NA [3,] -2 -1 -6 -4 -4 -3 -6 NA [4,] -9 -8 -7 -6 -4 -6 -6 NA [5,] 3 4 2 0 2 0 0 NA [6,] 29 28 28 28 24 27 26 NA [7,] 4 6 6 7 12 7 6 NA [8,] -3 -2 -3 -3 -1 1 1 NA [9,] -8 -11 -13 -10 -8 -11 -10 NA [10,] -4 -6 -8 -6 -7 -7 -7 NA [11,] 2 3 -3 -2 -2 -2 -3 NA [12,] 2 0 1 5 2 3 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/1dfj41425308363.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/2knbz1425308363.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/312vf1425308363.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/44c3f1425308363.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,] 105.0 101.0 95.0 93 92.0 87 116.0 120.0 124.0 109.0 105 106.0 [2,] 109.5 107.5 103.0 99 94.0 95 121.0 128.5 127.5 117.0 110 108.0 [3,] 111.0 110.0 108.0 104 98.0 98 124.0 134.0 133.0 121.0 114 111.0 [4,] 119.0 116.0 110.5 107 99.5 102 129.5 136.0 134.0 124.5 118 116.5 [5,] 121.0 118.0 113.0 108 102.0 103 131.0 137.0 137.0 126.0 119 121.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.3268 104.9239 103.5211 99.22253 94.71549 93.81971 118.9239 129.5211 [2,] 116.6732 115.0761 112.4789 108.77747 101.28451 102.18029 129.0761 138.4789 [,9] [,10] [,11] [,12] [1,] 129.1183 116.5211 109.2225 105.9239 [2,] 136.8817 125.4789 118.7775 116.0761 $out [1] 84 117 $group [1] 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(105, 109.5, 111, 119, 121, 101, 107.5, 110, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kdhc1425308363.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,] -4.0 -6.0 -6.0 -9.0 0.0 26.0 6 -3 -13 -8 -3.0 0 [2,] -4.0 -6.0 -5.0 -7.5 0.0 26.5 6 -3 -11 -7 -2.5 1 [3,] -3.0 -5.0 -4.0 -6.0 2.0 28.0 6 -2 -10 -7 -2.0 2 [4,] -1.5 -4.5 -2.5 -6.0 2.5 28.0 7 0 -9 -6 0.0 3 [5,] 0.0 -4.0 -1.0 -4.0 4.0 29.0 7 1 -8 -6 3.0 5 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4.49296 -5.895776 -5.49296 -6.895776 0.5070403 27.10422 5.402816 [2,] -1.50704 -4.104224 -2.50704 -5.104224 3.4929597 28.89578 6.597184 [,8] [,9] [,10] [,11] [,12] [1,] -3.7915516 -11.194368 -7.597184 -3.4929597 0.7099354 [2,] -0.2084484 -8.805632 -6.402816 -0.5070403 3.2900646 $out [1] -1 24 4 12 -4 $group [1] 2 6 7 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4, -4, -3, -1.5, 0, -6, -6, -5, -4.5, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6flez1425308363.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,] 84.0 99.0 100.0 92 96.0 102.0 98.0 NA [2,] 94.0 107.5 108.0 100 102.0 109.5 107.0 NA [3,] 105.0 113.5 115.5 107 113.5 117.5 115.0 NA [4,] 112.5 127.5 125.5 117 123.5 127.5 122.5 NA [5,] 120.0 137.0 136.0 127 134.0 137.0 131.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 96.56203 104.3779 107.5181 99.24619 103.6937 109.2901 107.9303 NA [2,] 113.43797 122.6221 123.4819 114.75381 123.3063 125.7099 122.0697 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(84, 94, 105, 112.5, 120, 99, 107.5, 113.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7i6rp1425308363.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.85714 98.0 96.750 [2,] 104.28571 106.0 104.875 [3,] 112.92857 111.0 113.125 [4,] 122.21429 122.5 123.000 [5,] 131.42857 134.0 132.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.7512 103.4742 104.8581 [2,] 121.1059 118.5258 121.3919 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(95.8571428571429, 104.285714285714, 112.928571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1dfj41425308363.ps tmp/1dfj41425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/2knbz1425308363.ps tmp/2knbz1425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/312vf1425308363.ps tmp/312vf1425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/44c3f1425308363.ps tmp/44c3f1425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/5kdhc1425308363.ps tmp/5kdhc1425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/6flez1425308363.ps tmp/6flez1425308363.png",intern=TRUE)) character(0) > try(system("convert tmp/7i6rp1425308363.ps tmp/7i6rp1425308363.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.519 0.385 2.934