R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(59,57,62,50,40,46,39,35,31,35,33,47,34,31,36,24,22,17,8,12,5,6,5,8,15,16,17,23,24,27,31,40,47,43,60,64,65,65,55,57,57,57,65,69,70,71,71,73,68,65,57,41,21,21,17,9,11,6,-2,0,5,3,7,4,8,9,14,12,12,7,15,14,19,39,12) > 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] 75 > (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] 7 7 7 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 59 34 15 65 68 5 19 [2,] 57 31 16 65 65 3 39 [3,] 62 36 17 55 57 7 12 [4,] 50 24 23 57 41 4 NA [5,] 40 22 24 57 21 8 NA [6,] 46 17 27 57 21 9 NA [7,] 39 8 31 65 17 14 NA [8,] 35 12 40 69 9 12 NA [9,] 31 5 47 70 11 12 NA [10,] 35 6 43 71 6 7 NA [11,] 33 5 60 71 -2 15 NA [12,] 47 8 64 73 0 14 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2 -3 1 0 -3 -2 20 [2,] 5 5 1 -10 -8 4 -27 [3,] -12 -12 6 2 -16 -3 NA [4,] -10 -2 1 0 -20 4 NA [5,] 6 -5 3 0 0 1 NA [6,] -7 -9 4 8 -4 5 NA [7,] -4 4 9 4 -8 -2 NA [8,] -4 -7 7 1 2 0 NA [9,] 4 1 -4 1 -5 -5 NA [10,] -2 -1 17 0 -8 8 NA [11,] 14 3 4 2 2 -1 NA [12,] -13 7 1 -5 5 5 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/19kys1363085812.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/2w4h31363085812.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/3cdbe1363085812.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/4jdg31363085812.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,] 5 3.0 7.0 4.0 8 9 8 9.0 5.0 6 -2 0.0 [2,] 17 23.5 14.5 23.0 21 17 14 12.0 11.0 6 5 8.0 [3,] 34 39.0 36.0 32.5 23 24 24 23.5 21.5 21 24 30.5 [4,] 62 61.0 56.0 50.0 40 46 39 40.0 47.0 43 60 64.0 [5,] 68 65.0 62.0 57.0 57 57 65 69.0 70.0 71 71 73.0 $n [1] 7 7 7 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.126726 16.6056 11.21687 15.08413 10.74439 5.294063 7.874193 5.439096 [2,] 60.873274 61.3944 60.78313 49.91587 35.25561 42.705937 40.125807 41.560904 [,9] [,10] [,11] [,12] [1,] -1.721163 -2.866195 -11.47678 -5.621809 [2,] 44.721163 44.866195 59.47678 66.621809 $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(5, 17, 34, 62, 68, 3, 23.5, 39, 61, 65, 7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yk841363085812.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.0 -27.0 -16.0 -20 0.0 -9 -8 -7.0 -5.0 -8.0 -1.0 -13 [2,] -2.5 -9.0 -12.0 -10 0.0 -7 -4 -4.0 -5.0 -2.0 2.0 -5 [3,] -2.0 1.0 -7.5 -1 0.5 0 1 0.5 -1.5 -0.5 2.5 3 [4,] 0.5 4.5 2.0 1 3.0 5 4 2.0 1.0 8.0 4.0 5 [5,] 1.0 5.0 6.0 4 6.0 8 9 7.0 4.0 17.0 4.0 7 $n [1] 7 7 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3.7915516 -7.061982 -16.530452 -8.095355 -1.435097 -7.740388 -4.160258 [2,] -0.2084484 9.061982 1.530452 6.095355 2.435097 7.740388 6.160258 [,8] [,9] [,10] [,11] [,12] [1,] -3.370194 -5.370194 -6.950323 1.209935 -3.450323 [2,] 4.370194 2.370194 5.950323 3.790065 9.450323 $out [1] 20 -5 14 $group [1] 1 5 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3, -2.5, -2, 0.5, 1, -27, -9, 1, 4.5, 5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64p1q1363085812.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,] 31.0 5.0 15 55.0 -2.0 3.0 12.0 [2,] 35.0 7.0 20 57.0 7.5 6.0 15.5 [3,] 43.0 14.5 29 65.0 19.0 8.5 19.0 [4,] 53.5 27.5 45 70.5 49.0 13.0 29.0 [5,] 62.0 36.0 64 73.0 68.0 15.0 39.0 $n [1] 12 12 12 12 12 12 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 34.56203 5.149812 17.59733 58.84256 0.07157142 5.307253 6.685119 [2,] 51.43797 23.850188 40.40267 71.15744 37.92842858 11.692747 31.314881 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(31, 35, 43, 53.5, 62, 5, 7, 14.5, 27.5, 36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73qwd1363085812.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,] 28.00000 21.00 23.625 [2,] 29.16667 23.25 26.500 [3,] 29.91667 24.00 30.000 [4,] 34.73810 33.25 35.375 [5,] 39.42857 39.00 42.250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 27.37550 19.43893 25.95205 [2,] 32.45783 28.56107 34.04795 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(28, 29.1666666666667, 29.9166666666667, 34.7380952380952, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19kys1363085812.ps tmp/19kys1363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/2w4h31363085812.ps tmp/2w4h31363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/3cdbe1363085812.ps tmp/3cdbe1363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/4jdg31363085812.ps tmp/4jdg31363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/5yk841363085812.ps tmp/5yk841363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/64p1q1363085812.ps tmp/64p1q1363085812.png",intern=TRUE)) character(0) > try(system("convert tmp/73qwd1363085812.ps tmp/73qwd1363085812.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.294 0.628 3.949