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.5,-21.1,-20.9,-20.8,-17.3,-16.1,-14.6,-13.9,-9.7,-9.2,-9,-8.1,-7.6,-7.2,-6.8,-6.6,-6.2,-6,-5.6,-5.6,-5.6,-5.4,-5.1,-5,-4.9,-4.8,-4.8,-4.8,-4.7,-4.1,-3.8,-3.7,-3.4,-3.2,-3.1,-3.1,-3.1,-2.8,-2.4,-2.2,-2,-1.8,-1.7,-1.4,-1.4,-1.3,-0.9,-0.8,-0.5,-0.3,-0.3,-0.1,0.1,0.2,0.2,0.3,0.6,1.5,1.7,1.8,2.5,2.6,2.7,2.8,3.3,3.5,3.6,4.3,4.8,4.8,4.8,5.7,5.8,5.9,6,6.3,6.8,6.8,7,7.4,7.5,7.6,7.8,7.9,8,8.1,8.4,8.4,8.5,8.7,8.7,8.7,8.7,8.8,8.9,9.4) > 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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0.0 0.2 0.1 NA [11,] 0.9 0.1 0.0 0.1 0.1 0.9 0.1 0.5 NA [12,] 0.5 0.1 0.0 0.3 0.7 0.1 0.1 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/1rjoy1425298366.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/22yfh1425298366.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/3976q1425298366.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/46eii1425298366.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,] -7.60 -21.10 -20.90 -20.80 -17.30 -16.10 -14.60 -13.90 -9.70 -9.2 -9.0 [2,] -6.25 -6.00 -5.80 -5.70 -5.45 -5.05 -4.70 -4.65 -4.50 -4.3 -4.1 [3,] -1.80 -1.55 -1.35 -1.15 -0.95 -0.80 -0.75 -0.55 -0.40 0.1 0.4 [4,] 4.15 4.25 4.35 4.55 5.05 5.15 5.30 5.85 6.15 6.2 6.3 [5,] 8.00 8.10 8.40 8.40 8.50 8.70 8.70 8.70 8.70 8.8 8.9 [,12] [1,] -8.10 [2,] -4.05 [3,] 0.50 [4,] 6.80 [5,] 9.40 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.609589 -7.275797 -7.019936 -6.875797 -6.815451 -6.497866 -6.336144 [2,] 4.009589 4.175797 4.319936 4.575797 4.915451 4.897866 4.836144 [,8] [,9] [,10] [,11] [,12] [1,] -6.415451 -6.349243 -5.765451 -5.409589 -5.560966 [2,] 5.315451 5.549243 5.965451 6.209589 6.560966 $out [1] -23.5 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-7.6, -6.25, -1.8, 4.15, 8, -21.1, -6, -1.55, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56di51425298366.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.10 0.00 0.00 0.10 0.00 0.00 0.00 0.0 0.00 0.00 0.0 0.0 [2,] 0.10 0.05 0.05 0.15 0.15 0.05 0.05 0.0 0.10 0.10 0.1 0.1 [3,] 0.15 0.15 0.15 0.30 0.20 0.15 0.20 0.2 0.15 0.20 0.1 0.1 [4,] 0.35 0.35 0.20 0.50 0.40 0.35 0.55 0.4 0.35 0.25 0.7 0.4 [5,] 0.40 0.40 0.30 0.50 0.60 0.40 0.70 0.5 0.50 0.40 0.9 0.7 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01034641 -0.01758431 0.06620785 0.104485 0.06034641 -0.01758431 [2,] 0.28965359 0.31758431 0.23379215 0.495515 0.33965359 0.31758431 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.07930718 -0.02344574 0.01034641 0.1162078 -0.2351686 -0.07915516 [2,] 0.47930718 0.42344574 0.28965359 0.2837922 0.4351686 0.27915516 $out [1] 2.4 3.5 1.2 1.5 4.2 0.9 $group [1] 1 4 5 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0999999999999996, 0.1, 0.15, 0.35, 0.399999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6b0hv1425298366.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,] -23.50 -7.6 -4.90 -3.10 -0.50 2.50 5.80 8.00 NA [2,] -20.85 -6.7 -4.80 -2.30 -0.20 2.75 6.15 8.40 NA [3,] -15.35 -5.8 -3.95 -1.75 0.20 3.55 6.90 8.70 NA [4,] -9.45 -5.5 -3.30 -1.35 1.05 4.80 7.55 8.75 NA [5,] -8.10 -5.0 -3.10 -0.80 1.80 5.70 7.90 8.90 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -20.54962 -6.347328 -4.63416 -2.183301 -0.3701334 2.614981 6.261451 [2,] -10.15038 -5.252672 -3.26584 -1.316699 0.7701334 4.485019 7.538549 [,8] [,9] [1,] 8.540363 NA [2,] 8.859637 NA $out [1] 9.4 $group [1] 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(-23.5, -20.85, -15.35, -9.45, -8.1, -7.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7f39o1425298366.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.91250 -1.800 -1.12500 [2,] -2.19375 -1.250 -0.83750 [3,] -0.93750 -0.775 -0.01250 [4,] 0.31875 -0.150 0.81875 [5,] 0.97500 0.500 1.33750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -2.0834681 -1.2767174 -0.7679267 [2,] 0.2084681 -0.2732826 0.7429267 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-2.9125, -2.19375, -0.9375, 0.31875, 0.975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rjoy1425298366.ps tmp/1rjoy1425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/22yfh1425298366.ps tmp/22yfh1425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/3976q1425298366.ps tmp/3976q1425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/46eii1425298366.ps tmp/46eii1425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/56di51425298366.ps tmp/56di51425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/6b0hv1425298366.ps tmp/6b0hv1425298366.png",intern=TRUE)) character(0) > try(system("convert tmp/7f39o1425298366.ps tmp/7f39o1425298366.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.575 0.389 3.004