R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(65,65.3,62.9,63.5,62.1,59.3,61.6,61.5,60.1,59.5,62.7,65.5,63.8,63.8,62.7,62.3,62.4,64.8,66.4,65.1,67.4,68.8,68.6,71.5,75,84.3,84,79.1,78.8,82.7,85.3,84.5,80.8,70.1,68.2,68.1,72.3,73.1,71.5,74.1,80.3,80.6,81.4,87.4,89.3,93.2,92.8,96.8,100.3,95.6,89,87.4,86.7,92.8,98.6,100.8,105.5,107.8,113.7,120.3,126.5,134.8,134.5,133.1,128.8,127.1,129.1,128.4,126.5,117.1,114.2,109.1) > 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,] 65.0 63.8 75.0 72.3 100.3 126.5 NA [2,] 65.3 63.8 84.3 73.1 95.6 134.8 NA [3,] 62.9 62.7 84.0 71.5 89.0 134.5 NA [4,] 63.5 62.3 79.1 74.1 87.4 133.1 NA [5,] 62.1 62.4 78.8 80.3 86.7 128.8 NA [6,] 59.3 64.8 82.7 80.6 92.8 127.1 NA [7,] 61.6 66.4 85.3 81.4 98.6 129.1 NA [8,] 61.5 65.1 84.5 87.4 100.8 128.4 NA [9,] 60.1 67.4 80.8 89.3 105.5 126.5 NA [10,] 59.5 68.8 70.1 93.2 107.8 117.1 NA [11,] 62.7 68.6 68.2 92.8 113.7 114.2 NA [12,] 65.5 71.5 68.1 96.8 120.3 109.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3 0.0 9.3 0.8 -4.7 8.3 NA [2,] -2.4 -1.1 -0.3 -1.6 -6.6 -0.3 NA [3,] 0.6 -0.4 -4.9 2.6 -1.6 -1.4 NA [4,] -1.4 0.1 -0.3 6.2 -0.7 -4.3 NA [5,] -2.8 2.4 3.9 0.3 6.1 -1.7 NA [6,] 2.3 1.6 2.6 0.8 5.8 2.0 NA [7,] -0.1 -1.3 -0.8 6.0 2.2 -0.7 NA [8,] -1.4 2.3 -3.7 1.9 4.7 -1.9 NA [9,] -0.6 1.4 -10.7 3.9 2.3 -9.4 NA [10,] 3.2 -0.2 -1.9 -0.4 5.9 -2.9 NA [11,] 2.8 2.9 -0.1 4.0 6.6 -5.1 NA [12,] -1.7 3.5 4.2 3.5 6.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/1glxc1350632417.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/2rt061350632417.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/34ql21350632417.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/4p81k1350632417.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,] 63.80 63.8 62.70 62.3 62.10 59.30 61.60 61.50 60.10 59.50 62.7 [2,] 65.00 65.3 62.90 63.5 62.40 64.80 66.40 65.10 67.40 68.80 68.2 [3,] 73.65 78.7 77.75 76.6 79.55 81.65 83.35 85.95 85.05 81.65 80.7 [4,] 100.30 95.6 89.00 87.4 86.70 92.80 98.60 100.80 105.50 107.80 113.7 [5,] 126.50 134.8 89.00 87.4 86.70 127.10 129.10 128.40 126.50 117.10 114.2 [,12] [1,] 65.50 [2,] 68.10 [3,] 84.15 [4,] 109.10 [5,] 120.30 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 50.88036 59.15552 60.91466 61.18373 63.87572 63.5891 62.57996 62.92235 [2,] 96.41964 98.24448 94.58534 92.01627 95.22428 99.7109 104.12004 108.97765 [,9] [,10] [,11] [,12] [1,] 60.47427 56.49374 51.35103 57.70368 [2,] 109.62573 106.80626 110.04897 110.59632 $out [1] 134.5 133.1 128.8 $group [1] 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(63.8, 65, 73.65, 100.3, 126.5, 63.8, 65.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o7jo1350632417.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.70 -2.40 -1.6 -1.4 -2.80 0.80 -1.3 -3.70 -10.7 -2.9 -5.10 3.5 [2,] 0.00 -2.40 -1.6 -1.4 -1.70 1.60 -0.8 -1.90 -9.4 -1.9 -0.10 3.5 [3,] 0.55 -1.35 -0.9 -0.5 1.35 2.15 -0.4 0.25 0.4 -0.3 2.85 3.5 [4,] 8.30 -0.30 0.6 0.1 3.90 2.60 2.2 2.30 2.3 3.2 4.00 4.2 [5,] 9.30 -0.30 2.6 0.1 6.10 2.60 6.0 4.70 3.9 5.9 6.60 4.2 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -4.803768 -2.704567828 -2.3190711 -1.4675484 -2.262181 1.504968 -2.335097 [2,] 5.903768 0.004567828 0.5190711 0.4675484 4.962181 2.795032 1.535097 [,8] [,9] [,10] [,11] [,12] [1,] -2.459136 -7.146878 -3.589665 0.2053676 3.005382 [2,] 2.959136 7.946878 2.989665 5.4946324 3.994618 $out [1] -6.6 -4.9 6.2 -4.3 5.8 -1.7 6.2 $group [1] 2 3 4 4 6 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4.7, 0, 0.549999999999997, 8.30000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6znc51350632417.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,] 59.30 62.30 68.10 71.50 86.70 109.10 NA [2,] 60.80 63.25 72.55 73.60 90.90 121.80 NA [3,] 62.40 64.95 79.95 81.00 99.45 127.75 NA [4,] 64.25 68.00 84.15 91.05 106.65 131.10 NA [5,] 65.50 71.50 85.30 96.80 120.30 134.80 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 60.82643 62.78349 74.65916 73.04094 92.26632 123.5082 NA [2,] 63.97357 67.11651 85.24084 88.95906 106.63368 131.9918 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(59.3, 60.8, 62.4, 64.25, 65.5, 62.3, 63.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tt071350632417.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,] 83.18333 73.650 75.73750 [2,] 83.95833 78.225 77.95625 [3,] 86.11667 81.175 81.55625 [4,] 87.50833 83.750 86.36875 [5,] 88.55000 85.950 88.38750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 84.49749 78.65501 77.71925 [2,] 87.73585 83.69499 85.39325 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(83.1833333333333, 83.9583333333333, 86.1166666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1glxc1350632417.ps tmp/1glxc1350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/2rt061350632417.ps tmp/2rt061350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/34ql21350632417.ps tmp/34ql21350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/4p81k1350632417.ps tmp/4p81k1350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/5o7jo1350632417.ps tmp/5o7jo1350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/6znc51350632417.ps tmp/6znc51350632417.png",intern=TRUE)) character(0) > try(system("convert tmp/7tt071350632417.ps tmp/7tt071350632417.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.890 0.687 4.542