R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 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(103.1,95.2,110.2,105.3,107.4,108.1,108,98.8,104.2,107.8,103.5,129.6,100.1,96,111.4,108.3,103.6,106.8,102.5,101,105.5,105.1,103.9,126.4,101,99.3,113.5,99.1,108.2,109.2,100.1,105.5,103,105.8,106.1,122.2,101.9,94.5,112.1,97.6,110,104.6,102.1,106,98.5,106.2,106,120.9,105.1,102.4,94.2,105.6,102.9,111.4,105.4,104.6,103.6,102.1,109.3,103.9,125.3,105.9,106.2,96.2,105.5,104.7,111,109.2,108.3,106.7,103.6,103.9,104.7,112.4,103.2,129.1,114.9,107.6,102.8,99.1,111.9,104.6,103.7,108.5,110.1,107.5,106.8) > 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] 87 > (np <- floor(n / par1)) [1] 7 > 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] 8 8 8 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 103.1 100.1 101.0 101.9 105.1 125.3 104.7 110.1 [2,] 95.2 96.0 99.3 94.5 102.4 105.9 112.4 107.5 [3,] 110.2 111.4 113.5 112.1 94.2 106.2 103.2 106.8 [4,] 105.3 108.3 99.1 97.6 105.6 96.2 129.1 NA [5,] 107.4 103.6 108.2 110.0 102.9 105.5 114.9 NA [6,] 108.1 106.8 109.2 104.6 111.4 104.7 107.6 NA [7,] 108.0 102.5 100.1 102.1 105.4 111.0 102.8 NA [8,] 98.8 101.0 105.5 106.0 104.6 109.2 99.1 NA [9,] 104.2 105.5 103.0 98.5 103.6 108.3 111.9 NA [10,] 107.8 105.1 105.8 106.2 102.1 106.7 104.6 NA [11,] 103.5 103.9 106.1 106.0 109.3 103.6 103.7 NA [12,] 129.6 126.4 122.2 120.9 103.9 103.9 108.5 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -7.9 -4.1 -1.7 -7.4 -2.7 -19.4 7.7 -2.6 [2,] 15.0 15.4 14.2 17.6 -8.2 0.3 -9.2 -0.7 [3,] -4.9 -3.1 -14.4 -14.5 11.4 -10.0 25.9 NA [4,] 2.1 -4.7 9.1 12.4 -2.7 9.3 -14.2 NA [5,] 0.7 3.2 1.0 -5.4 8.5 -0.8 -7.3 NA [6,] -0.1 -4.3 -9.1 -2.5 -6.0 6.3 -4.8 NA [7,] -9.2 -1.5 5.4 3.9 -0.8 -1.8 -3.7 NA [8,] 5.4 4.5 -2.5 -7.5 -1.0 -0.9 12.8 NA [9,] 3.6 -0.4 2.8 7.7 -1.5 -1.6 -7.3 NA [10,] -4.3 -1.2 0.3 -0.2 7.2 -3.1 -0.9 NA [11,] 26.1 22.5 16.1 14.9 -5.4 0.3 4.8 NA [12,] -29.5 -25.4 -20.3 -15.8 21.4 0.8 1.6 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/1aa4i1476789597.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/2yio71476789597.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/3bigv1476789597.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/4awkz1476789597.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,] 100.10 94.50 94.20 96.20 102.90 104.60 100.1 98.80 98.5 104.60 103.50 [2,] 101.45 95.60 104.70 98.35 104.55 105.75 102.3 100.05 103.3 104.85 103.65 [3,] 103.90 100.85 108.50 105.30 107.40 107.60 102.8 104.60 104.2 105.80 103.90 [4,] 107.60 106.70 111.75 106.95 109.10 108.65 106.7 105.75 106.9 106.45 106.05 [5,] 110.10 112.40 113.50 108.30 114.90 111.40 111.0 109.20 111.9 107.80 109.30 [,12] [1,] 103.9 [2,] 106.2 [3,] 120.9 [4,] 124.3 [5,] 129.6 $n [1] 8 8 8 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.4645 94.64938 104.5618 100.1642 104.6828 105.8682 100.1724 101.1961 [2,] 107.3355 107.05062 112.4382 110.4358 110.1172 109.3318 105.4276 108.0039 [,9] [,10] [,11] [,12] [1,] 102.0501 104.8445 102.4668 110.091 [2,] 106.3499 106.7555 105.3332 131.709 $out [1] 125.3 129.1 102.1 $group [1] 1 4 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(100.1, 101.45, 103.9, 107.6, 110.1, 94.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vxg41476789597.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,] -7.90 -9.20 -14.50 -14.2 -7.3 -9.1 -3.70 -7.50 -7.30 -4.30 -5.40 -29.50 [2,] -7.65 -4.45 -12.20 -3.7 -3.1 -5.4 -2.75 -1.75 -1.55 -2.15 2.55 -22.85 [3,] -3.40 7.25 -4.90 2.1 0.7 -4.3 -1.50 -0.90 -0.40 -0.90 14.90 -15.80 [4,] -2.15 15.20 4.15 9.2 2.1 -1.3 1.55 4.95 3.20 0.05 19.30 1.20 [5,] -1.70 17.60 25.90 12.4 8.5 -0.1 5.40 12.80 7.70 0.30 26.10 21.40 $n [1] 8 8 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.472379 -3.726772 -14.663956 -5.603672 -2.405356 -6.748454 -4.067891 [2,] -0.327621 18.226772 4.863956 9.803672 3.805356 -1.851546 1.067891 [,8] [,9] [,10] [,11] [,12] [1,] -4.901132 -3.236623 -2.2138045 4.89717 -30.162272 [2,] 3.101132 2.436623 0.4138045 24.90283 -1.437728 $out [1] -19.4 7.7 6.3 -9.2 7.2 $group [1] 1 1 6 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-7.89999999999999, -7.65, -3.39999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6oimn1476789597.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] [1,] 98.80 96.00 99.10 94.5 102.10 103.60 99.10 106.80 [2,] 103.30 101.75 100.55 100.2 102.65 104.30 103.45 107.15 [3,] 106.35 104.50 105.65 105.3 104.25 106.05 106.15 107.50 [4,] 108.05 107.55 108.70 108.1 105.50 108.75 112.15 108.80 [5,] 110.20 111.40 113.50 112.1 109.30 111.00 114.90 110.10 $n [1] 12 12 12 12 12 12 12 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.1835 101.8546 101.9327 101.6968 102.9501 104.0203 102.1819 105.9948 [2,] 108.5165 107.1454 109.3673 108.9032 105.5499 108.0797 110.1181 109.0052 $out [1] 95.2 129.6 126.4 122.2 120.9 94.2 111.4 125.3 96.2 129.1 $group [1] 1 1 2 3 4 5 5 6 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(98.8, 103.3, 106.35, 108.05, 110.2, 96, 101.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7n8j31476789597.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,] 101.6500 100.85 101.0500 [2,] 104.7786 103.90 103.4563 [3,] 105.6786 104.95 104.9750 [4,] 107.3429 107.50 107.0125 [5,] 107.5000 108.50 108.5125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.5090 103.308 103.353 [2,] 106.8482 106.592 106.597 $out [1] 116.4857 120.9000 115.2500 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.65, 104.778571428571, 105.678571428571, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1aa4i1476789597.ps tmp/1aa4i1476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/2yio71476789597.ps tmp/2yio71476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/3bigv1476789597.ps tmp/3bigv1476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/4awkz1476789597.ps tmp/4awkz1476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/5vxg41476789597.ps tmp/5vxg41476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/6oimn1476789597.ps tmp/6oimn1476789597.png",intern=TRUE)) character(0) > try(system("convert tmp/7n8j31476789597.ps tmp/7n8j31476789597.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.329 0.152 2.528