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(-65,-75,-77,-75,-71,-71,-72,-64,-63,-68,-64,-52,-47,-52,-47,-36,-33,-44,-32,-23,-26,-24,-17,-29,-14,-12,-13,-15,-17,-22,-22,-39,-56,-66,-66,-71,-69,-71,-72,-67,-72,-77,-64,-64,-57,-63,-69,-76,-70,-78,-78,-76,-69,-73,-73,-62,-63,-61,-46,-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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -65 -47 -14 -69 -70 NA [2,] -75 -52 -12 -71 -78 NA [3,] -77 -47 -13 -72 -78 NA [4,] -75 -36 -15 -67 -76 NA [5,] -71 -33 -17 -72 -69 NA [6,] -71 -44 -22 -77 -73 NA [7,] -72 -32 -22 -64 -73 NA [8,] -64 -23 -39 -64 -62 NA [9,] -63 -26 -56 -57 -63 NA [10,] -68 -24 -66 -63 -61 NA [11,] -64 -17 -66 -69 -46 NA [12,] -52 -29 -71 -76 -40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -10 -5 2 -2 -8 NA [2,] -2 5 -1 -1 0 NA [3,] 2 11 -2 5 2 NA [4,] 4 3 -2 -5 7 NA [5,] 0 -11 -5 -5 -4 NA [6,] -1 12 0 13 0 NA [7,] 8 9 -17 0 11 NA [8,] 1 -3 -17 7 -1 NA [9,] -5 2 -10 -6 2 NA [10,] 4 7 0 -6 15 NA [11,] 12 -12 -5 -7 6 NA [12,] 5 15 2 6 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/11i951395846649.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/2xxrt1395846649.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/335k61395846649.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/4u6371395846649.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,] -70 -78 -78 -76 -72 -77 -73 -64 -63 -68 -69 -76 [2,] -69 -75 -77 -75 -71 -73 -72 -64 -63 -66 -66 -71 [3,] -65 -71 -72 -67 -69 -71 -64 -62 -57 -63 -64 -52 [4,] -47 -52 -47 -36 -33 -44 -32 -39 -56 -61 -46 -40 [5,] -14 -52 -13 -15 -17 -22 -22 -23 -56 -61 -17 -29 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -80.54514 -87.25174 -93.19792 -94.5573 -95.8507 -91.49133 -92.2639 [2,] -49.45486 -54.74826 -50.80208 -39.4427 -42.1493 -50.50867 -35.7361 [,8] [,9] [,10] [,11] [,12] [1,] -79.66494 -61.94618 -66.53299 -78.13195 -73.90452 [2,] -44.33506 -52.05382 -59.46701 -49.86805 -30.09548 $out [1] -12 -26 -24 $group [1] 2 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-70, -69, -65, -47, -14, -78, -75, -71, -52, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jgku1395846649.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,] -10 -2 -2 -5 -5 -1 0 -3 -10 -6 -12 2.0 [2,] -8 -1 2 -2 -5 0 0 -3 -6 0 -7 3.5 [3,] -5 -1 2 3 -5 0 8 -1 -5 4 -5 5.5 [4,] -2 0 5 4 -4 12 9 1 2 7 6 10.5 [5,] 2 0 5 7 -4 13 11 7 2 15 12 15.0 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -9.2395849 -1.7065975 -0.1197924 -1.239585 -5.706597 -8.47917 1.640623 [2,] -0.7604151 -0.2934025 4.1197924 7.239585 -4.293403 8.47917 14.359377 [,8] [,9] [,10] [,11] [,12] [1,] -3.82639 -10.6527798 -0.9461824 -14.185767 -0.03 [2,] 1.82639 0.6527798 8.9461824 4.185767 11.03 $out [1] 5 11 0 -11 -17 -17 $group [1] 2 3 5 5 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-10, -8, -5, -2, 2, -2, -1, -1, 0, 0, -2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gjom1395846649.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] [1,] -77.0 -52.0 -71.0 -77 -78.0 NA [2,] -73.5 -45.5 -61.0 -72 -74.5 NA [3,] -69.5 -32.5 -22.0 -69 -69.5 NA [4,] -64.0 -25.0 -14.5 -64 -61.5 NA [5,] -52.0 -17.0 -12.0 -57 -46.0 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -73.83301 -41.85019 -43.2089621 -72.64885 -75.42939 NA [2,] -65.16699 -23.14981 -0.7910379 -65.35115 -63.57061 NA $out [1] -40 $group [1] 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(-77, -73.5, -69.5, -64, -52, -52, -45.5, -32.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74kmw1395846649.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,] -57.6 -72.0 -63.50 [2,] -56.9 -70.0 -60.75 [3,] -53.3 -64.5 -57.00 [4,] -52.5 -62.5 -53.75 [5,] -50.4 -52.0 -51.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] -55.30687 -67.9208 -60.19275 [2,] -51.29313 -61.0792 -53.80725 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(-57.6, -56.9, -53.3, -52.5, -50.4, -72, -70, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/11i951395846649.ps tmp/11i951395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/2xxrt1395846649.ps tmp/2xxrt1395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/335k61395846649.ps tmp/335k61395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/4u6371395846649.ps tmp/4u6371395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/5jgku1395846649.ps tmp/5jgku1395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/6gjom1395846649.ps tmp/6gjom1395846649.png",intern=TRUE)) character(0) > try(system("convert tmp/74kmw1395846649.ps tmp/74kmw1395846649.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.949 1.155 7.127