R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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(100,99,99.3,99.5,100.7,102.9,101.2,99.5,99.5,99.5,99.4,99.5,99.7,99.8,99.8,100.1,100,100,100.1,100.1,100,99.9,99.9,99.8,100.4,102.2,103.1,103,102.9,102.8,103,103.5,103.6,103.2,103,103,106.1,104.8,105.3,106.3,107.9,106.1,106.8,108.7,110.8,111.8,111.3,111.7,110.8,110.3,110.5,110.5,112.5,113,113.5,112.8,109.5,111.5,111.5,111.2) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (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,] 100.0 99.7 100.4 106.1 110.8 NA [2,] 99.0 99.8 102.2 104.8 110.3 NA [3,] 99.3 99.8 103.1 105.3 110.5 NA [4,] 99.5 100.1 103.0 106.3 110.5 NA [5,] 100.7 100.0 102.9 107.9 112.5 NA [6,] 102.9 100.0 102.8 106.1 113.0 NA [7,] 101.2 100.1 103.0 106.8 113.5 NA [8,] 99.5 100.1 103.5 108.7 112.8 NA [9,] 99.5 100.0 103.6 110.8 109.5 NA [10,] 99.5 99.9 103.2 111.8 111.5 NA [11,] 99.4 99.9 103.0 111.3 111.5 NA [12,] 99.5 99.8 103.0 111.7 111.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.0 0.1 1.8 -1.3 -0.5 NA [2,] 0.3 0.0 0.9 0.5 0.2 NA [3,] 0.2 0.3 -0.1 1.0 0.0 NA [4,] 1.2 -0.1 -0.1 1.6 2.0 NA [5,] 2.2 0.0 -0.1 -1.8 0.5 NA [6,] -1.7 0.1 0.2 0.7 0.5 NA [7,] -1.7 0.0 0.5 1.9 -0.7 NA [8,] 0.0 -0.1 0.1 2.1 -3.3 NA [9,] 0.0 -0.1 -0.4 1.0 2.0 NA [10,] -0.1 0.0 -0.2 -0.5 0.0 NA [11,] 0.1 -0.1 0.0 0.4 -0.3 NA [12,] 0.2 0.6 3.1 -0.9 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/199m01457115322.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/25nki1457115322.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/3a07p1457115322.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/4rzrp1457115322.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,] 99.7 99.0 99.3 99.5 100.0 100.0 100.1 99.5 99.5 99.5 99.4 99.5 [2,] 100.0 99.8 99.8 100.1 100.7 102.8 101.2 100.1 100.0 99.9 99.9 99.8 [3,] 100.4 102.2 103.1 103.0 102.9 102.9 103.0 103.5 103.6 103.2 103.0 103.0 [4,] 106.1 104.8 105.3 106.3 107.9 106.1 106.8 108.7 109.5 111.5 111.3 111.2 [5,] 110.8 110.3 110.5 110.5 112.5 106.1 113.5 112.8 110.8 111.8 111.5 111.7 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.08976 98.66701 99.21371 98.6191 97.8125 100.5682 99.04305 [2,] 104.71024 105.73299 106.98629 107.3809 107.9875 105.2318 106.95695 [,8] [,9] [,10] [,11] [,12] [1,] 97.42326 96.88732 95.00347 94.94479 94.94479 [2,] 109.57674 110.31268 111.39653 111.05521 111.05521 $out [1] 113 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(99.7, 100, 100.4, 106.1, 110.8, 99, 99.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ncv91457115322.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,] -1.3 0.0 -0.1 -0.1 -0.1 0.1 -1.7 -0.1 -0.4 -0.5 -0.3 -0.90 [2,] -1.0 0.2 0.0 -0.1 -0.1 0.1 -0.7 -0.1 -0.1 -0.2 -0.1 -0.35 [3,] -0.5 0.3 0.2 1.2 0.0 0.2 0.0 0.0 0.0 -0.1 0.0 0.40 [4,] 0.1 0.5 0.3 1.6 0.5 0.5 0.5 0.1 1.0 0.0 0.1 1.85 [5,] 0.1 0.9 0.3 2.0 0.5 0.7 1.9 0.1 2.0 0.0 0.1 3.10 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.2772572 0.08802076 -0.01197924 -0.001215718 -0.4239585 -0.08263899 [2,] 0.2772572 0.51197924 0.41197924 2.401215718 0.4239585 0.48263899 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.847917 -0.1413195 -0.7772572 -0.2413195 -0.1413195 -1.338 [2,] 0.847917 0.1413195 0.7772572 0.0413195 0.1413195 2.138 $out [1] 1.8 1.0 2.2 -1.8 -1.7 2.1 -3.3 0.4 $group [1] 1 3 5 5 6 8 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.3, -1, -0.5, 0.0999999999999943, 0.0999999999999943, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63bfa1457115322.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,] 99.00 99.70 102.80 104.80 109.50 NA [2,] 99.45 99.80 102.85 106.10 110.50 NA [3,] 99.50 99.95 103.00 107.35 111.35 NA [4,] 100.35 100.05 103.15 111.05 112.65 NA [5,] 101.20 100.10 103.60 111.80 113.50 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 99.0895 99.83597 102.8632 105.0923 110.3694 NA [2,] 99.9105 100.06403 103.1368 109.6077 112.3306 NA $out [1] 102.9 100.4 102.2 $group [1] 1 3 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(99, 99.45, 99.5, 100.35, 101.2, 99.7, 99.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72xvi1457115322.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,] 103.22 102.90 102.300 [2,] 103.74 102.90 103.125 [3,] 104.86 103.00 104.350 [4,] 104.99 103.15 105.125 [5,] 105.18 103.50 105.700 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.2899 102.886 103.4378 [2,] 105.4301 103.114 105.2622 $out [1] 100.4 102.2 103.6 $group [1] 2 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(103.22, 103.74, 104.86, 104.99, 105.18, 102.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/199m01457115322.ps tmp/199m01457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/25nki1457115322.ps tmp/25nki1457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/3a07p1457115322.ps tmp/3a07p1457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/4rzrp1457115322.ps tmp/4rzrp1457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/5ncv91457115322.ps tmp/5ncv91457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/63bfa1457115322.ps tmp/63bfa1457115322.png",intern=TRUE)) character(0) > try(system("convert tmp/72xvi1457115322.ps tmp/72xvi1457115322.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.399 0.352 2.784