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(95.9,89.2,100.2,102.3,102.2,100.5,104.1,94.9,97.3,100.3,98,115.1,94.4,91.6,104.1,107.8,101.7,104.1,102,99.9,101.6,101.3,101,115.9,97.5,97.6,109.2,101.6,108.8,108.8,100.9,107.4,101.7,104.5,106.1,116.7,103.7,96.5,114.1,102.8,114.5,107.2,107.9,111.3,99.8,106.7,106.9,115.3,106.1,97.3,109,109.8,116.5,108.3,110.8,108.7,104,111.3,106.5,120.5,110,99.7,109,112.2,116,112.3,113.2,109.9,107.6,114.9,105.7,123.3) > 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] 72 > (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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.9 94.4 97.5 103.7 106.1 110.0 NA [2,] 89.2 91.6 97.6 96.5 97.3 99.7 NA [3,] 100.2 104.1 109.2 114.1 109.0 109.0 NA [4,] 102.3 107.8 101.6 102.8 109.8 112.2 NA [5,] 102.2 101.7 108.8 114.5 116.5 116.0 NA [6,] 100.5 104.1 108.8 107.2 108.3 112.3 NA [7,] 104.1 102.0 100.9 107.9 110.8 113.2 NA [8,] 94.9 99.9 107.4 111.3 108.7 109.9 NA [9,] 97.3 101.6 101.7 99.8 104.0 107.6 NA [10,] 100.3 101.3 104.5 106.7 111.3 114.9 NA [11,] 98.0 101.0 106.1 106.9 106.5 105.7 NA [12,] 115.1 115.9 116.7 115.3 120.5 123.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -6.7 -2.8 0.1 -7.2 -8.8 -10.3 NA [2,] 11.0 12.5 11.6 17.6 11.7 9.3 NA [3,] 2.1 3.7 -7.6 -11.3 0.8 3.2 NA [4,] -0.1 -6.1 7.2 11.7 6.7 3.8 NA [5,] -1.7 2.4 0.0 -7.3 -8.2 -3.7 NA [6,] 3.6 -2.1 -7.9 0.7 2.5 0.9 NA [7,] -9.2 -2.1 6.5 3.4 -2.1 -3.3 NA [8,] 2.4 1.7 -5.7 -11.5 -4.7 -2.3 NA [9,] 3.0 -0.3 2.8 6.9 7.3 7.3 NA [10,] -2.3 -0.3 1.6 0.2 -4.8 -9.2 NA [11,] 17.1 14.9 10.6 8.4 14.0 17.6 NA [12,] -20.7 -18.4 -13.0 -9.2 -10.5 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/18fwg1476885217.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/27key1476885217.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/3te2f1476885217.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/4nx6d1476885217.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,] 94.4 89.2 100.2 101.6 101.70 100.50 100.9 94.90 97.30 100.3 98.0 115.1 [2,] 95.9 91.6 104.1 102.3 102.20 104.10 102.0 99.90 99.80 101.3 101.0 115.3 [3,] 100.6 96.9 109.0 105.3 111.65 107.75 106.0 108.05 101.65 105.6 105.9 116.3 [4,] 106.1 97.6 109.2 109.8 116.00 108.80 110.8 109.90 104.00 111.3 106.5 120.5 [5,] 110.0 99.7 114.1 112.2 116.50 112.30 113.2 111.30 107.60 114.9 106.9 123.3 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 94.02067 93.02981 105.7103 100.4623 102.7486 104.7183 100.3237 101.5997 [2,] 107.17933 100.77019 112.2897 110.1377 120.5514 110.7817 111.6763 114.5003 [,9] [,10] [,11] [,12] [1,] 98.94086 99.14968 102.3523 112.9458 [2,] 104.35914 112.05032 109.4477 119.6542 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.4, 95.9, 100.6, 106.1, 110, 89.2, 91.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z8141476885217.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.30 9.30 -11.30 -6.10 -8.2 -7.9 -9.2 -11.5 -0.30 -9.2 8.40 -20.7 [2,] -8.80 11.00 -7.60 -0.10 -7.3 -2.1 -3.3 -5.7 2.80 -4.8 10.60 -18.4 [3,] -6.95 11.65 1.45 5.25 -2.7 0.8 -2.1 -3.5 4.95 -1.3 14.45 -13.0 [4,] -2.80 12.50 3.20 7.20 0.0 2.5 3.4 1.7 7.30 0.2 17.10 -10.5 [5,] 0.10 12.50 3.70 11.70 2.4 3.6 6.5 2.4 7.30 1.6 17.60 -9.2 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -10.820194 10.68245 -5.516349 0.5412642 -7.408736 -2.167149 -6.421716 [2,] -3.079806 12.61755 8.416349 9.9587358 2.008736 3.767149 2.221716 [,8] [,9] [,10] [,11] [,12] [1,] -8.273239 2.047355 -4.525161 10.25729 -18.58212 [2,] 1.273239 7.852645 1.925161 18.64271 -7.41788 $out [1] 17.6 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-10.3, -8.8, -6.95, -2.80000000000001, 0.0999999999999943, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u6h71476885217.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,] 89.20 99.90 97.50 96.50 104.00 99.70 NA [2,] 96.60 100.45 101.25 103.25 106.30 108.30 NA [3,] 100.25 101.65 105.30 107.05 108.85 111.10 NA [4,] 102.25 104.10 108.80 112.70 111.05 114.05 NA [5,] 104.10 107.80 116.70 115.30 116.50 116.00 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.673 99.98521 101.8564 102.7398 106.6835 108.4774 NA [2,] 102.827 103.31479 108.7436 111.3602 111.0165 113.7226 NA $out [1] 115.1 94.4 91.6 115.9 97.3 120.5 123.3 $group [1] 1 2 2 2 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(89.2, 96.6, 100.25, 102.25, 104.1, 99.9, 100.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7kjjf1476885217.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.2667 96.900 100.9000 [2,] 103.0167 103.475 103.0625 [3,] 106.2833 105.950 105.9938 [4,] 107.2333 108.525 107.0062 [5,] 109.9500 111.650 109.7375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 104.3601 103.6467 104.1950 [2,] 108.2066 108.2533 107.7925 $out [1] 95.31667 117.80000 116.30000 95.17500 117.50000 $group [1] 1 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.266666666667, 103.016666666667, 106.283333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18fwg1476885217.ps tmp/18fwg1476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/27key1476885217.ps tmp/27key1476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/3te2f1476885217.ps tmp/3te2f1476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/4nx6d1476885217.ps tmp/4nx6d1476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/5z8141476885217.ps tmp/5z8141476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/6u6h71476885217.ps tmp/6u6h71476885217.png",intern=TRUE)) character(0) > try(system("convert tmp/7kjjf1476885217.ps tmp/7kjjf1476885217.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.545 0.156 2.739