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(96.4,96.9,98.1,99.2,100,100.3,100.3,100.8,101.3,101.4,101.9,103.4,105.6,107.5,109,110.5,109.8,109.6,109.6,108.8,109.4,109.1,109,109.2,110.5,112.2,113.2,113.6,113.2,112.2,112.2,113.2,113.8,113.8,113.7,113.9,114,114.3,114.3,112.8,112.3,112.2,112.6,111.9,111.7,111,110.8,111.1,110.5,110.5,109.8,109,109,109.4,108.8,108.4,108.3,108.2,106.8,103.6) > 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,] 96.4 105.6 110.5 114.0 110.5 NA [2,] 96.9 107.5 112.2 114.3 110.5 NA [3,] 98.1 109.0 113.2 114.3 109.8 NA [4,] 99.2 110.5 113.6 112.8 109.0 NA [5,] 100.0 109.8 113.2 112.3 109.0 NA [6,] 100.3 109.6 112.2 112.2 109.4 NA [7,] 100.3 109.6 112.2 112.6 108.8 NA [8,] 100.8 108.8 113.2 111.9 108.4 NA [9,] 101.3 109.4 113.8 111.7 108.3 NA [10,] 101.4 109.1 113.8 111.0 108.2 NA [11,] 101.9 109.0 113.7 110.8 106.8 NA [12,] 103.4 109.2 113.9 111.1 103.6 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.5 1.9 1.7 0.3 0.0 NA [2,] 1.2 1.5 1.0 0.0 -0.7 NA [3,] 1.1 1.5 0.4 -1.5 -0.8 NA [4,] 0.8 -0.7 -0.4 -0.5 0.0 NA [5,] 0.3 -0.2 -1.0 -0.1 0.4 NA [6,] 0.0 0.0 0.0 0.4 -0.6 NA [7,] 0.5 -0.8 1.0 -0.7 -0.4 NA [8,] 0.5 0.6 0.6 -0.2 -0.1 NA [9,] 0.1 -0.3 0.0 -0.7 -0.1 NA [10,] 0.5 -0.1 -0.1 -0.2 -1.4 NA [11,] 1.5 0.2 0.2 0.3 -3.2 NA [12,] 2.2 1.3 0.1 -0.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/1cdr01457983996.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/2idhf1457983996.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/3e3xq1457983996.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/477ct1457983996.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,] 105.6 107.5 109.0 109.0 109.0 109.4 108.8 108.4 108.3 108.2 101.9 103.4 [2,] 105.6 107.5 109.0 109.0 109.0 109.4 108.8 108.4 108.3 108.2 106.8 103.6 [3,] 110.5 110.5 109.8 110.5 109.8 109.6 109.6 108.8 109.4 109.1 109.0 109.2 [4,] 110.5 112.2 113.2 112.8 112.3 112.2 112.2 111.9 111.7 111.0 110.8 111.1 [5,] 114.0 114.3 114.3 113.6 113.2 112.2 112.6 113.2 113.8 113.8 113.7 113.9 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.0377 107.179 106.8323 107.8149 107.4682 107.6215 107.1976 106.3269 [2,] 113.9623 113.821 112.7677 113.1851 112.1318 111.5785 112.0024 111.2731 [,9] [,10] [,11] [,12] [1,] 106.9976 107.1215 106.1736 103.9005 [2,] 111.8024 111.0785 111.8264 114.4995 $out [1] 96.4 96.9 98.1 99.2 100.0 100.3 100.3 100.8 101.3 101.4 $group [1] 1 2 3 4 5 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(105.6, 105.6, 110.5, 110.5, 114, 107.5, 107.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hx2d1457983996.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.0 -0.7 -1.5 -0.7 -0.2 0 -0.8 -0.2 -0.7 -0.2 0.2 -0.60 [2,] 0.3 0.0 -0.8 -0.5 -0.2 0 -0.7 -0.1 -0.3 -0.2 0.2 -0.25 [3,] 0.5 1.0 0.4 -0.4 -0.1 0 -0.4 0.5 -0.1 -0.1 0.2 0.70 [4,] 1.7 1.2 1.1 0.0 0.3 0 0.5 0.6 0.0 -0.1 0.3 1.75 [5,] 1.9 1.5 1.5 0.0 0.4 0 1.0 0.6 0.1 -0.1 0.3 2.20 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.4892365 0.152083 -0.9425352 -0.75329874 -0.4532987 0 -1.247917 [2,] 1.4892365 1.847917 1.7425352 -0.04670126 0.2532987 0 0.447917 [,8] [,9] [,10] [,11] [,12] [1,] 0.005381763 -0.3119792 -0.17065975 0.1293403 -0.88 [2,] 0.994618237 0.1119792 -0.02934025 0.2706597 2.28 $out [1] 0.8 -1.0 0.4 -0.6 0.5 -1.4 1.5 -3.2 $group [1] 4 5 6 6 10 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.299999999999997, 0.5, 1.7, 1.90000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6pali1457983996.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,] 96.40 108.80 110.50 110.80 106.80 NA [2,] 98.65 108.90 112.20 111.40 108.25 NA [3,] 100.30 109.15 113.20 112.25 108.90 NA [4,] 101.35 109.60 113.75 113.40 109.60 NA [5,] 103.40 110.50 113.90 114.30 110.50 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 99.06851 108.8307 112.493 111.3378 108.2843 NA [2,] 101.53149 109.4693 113.907 113.1622 109.5157 NA $out [1] 105.6 107.5 103.6 $group [1] 2 2 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(96.4, 98.65, 100.3, 101.35, 103.4, 108.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7dcyj1457983996.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,] 108.24 108.80 107.350 [2,] 108.36 109.15 109.200 [3,] 108.70 109.60 110.075 [4,] 108.87 110.15 110.725 [5,] 109.02 110.50 111.100 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 108.4674 109.1439 109.3794 [2,] 108.9326 110.0561 110.7706 $out [1] 107.4 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.24, 108.36, 108.7, 108.87, 109.02, 108.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1cdr01457983996.ps tmp/1cdr01457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/2idhf1457983996.ps tmp/2idhf1457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/3e3xq1457983996.ps tmp/3e3xq1457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/477ct1457983996.ps tmp/477ct1457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/5hx2d1457983996.ps tmp/5hx2d1457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/6pali1457983996.ps tmp/6pali1457983996.png",intern=TRUE)) character(0) > try(system("convert tmp/7dcyj1457983996.ps tmp/7dcyj1457983996.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.338 0.422 2.789