R version 3.0.3 (2014-03-06) -- "Warm Puppy" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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,-2,-4,-6,-2,1,7,2,2,13,7,-1,1,0,0,5,3,6,7,-6,-8,-5,-14,-13,-15,-14,-10,-14,-18,-22,-24,-17,-16,-17,-22,-25,-18,-23,-20,-9,-4,0,3,14,13,12,16,7,2,1,7,10,3,2,12,14,11,13,17,14,7,16,5,5,15,9,4,-9,-14,-4,-19,-10,-22) > 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] 73 > (np <- floor(n / par1)) [1] 6 > 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] 7 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 1 -15 -18 2 7 -22 [2,] -2 0 -14 -23 1 16 NA [3,] -4 0 -10 -20 7 5 NA [4,] -6 5 -14 -9 10 5 NA [5,] -2 3 -18 -4 3 15 NA [6,] 1 6 -22 0 2 9 NA [7,] 7 7 -24 3 12 4 NA [8,] 2 -6 -17 14 14 -9 NA [9,] 2 -8 -16 13 11 -14 NA [10,] 13 -5 -17 12 13 -4 NA [11,] 7 -14 -22 16 17 -19 NA [12,] -1 -13 -25 7 14 -10 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2 -1 1 -5 -1 9 NA [2,] -2 0 4 3 6 -11 NA [3,] -2 5 -4 11 3 0 NA [4,] 4 -2 -4 5 -7 10 NA [5,] 3 3 -4 4 -1 -6 NA [6,] 6 1 -2 3 10 -5 NA [7,] -5 -13 7 11 2 -13 NA [8,] 0 -2 1 -1 -3 -5 NA [9,] 11 3 -1 -1 2 10 NA [10,] -6 -9 -5 4 4 -15 NA [11,] -8 1 -3 -9 -3 9 NA [12,] 2 -2 7 -5 -7 -12 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/1oguc1395068031.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/25awc1395068031.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/3etac1395068031.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/47kme1395068031.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,] -22.0 -23 -20 -14.0 -4.0 0.0 3.0 -17 -16 -17 -22.0 -25.0 [2,] -16.5 -14 -10 -9.0 -4.0 0.0 3.0 -9 -14 -5 -19.0 -13.0 [3,] 0.0 -1 -2 -0.5 0.5 1.5 5.5 -2 -3 4 -3.5 -5.5 [4,] 1.5 1 5 5.0 3.0 6.0 7.0 14 11 13 16.0 7.0 [5,] 7.0 16 7 10.0 3.0 9.0 12.0 14 13 13 17.0 14.0 $n [1] 7 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -10.74931 -10.675484 -11.675484 -9.530452 -4.015226 -2.370194 2.919871 [2,] 10.74931 8.675484 7.675484 8.530452 5.015226 5.370194 8.080129 [,8] [,9] [,10] [,11] [,12] [1,] -16.83574 -19.12581 -7.610581 -26.07613 -18.400646 [2,] 12.83574 13.12581 15.610581 19.07613 7.400646 $out [1] -18 15 -22 -24 $group [1] 5 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-22, -16.5, 0, 1.5, 7, -23, -14, -1, 1, 16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5lnp01395068031.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,] -5 -11.0 -4.0 -7 -6 -5 -13.0 -5.0 -1.0 -15.0 -9 -12.0 [2,] -2 -2.0 -2.0 -4 -4 -2 -13.0 -3.0 -1.0 -9.0 -8 -7.0 [3,] -1 1.5 1.5 1 1 2 -1.5 -1.5 2.5 -5.5 -3 -3.5 [4,] 1 4.0 5.0 5 3 6 7.0 0.0 10.0 4.0 1 2.0 [5,] 1 6.0 11.0 10 4 10 11.0 1.0 11.0 4.0 9 7.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.9350969 -2.370194 -3.015226 -4.805291 -3.515226 -3.160258 -14.40065 [2,] 0.9350969 5.370194 6.015226 6.805291 5.515226 7.160258 11.40065 [,8] [,9] [,10] [,11] [,12] [1,] -3.4350969 -4.595355 -13.88542 -8.805291 -9.305291 [2,] 0.4350969 9.595355 2.88542 2.805291 2.305291 $out [1] 9 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-5, -2, -1, 1, 1, -11, -2, 1.5, 4, 6, -4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ssdm1395068031.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] [1,] -6.0 -14 -25.0 -23.0 1.0 -19.0 -22 [2,] -2.0 -7 -22.0 -13.5 2.5 -9.5 -22 [3,] 0.5 0 -17.0 1.5 10.5 4.5 -22 [4,] 4.5 4 -14.5 12.5 13.5 8.0 -22 [5,] 13.0 7 -10.0 16.0 17.0 16.0 -22 $n [1] 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.464694 -5.017174 -20.4208 -10.35877 5.482826 -3.481867 -22 [2,] 3.464694 5.017174 -13.5792 13.35877 15.517174 12.481867 -22 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(-6, -2, 0.5, 4.5, 13, -14, -7, 0, 4, 7, -25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74k9a1395068031.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,] -6.4285714 -5.50 -7.500 [2,] -3.6666667 -2.50 -3.000 [3,] -1.7500000 -0.75 -1.750 [4,] -0.4166667 1.00 2.000 [5,] 2.0000000 5.50 5.125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -3.2323468 -2.3463735 -4.0305336 [2,] -0.2676532 0.8463735 0.5305336 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-6.42857142857143, -3.66666666666667, -1.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1oguc1395068031.ps tmp/1oguc1395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/25awc1395068031.ps tmp/25awc1395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/3etac1395068031.ps tmp/3etac1395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/47kme1395068031.ps tmp/47kme1395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/5lnp01395068031.ps tmp/5lnp01395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/6ssdm1395068031.ps tmp/6ssdm1395068031.png",intern=TRUE)) character(0) > try(system("convert tmp/74k9a1395068031.ps tmp/74k9a1395068031.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.882 1.012 5.926