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(0.53,0.53,0.53,0.54,0.53,0.54,0.54,0.54,0.55,0.54,0.54,0.55,0.55,0.55,0.55,0.54,0.54,0.54,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.56,0.56,0.56,0.56,0.56,0.56,0.56,0.57,0.56,0.57,0.57,0.58,0.57,0.57,0.58,0.57,0.58,0.58,0.57,0.57,0.58,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.56,0.56,0.57,0.57,0.56,0.57,0.58,0.58,0.58,0.57,0.57,0.57,0.58,0.57,0.57,0.57,0.57,0.57,0.58,0.58,0.58,0.58,0.58,0.59,0.6,0.6,0.59,0.6,0.6,0.6,0.6,0.61,0.6,0.6) > 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,] 0.53 0.55 0.55 0.56 0.57 0.57 0.57 0.58 NA [2,] 0.53 0.55 0.55 0.57 0.57 0.57 0.57 0.59 NA [3,] 0.53 0.55 0.55 0.56 0.58 0.56 0.58 0.60 NA [4,] 0.54 0.54 0.55 0.57 0.57 0.56 0.57 0.60 NA [5,] 0.53 0.54 0.55 0.57 0.57 0.57 0.57 0.59 NA [6,] 0.54 0.54 0.55 0.58 0.57 0.57 0.57 0.60 NA [7,] 0.54 0.55 0.56 0.57 0.57 0.56 0.57 0.60 NA [8,] 0.54 0.55 0.56 0.57 0.57 0.57 0.57 0.60 NA [9,] 0.55 0.55 0.56 0.58 0.57 0.58 0.58 0.60 NA [10,] 0.54 0.55 0.56 0.57 0.57 0.58 0.58 0.61 NA [11,] 0.54 0.55 0.56 0.58 0.57 0.58 0.58 0.60 NA [12,] 0.55 0.55 0.56 0.58 0.57 0.57 0.58 0.60 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.00 0.00 0.00 0.01 0.00 0.00 0.00 0.01 NA [2,] 0.00 0.00 0.00 -0.01 0.01 -0.01 0.01 0.01 NA [3,] 0.01 -0.01 0.00 0.01 -0.01 0.00 -0.01 0.00 NA [4,] -0.01 0.00 0.00 0.00 0.00 0.01 0.00 -0.01 NA [5,] 0.01 0.00 0.00 0.01 0.00 0.00 0.00 0.01 NA [6,] 0.00 0.01 0.01 -0.01 0.00 -0.01 0.00 0.00 NA [7,] 0.00 0.00 0.00 0.00 0.00 0.01 0.00 0.00 NA [8,] 0.01 0.00 0.00 0.01 0.00 0.01 0.01 0.00 NA [9,] -0.01 0.00 0.00 -0.01 0.00 0.00 0.00 0.01 NA [10,] 0.00 0.00 0.00 0.01 0.00 0.00 0.00 -0.01 NA [11,] 0.01 0.00 0.00 0.00 0.00 -0.01 0.00 0.00 NA [12,] 0.00 0.00 0.00 -0.01 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/128061413207972.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/283hq1413207972.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/3enc31413207972.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/4mkjy1413207972.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,] 0.530 0.53 0.53 0.540 0.530 0.540 0.540 0.540 0.550 0.540 0.540 0.550 [2,] 0.550 0.55 0.55 0.545 0.545 0.545 0.555 0.555 0.555 0.555 0.555 0.555 [3,] 0.565 0.57 0.56 0.565 0.570 0.570 0.565 0.570 0.575 0.570 0.575 0.570 [4,] 0.570 0.57 0.58 0.570 0.570 0.575 0.570 0.570 0.580 0.580 0.580 0.580 [5,] 0.580 0.59 0.60 0.600 0.590 0.600 0.570 0.570 0.600 0.610 0.600 0.600 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.5538277 0.5588277 0.5432416 0.5510346 0.5560346 0.5532416 0.5566208 [2,] 0.5761723 0.5811723 0.5767584 0.5789654 0.5839654 0.5867584 0.5733792 [,8] [,9] [,10] [,11] [,12] [1,] 0.5616208 0.5610346 0.5560346 0.5610346 0.5560346 [2,] 0.5783792 0.5889654 0.5839654 0.5889654 0.5839654 $out [1] 0.6 0.6 $group [1] 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.53, 0.55, 0.565, 0.57, 0.58, 0.53, 0.55, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5554o1413207972.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.000 -0.010 -0.010 -0.010 0.00 -0.010 0 0.000 -0.010 0 0 0 [2,] 0.000 -0.005 -0.010 -0.005 0.00 -0.005 0 0.000 -0.005 0 0 0 [3,] 0.000 0.000 0.000 0.000 0.00 0.000 0 0.005 0.000 0 0 0 [4,] 0.005 0.010 0.005 0.000 0.01 0.005 0 0.010 0.000 0 0 0 [5,] 0.010 0.010 0.010 0.000 0.01 0.010 0 0.010 0.000 0 0 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [1,] -0.002793072 -0.008379215 -0.008379215 -0.002793072 -0.005586144 [2,] 0.002793072 0.008379215 0.008379215 0.002793072 0.005586144 [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.005586144 0 -0.0005861436 -0.002793072 0 0 0 [2,] 0.005586144 0 0.0105861436 0.002793072 0 0 0 $out [1] 0.01 0.01 0.01 0.01 -0.01 0.01 -0.01 -0.01 $group [1] 4 7 9 10 10 11 11 12 $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.00499999999999995, 0.01, -0.0099999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61j5g1413207972.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,] 0.53 0.540 0.550 0.56 0.57 0.560 0.57 0.590 NA [2,] 0.53 0.545 0.550 0.57 0.57 0.565 0.57 0.595 NA [3,] 0.54 0.550 0.555 0.57 0.57 0.570 0.57 0.600 NA [4,] 0.54 0.550 0.560 0.58 0.57 0.575 0.58 0.600 NA [5,] 0.55 0.550 0.560 0.58 0.57 0.580 0.58 0.600 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.5354389 0.5477195 0.5504389 0.5654389 0.57 0.5654389 0.5654389 0.5977195 [2,] 0.5445611 0.5522805 0.5595611 0.5745611 0.57 0.5745611 0.5745611 0.6022805 [,9] [1,] NA [2,] NA $out [1] 0.58 0.58 0.61 $group [1] 5 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(0.53, 0.53, 0.54, 0.54, 0.55, 0.54, 0.545, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hlig1413207972.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,] 0.56000 0.560 0.55875 [2,] 0.56250 0.565 0.56000 [3,] 0.56500 0.570 0.56375 [4,] 0.57000 0.570 0.56875 [5,] 0.57125 0.575 0.56875 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 0.5615792 0.5677195 0.5597591 [2,] 0.5684208 0.5722805 0.5677409 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(0.56, 0.5625, 0.565, 0.57, 0.57125, 0.56, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/128061413207972.ps tmp/128061413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/283hq1413207972.ps tmp/283hq1413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/3enc31413207972.ps tmp/3enc31413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/4mkjy1413207972.ps tmp/4mkjy1413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/5554o1413207972.ps tmp/5554o1413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/61j5g1413207972.ps tmp/61j5g1413207972.png",intern=TRUE)) character(0) > try(system("convert tmp/7hlig1413207972.ps tmp/7hlig1413207972.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.445 0.462 2.946