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(-23.50,5.90,8.40,7.80,4.80,3.50,8.70,6.80,6.00,3.60,8.70,8.90,8.10,7.00,7.90,8.00,7.50,6.30,7.60,8.40,6.80,8.80,8.70,8.70,7.40,2.80,4.80,-21.10,8.50,9.40,1.80,4.80,5.80,3.30,-9.00,-6.00,-0.90,-17.30,-9.20,-8.10,-20.90,-14.60,-13.90,-20.80,-16.10,-5.00,-7.20,-9.70,-1.40,0.20,2.60,-4.80,-6.20,-2.00,-0.80,-3.10,0.60,0.20,0.30,-0.10,4.30,-3.20,-1.30,1.50,2.50,-2.20,1.70,5.70,2.70,-4.80,-3.10,-0.50,-3.40,-4.70,-5.60,-1.70,-1.80,-5.40,-4.80,-2.80,-4.90,-6.80,-7.60,-6.60,-5.60,-1.40,0.10,-3.70,-5.60,-3.10,-3.80,-5.10,-4.10,-0.30,-0.30,-2.40) > 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,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2.5 11.1 -0.4 -7.5 -1.9 3.8 NA [10,] 5.1 -0.1 -12.3 -2.2 0.1 1.7 -0.8 0.0 NA [11,] 0.2 0.0 3.0 -2.5 -0.4 2.6 1.0 -2.1 NA [12,] -0.8 -1.3 5.1 8.3 4.4 -2.9 1.0 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/1rczz1430158888.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/2llml1430158888.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/3bc3c1430158888.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/4opss1430158888.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,] -5.60 -4.70 -9.20 -21.10 -20.90 -14.60 -13.90 -5.10 -16.10 -6.80 -9.0 [2,] -4.50 -3.95 -3.45 -6.45 -5.90 -4.25 -4.30 -4.10 -4.50 -4.90 -7.4 [3,] -1.15 -0.60 1.35 -2.70 0.35 -2.10 0.45 1.00 1.65 -0.05 -1.7 [4,] 5.85 4.35 6.35 4.65 6.15 4.90 4.70 6.25 5.90 3.45 4.5 [5,] 8.10 7.00 8.40 8.00 8.50 9.40 8.70 8.40 6.80 8.80 8.7 [,12] [1,] -9.70 [2,] -6.30 [3,] -1.45 [4,] 4.30 [5,] 8.90 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.931659 -5.236499 -4.124421 -8.900619 -6.381303 -7.211321 -4.577529 [2,] 4.631659 4.036499 6.824421 3.500619 7.081303 3.011321 5.477529 [,8] [,9] [,10] [,11] [,12] [1,] -4.781659 -4.159589 -4.71443 -8.347511 -7.371312 [2,] 6.781659 7.459589 4.61443 4.947511 4.471312 $out [1] -23.5 -17.3 -20.8 $group [1] 1 2 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-5.6, -4.5, -1.15, 5.85, 8.1, -4.7, -3.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vftb1430158888.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,] -16.40 0.90 -7.40 -3.00 -4.70 -0.70 -6.90 -3.00 -7.50 -2.20 -2.50 -2.90 [2,] -6.05 1.20 -5.60 -2.45 -2.45 -0.05 -2.10 -1.85 -2.45 -1.50 -1.25 -1.05 [3,] -1.20 1.95 -0.25 -0.95 -0.15 0.95 -0.25 0.10 -1.15 -0.05 0.10 1.00 [4,] 2.90 2.45 1.95 0.45 3.35 2.60 2.50 2.35 2.90 0.90 1.80 4.75 [5,] 4.20 2.50 3.90 1.00 6.30 5.20 4.00 4.70 3.80 1.70 3.00 8.30 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.199598 1.251732 -4.467538 -2.5699816 -3.389963 -0.530328 -2.819626 [2,] 3.799598 2.648268 3.967538 0.6699816 3.089963 2.430328 2.319626 [,8] [,9] [,10] [,11] [,12] [1,] -2.24618 -4.138587 -1.390674 -1.603774 -2.463666 [2,] 2.44618 1.838587 1.290674 1.803774 4.463666 $out [1] 29.4 8.1 -0.9 -25.9 29.6 -12.8 -7.6 11.1 5.1 -12.3 $group [1] 1 2 2 3 4 4 6 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-16.4, -6.05, -1.2, 2.9, 4.2, 0.9, 1.2, 1.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m5b01430158888.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,] 3.50 6.30 -9.00 -20.90 -6.20 -4.80 -7.60 -5.60 NA [2,] 4.20 7.25 -2.10 -16.70 -2.55 -2.65 -6.10 -4.60 NA [3,] 6.40 7.95 4.05 -11.80 -0.45 0.50 -4.85 -3.40 NA [4,] 8.55 8.55 6.60 -7.65 0.25 2.60 -3.10 -0.85 NA [5,] 8.90 8.80 9.40 -0.90 2.60 5.70 -1.70 0.10 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 4.415936 7.357061 0.0818716 -15.927766 -1.7270988 -1.89456 -6.21832 [2,] 8.384064 8.542939 8.0181284 -7.672234 0.8270988 2.89456 -3.48168 [,8] [,9] [1,] -5.1104 NA [2,] -1.6896 NA $out [1] -23.5 -21.1 $group [1] 1 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(3.5, 4.2, 6.4, 8.55, 8.9, 6.3, 7.25, 7.95, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7q5341430158888.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,] -2.76250 -2.700 -2.45000 [2,] -1.36875 -1.575 -1.00625 [3,] -0.98750 -0.325 -0.06875 [4,] -0.41875 0.725 0.66875 [5,] 0.96250 1.650 1.60000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -1.4208014 -1.3740454 -0.8327287 [2,] -0.5541986 0.7240454 0.6952287 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-2.7625, -1.36875, -0.9875, -0.41875, 0.9625, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rczz1430158888.ps tmp/1rczz1430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/2llml1430158888.ps tmp/2llml1430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/3bc3c1430158888.ps tmp/3bc3c1430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/4opss1430158888.ps tmp/4opss1430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/5vftb1430158888.ps tmp/5vftb1430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/6m5b01430158888.ps tmp/6m5b01430158888.png",intern=TRUE)) character(0) > try(system("convert tmp/7q5341430158888.ps tmp/7q5341430158888.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.429 8.285