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(59400,57200,60500,48400,62700,61600,66000,68200,75900,66000,62700,78100,66000,49500,58300,44000,61600,50600,67100,60500,63800,71500,70400,83600,60500,50600,56100,40700,58300,45100,63800,60500,53900,77000,69300,79200,59400,55000,49500,40700,53900,48400,66000,63800,55000,73700,68200,88000,70400,42900,42900,42900,50600,50600,68200,62700,56100,70400,64900,93500,73700,42900,45100,37400,51700,59400,74800,73700,59400,69300,61600,88000,67100,53900,48400,36300,53900,64900,75900,71500,52800,75900,59400,91300,75900,55000,50600,34100,53900,51700,78100,78100,59400,77000,57200,89100,75900,56100,42900,29700,58300,56100,73700,84700,62700,70400,52800,91300) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 59400 66000 60500 59400 70400 73700 67100 75900 75900 NA [2,] 57200 49500 50600 55000 42900 42900 53900 55000 56100 NA [3,] 60500 58300 56100 49500 42900 45100 48400 50600 42900 NA [4,] 48400 44000 40700 40700 42900 37400 36300 34100 29700 NA [5,] 62700 61600 58300 53900 50600 51700 53900 53900 58300 NA [6,] 61600 50600 45100 48400 50600 59400 64900 51700 56100 NA [7,] 66000 67100 63800 66000 68200 74800 75900 78100 73700 NA [8,] 68200 60500 60500 63800 62700 73700 71500 78100 84700 NA [9,] 75900 63800 53900 55000 56100 59400 52800 59400 62700 NA [10,] 66000 71500 77000 73700 70400 69300 75900 77000 70400 NA [11,] 62700 70400 69300 68200 64900 61600 59400 57200 52800 NA [12,] 78100 83600 79200 88000 93500 88000 91300 89100 91300 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -2200 -16500 -9900 -4400 -27500 -30800 -13200 -20900 -19800 NA [2,] 3300 8800 5500 -5500 0 2200 -5500 -4400 -13200 NA [3,] -12100 -14300 -15400 -8800 0 -7700 -12100 -16500 -13200 NA [4,] 14300 17600 17600 13200 7700 14300 17600 19800 28600 NA [5,] -1100 -11000 -13200 -5500 0 7700 11000 -2200 -2200 NA [6,] 4400 16500 18700 17600 17600 15400 11000 26400 17600 NA [7,] 2200 -6600 -3300 -2200 -5500 -1100 -4400 0 11000 NA [8,] 7700 3300 -6600 -8800 -6600 -14300 -18700 -18700 -22000 NA [9,] -9900 7700 23100 18700 14300 9900 23100 17600 7700 NA [10,] -3300 -1100 -7700 -5500 -5500 -7700 -16500 -19800 -17600 NA [11,] 15400 13200 9900 19800 28600 26400 31900 31900 38500 NA [12,] -12100 -23100 -19800 -17600 -19800 -20900 -15400 -13200 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/1reel1439044387.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/27n1j1439044387.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/306ot1439044387.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/4arsl1439044387.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,] 59400 42900 42900 29700 50600 45100 63800 60500 52800 66000 52800 78100 [2,] 60500 49500 45100 36300 53900 50600 66000 62700 55000 70400 59400 83600 [3,] 67100 53900 49500 40700 53900 51700 68200 68200 59400 71500 62700 88000 [4,] 73700 55000 56100 42900 58300 59400 74800 73700 62700 75900 68200 91300 [5,] 75900 57200 60500 48400 62700 64900 78100 84700 63800 77000 70400 93500 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 60148 51003.33 43706.67 37224 51582.67 47065.33 63565.33 62406.67 55344.67 [2,] 74052 56796.67 55293.33 44176 56217.33 56334.67 72834.67 73993.33 63455.33 [,10] [,11] [,12] [1,] 68603.33 58065.33 83944.67 [2,] 74396.67 67334.67 92055.33 $out [1] 75900 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(59400, 60500, 67100, 73700, 75900, 42900, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59b3x1439044387.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] [1,] -30800 -13200 -16500 13200 -13200 15400 -6600 -22000 7700 -19800 9900 [2,] -20900 -5500 -14300 14300 -5500 15400 -4400 -18700 7700 -16500 15400 [3,] -16500 0 -12100 17600 -2200 17600 -2200 -8800 14300 -7700 26400 [4,] -9900 3300 -8800 17600 0 17600 0 -6600 18700 -5500 31900 [5,] -2200 8800 -7700 19800 7700 18700 2200 7700 23100 -1100 38500 [,12] [1,] -23100 [2,] -20350 [3,] -18700 [4,] -14300 [5,] -12100 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -22293.33 -4634.667 -14996.667 15862 -5096.6667 16441.33 -4517.3333 [2,] -10706.67 4634.667 -9203.333 19338 696.6667 18758.67 117.3333 [,8] [,9] [,10] [,11] [,12] [1,] -15172.667 8506.667 -13493.333 17710 -22079.62 [2,] -2427.333 20093.333 -1906.667 35090 -15320.38 $out [1] 0 7700 28600 11000 4400 11000 26400 11000 -9900 $group [1] 3 4 4 5 6 6 6 7 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-30800, -20900, -16500, -9900, -2200, -13200, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w9g91439044387.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] [,10] [1,] 57200 44000 40700 40700 42900 37400 36300 34100 29700 NA [2,] 59950 54450 52250 51700 46750 48400 53350 52800 54450 NA [3,] 62700 62700 59400 57200 59400 60500 62150 58300 60500 NA [4,] 67100 68750 66550 67100 69300 73700 73700 77550 74800 NA [5,] 75900 83600 79200 88000 93500 88000 91300 89100 91300 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 59438.84 56177.67 52877.67 50175.96 49114.79 48960.5 52868.23 47011.36 [2,] 65961.16 69222.33 65922.33 64224.04 69685.21 72039.5 71431.77 69588.64 [,9] [,10] [1,] 51218.23 NA [2,] 69781.77 NA $out [1] 48400 78100 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(57200, 59950, 62700, 67100, 75900, 44000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7v2351439044387.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,] 39355.56 40700 39600 [2,] 52861.11 52800 53625 [3,] 61416.67 61050 61325 [4,] 69850.00 68200 69300 [5,] 86900.00 88000 87450 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 53667.92 54025.96 54175.53 [2,] 69165.41 68074.04 68474.47 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1reel1439044387.ps tmp/1reel1439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/27n1j1439044387.ps tmp/27n1j1439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/306ot1439044387.ps tmp/306ot1439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/4arsl1439044387.ps tmp/4arsl1439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/59b3x1439044387.ps tmp/59b3x1439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/6w9g91439044387.ps tmp/6w9g91439044387.png",intern=TRUE)) character(0) > try(system("convert tmp/7v2351439044387.ps tmp/7v2351439044387.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.482 0.495 3.005