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(599,599,599,599,599,599,599,599,599,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,617.06,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,628.18,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,641.08,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,668.21,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,665.27,674.3,674.3,674.3,674.3,674.3,674.3,674.3,674.3,674.3,674.3,674.3,674.3,685.34,685.34,685.34,685.34,685.34,685.34,685.34,685.34,685.34,685.34,685.34,685.34,694.3,694.3,694.3) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [2,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [3,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [4,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [5,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [6,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [7,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [8,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [9,] 599.00 617.06 628.18 641.08 668.21 665.27 674.30 685.34 NA [10,] 617.06 628.18 641.08 668.21 665.27 674.30 685.34 694.30 NA [11,] 617.06 628.18 641.08 668.21 665.27 674.30 685.34 694.30 NA [12,] 617.06 628.18 641.08 668.21 665.27 674.30 685.34 694.30 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [2,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [3,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [4,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [5,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [6,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [8,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [9,] 18.06 11.12 12.9 27.13 -2.94 9.03 11.04 8.96 NA [10,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [11,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.00 0.0 0.00 0.00 0.00 0.00 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/1ercs1424801503.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/2ld8y1424801503.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/3ribl1424801503.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/477zz1424801503.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] [1,] 599.000 599.000 599.000 599.000 599.000 599.000 599.000 599.000 599.000 [2,] 622.620 622.620 622.620 622.620 622.620 622.620 622.620 622.620 622.620 [3,] 653.175 653.175 653.175 653.175 653.175 653.175 653.175 653.175 653.175 [4,] 671.255 671.255 671.255 671.255 671.255 671.255 671.255 671.255 671.255 [5,] 685.340 685.340 685.340 685.340 685.340 685.340 685.340 685.340 685.340 [,10] [,11] [,12] [1,] 617.06 617.06 617.06 [2,] 634.63 634.63 634.63 [3,] 666.74 666.74 666.74 [4,] 679.82 679.82 679.82 [5,] 694.30 694.30 694.30 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 626.0068 626.0068 626.0068 626.0068 626.0068 626.0068 626.0068 626.0068 [2,] 680.3432 680.3432 680.3432 680.3432 680.3432 680.3432 680.3432 680.3432 [,9] [,10] [,11] [,12] [1,] 626.0068 641.4962 641.4962 641.4962 [2,] 680.3432 691.9838 691.9838 691.9838 $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(599, 622.62, 653.175, 671.255, 685.34, 599, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kv0f1424801503.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,] 0 0 0 0 0 0 0 0 8.960 0 0 0 [2,] 0 0 0 0 0 0 0 0 8.995 0 0 0 [3,] 0 0 0 0 0 0 0 0 11.080 0 0 0 [4,] 0 0 0 0 0 0 0 0 15.480 0 0 0 [5,] 0 0 0 0 0 0 0 0 18.060 0 0 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0 0 0 0 0 0 0 0 7.457386 0 0 0 [2,] 0 0 0 0 0 0 0 0 14.702614 0 0 0 $out [1] 27.13 -2.94 $group [1] 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l71y1424801503.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] [1,] 599.00 617.06 628.18 641.080 665.27 665.270 674.30 685.34 NA [2,] 599.00 617.06 628.18 641.080 666.74 665.270 674.30 685.34 NA [3,] 599.00 617.06 628.18 641.080 668.21 665.270 674.30 685.34 NA [4,] 608.03 622.62 634.63 654.645 668.21 669.785 679.82 689.82 NA [5,] 617.06 628.18 641.08 668.210 668.21 674.300 685.34 694.30 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 594.8814 614.524 625.2381 634.8929 667.5395 663.2107 671.7823 683.2966 [2,] 603.1186 619.596 631.1219 647.2671 668.8805 667.3293 676.8177 687.3834 [,9] [1,] NA [2,] NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(599, 599, 599, 608.03, 617.06, 617.06, 617.06, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e4tg1424801503.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,] 647.3050 653.1750 647.5663 [2,] 647.3050 653.1750 647.5663 [3,] 647.3050 653.1750 647.5663 [4,] 653.2613 659.9575 652.5119 [5,] 659.2175 666.7400 657.4575 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 644.5883 650.0815 645.3105 [2,] 650.0217 656.2685 649.8220 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(647.305, 647.305, 647.305, 653.26125, 659.2175, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ercs1424801503.ps tmp/1ercs1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/2ld8y1424801503.ps tmp/2ld8y1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/3ribl1424801503.ps tmp/3ribl1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/477zz1424801503.ps tmp/477zz1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/5kv0f1424801503.ps tmp/5kv0f1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/6l71y1424801503.ps tmp/6l71y1424801503.png",intern=TRUE)) character(0) > try(system("convert tmp/7e4tg1424801503.ps tmp/7e4tg1424801503.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.646 0.402 3.070