R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 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(99.5,101.8,102.3,102.6,102.5,104.3,105.3,105.8,104.8,104.5,102.8,101.4,103.6,106.8,108.2,108.3,108.4,108.8,109.4,109,109,109.8,110.5,110.5,111.1,110.8,111,111.7,111.9,112.6,112.2,112.3,112.8,114.3,114.3,114,113.9,113.7,113.8,113.8,113.2,112.2,112.2,113.2,113.6,113.2,112.2,110.5,109.2,109,109.1,109.4,108.8,109.6,109.6,109.8,110.5,109,107.5,105.6,103.4,101.9,101.4,101.3,100.8,100.3,100.3,100,99.2,98.1,96.9,96.4) > 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,] 99.5 103.6 111.1 113.9 109.2 103.4 NA [2,] 101.8 106.8 110.8 113.7 109.0 101.9 NA [3,] 102.3 108.2 111.0 113.8 109.1 101.4 NA [4,] 102.6 108.3 111.7 113.8 109.4 101.3 NA [5,] 102.5 108.4 111.9 113.2 108.8 100.8 NA [6,] 104.3 108.8 112.6 112.2 109.6 100.3 NA [7,] 105.3 109.4 112.2 112.2 109.6 100.3 NA [8,] 105.8 109.0 112.3 113.2 109.8 100.0 NA [9,] 104.8 109.0 112.8 113.6 110.5 99.2 NA [10,] 104.5 109.8 114.3 113.2 109.0 98.1 NA [11,] 102.8 110.5 114.3 112.2 107.5 96.9 NA [12,] 101.4 110.5 114.0 110.5 105.6 96.4 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2.3 3.2 -0.3 -0.2 -0.2 -1.5 NA [2,] 0.5 1.4 0.2 0.1 0.1 -0.5 NA [3,] 0.3 0.1 0.7 0.0 0.3 -0.1 NA [4,] -0.1 0.1 0.2 -0.6 -0.6 -0.5 NA [5,] 1.8 0.4 0.7 -1.0 0.8 -0.5 NA [6,] 1.0 0.6 -0.4 0.0 0.0 0.0 NA [7,] 0.5 -0.4 0.1 1.0 0.2 -0.3 NA [8,] -1.0 0.0 0.5 0.4 0.7 -0.8 NA [9,] -0.3 0.8 1.5 -0.4 -1.5 -1.1 NA [10,] -1.7 0.7 0.0 -1.0 -1.5 -1.2 NA [11,] -1.4 0.0 -0.3 -1.7 -1.9 -0.5 NA [12,] 2.2 0.6 -0.1 -1.3 -2.2 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/168fa1489244817.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/2enh91489244817.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/3kqlp1489244817.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/4yzf11489244817.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,] 99.5 101.8 101.40 101.30 100.8 100.3 100.3 100.0 99.20 98.1 96.9 [2,] 103.4 101.9 102.30 102.60 102.5 104.3 105.3 105.8 104.80 104.5 102.8 [3,] 106.4 107.9 108.65 108.85 108.6 109.2 109.5 109.4 109.75 109.4 109.0 [4,] 111.1 110.8 111.00 111.70 111.9 112.2 112.2 112.3 112.80 113.2 112.2 [5,] 113.9 113.7 113.80 113.80 113.2 112.6 112.2 113.2 113.60 114.3 114.3 [,12] [1,] 96.40 [2,] 101.40 [3,] 108.05 [4,] 110.50 [5,] 114.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.4333 102.1592 103.0382 102.9802 102.5367 104.1042 105.0493 105.2073 [2,] 111.3667 113.6408 114.2618 114.7198 114.6633 114.2958 113.9507 113.5927 [,9] [,10] [,11] [,12] [1,] 104.5897 103.7882 102.9367 102.1802 [2,] 114.9103 115.0118 115.0633 113.9198 $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(99.5, 103.4, 106.4, 111.1, 113.9, 101.8, 101.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yobr1489244817.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.5 -0.50 -0.1 -0.6 -1.00 -0.4 -0.40 -1.0 -1.50 -1.7 -1.90 -2.2 [2,] -0.3 0.10 0.0 -0.6 -0.50 0.0 -0.30 -0.8 -1.10 -1.5 -1.70 -1.3 [3,] -0.2 0.15 0.2 -0.3 0.55 0.0 0.15 0.2 -0.35 -1.1 -0.95 -0.1 [4,] 2.3 0.50 0.3 0.1 0.80 0.6 0.50 0.5 0.80 0.0 -0.30 0.6 [5,] 3.2 0.50 0.7 0.2 1.80 1.0 1.00 0.7 1.50 0.7 0.00 2.2 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.877084 -0.1080129 0.00649031 -0.7515226 -0.288542 -0.3870194 -0.3660258 [2,] 1.477084 0.4080129 0.39350969 0.1515226 1.388542 0.3870194 0.6660258 [,8] [,9] [,10] [,11] [,12] [1,] -0.638542 -1.5755614 -2.0675484 -1.85304522 -1.442535 [2,] 1.038542 0.8755614 -0.1324516 -0.04695478 1.242535 $out [1] 1.4 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.5, -0.299999999999997, -0.200000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t5le1489244817.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,] 99.50 106.80 110.80 110.50 108.80 96.40 NA [2,] 102.05 108.25 111.40 112.20 108.90 98.65 NA [3,] 102.70 108.90 112.25 113.20 109.15 100.30 NA [4,] 104.65 109.60 113.40 113.75 109.60 101.35 NA [5,] 105.80 110.50 114.30 113.90 110.50 103.40 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 101.5141 108.2843 111.3378 112.493 108.8307 99.06851 NA [2,] 103.8859 109.5157 113.1622 113.907 109.4693 101.53149 NA $out [1] 103.6 107.5 105.6 $group [1] 2 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.5, 102.05, 102.7, 104.65, 105.8, 106.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/78ili1489244817.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,] 106.4000 107.900 106.4750 [2,] 107.3500 108.325 107.0938 [3,] 107.7417 108.925 107.7250 [4,] 108.1583 109.400 108.9625 [5,] 108.3500 109.750 109.1375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 107.3730 108.4347 106.8727 [2,] 108.1104 109.4153 108.5773 $out [1] 106.4 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(106.4, 107.35, 107.741666666667, 108.158333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/168fa1489244817.ps tmp/168fa1489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/2enh91489244817.ps tmp/2enh91489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/3kqlp1489244817.ps tmp/3kqlp1489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/4yzf11489244817.ps tmp/4yzf11489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/5yobr1489244817.ps tmp/5yobr1489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/6t5le1489244817.ps tmp/6t5le1489244817.png",intern=TRUE)) character(0) > try(system("convert tmp/78ili1489244817.ps tmp/78ili1489244817.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.882 0.202 3.153