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(11000,13000,15000,29000,31000,22000,36000,39000,30000,20000,18000,13000,11000,16000,20000,29000,31000,24000,40000,41000,25000,19000,19000,18000,10000,17000,25000,30000,32000,24000,38000,36000,26000,25000,26000,16000,12000,15000,21000,33000,32000,24000,41000,38000,28000,24000,30000,18000) > 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] 48 > (np <- floor(n / par1)) [1] 4 > 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] 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 11000 11000 10000 12000 NA [2,] 13000 16000 17000 15000 NA [3,] 15000 20000 25000 21000 NA [4,] 29000 29000 30000 33000 NA [5,] 31000 31000 32000 32000 NA [6,] 22000 24000 24000 24000 NA [7,] 36000 40000 38000 41000 NA [8,] 39000 41000 36000 38000 NA [9,] 30000 25000 26000 28000 NA [10,] 20000 19000 25000 24000 NA [11,] 18000 19000 26000 30000 NA [12,] 13000 18000 16000 18000 NA > darr [,1] [,2] [,3] [,4] [,5] [1,] 2000 5000 7000 3000 NA [2,] 2000 4000 8000 6000 NA [3,] 14000 9000 5000 12000 NA [4,] 2000 2000 2000 -1000 NA [5,] -9000 -7000 -8000 -8000 NA [6,] 14000 16000 14000 17000 NA [7,] 3000 1000 -2000 -3000 NA [8,] -9000 -16000 -10000 -10000 NA [9,] -10000 -6000 -1000 -4000 NA [10,] -2000 0 1000 6000 NA [11,] -5000 -1000 -10000 -12000 NA [12,] -2000 -8000 -4000 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/1lvuo1476817715.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/24e4h1476817715.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/36lbs1476817715.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/47l3k1476817715.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,] 10000 13000 15000 29000 31000 22000 36000 36000 25000 19000 18000 13000 [2,] 10500 14000 17500 29000 31000 23000 37000 37000 25500 19500 18500 14500 [3,] 11000 15500 20500 29500 31500 24000 39000 38500 27000 22000 22500 17000 [4,] 11500 16500 23000 31500 32000 24000 40500 40000 29000 24500 28000 18000 [5,] 12000 17000 25000 33000 32000 24000 41000 41000 30000 25000 30000 18000 $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 10210 13525 16155 27525 30710 23210 36235 36130 24235 18050 14995 14235 [2,] 11790 17475 24845 31475 32290 24790 41765 40870 29765 25950 30005 19765 $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(10000, 10500, 11000, 11500, 12000, 13000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sawn1476817715.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,] 2000 2000 5000 -1000 -9000 14000 -3000 -16000 -10000 -2000 -12000 -8000 [2,] 2500 3000 7000 500 -8500 14000 -2500 -13000 -8000 -1000 -11000 -6000 [3,] 4000 5000 10500 2000 -8000 15000 -500 -10000 -5000 500 -7500 -4000 [4,] 6000 7000 13000 2000 -7500 16500 2000 -9500 -2500 3500 -3000 -3000 [5,] 7000 8000 14000 2000 -7000 17000 3000 -9000 -1000 6000 -1000 -2000 $n [1] 4 4 4 4 4 4 4 4 4 4 4 3 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 1235 1840 5760 815 -8790 13025 -4055 -12765 -9345 -3055 -13820 -6736.64 [2,] 6765 8160 15240 3185 -7210 16975 3055 -7235 -655 4055 -1180 -1263.36 $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(2000, 2500, 4000, 6000, 7000, 2000, 3000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ozp91476817715.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] [1,] 11000 11000 10000 12000 NA [2,] 14000 18500 20500 19500 NA [3,] 21000 22000 25500 26000 NA [4,] 30500 30000 31000 32500 NA [5,] 39000 41000 38000 41000 NA $n [1] 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [1,] 13474.24 16754.77 20710.88 20070.61 NA [2,] 28525.76 27245.23 30289.12 31929.39 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(11000, 14000, 21000, 30500, 39000, 11000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7xsjd1476817715.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,] 11000 11000 11000.0 [2,] 18250 18750 18500.0 [3,] 23375 23250 23312.5 [4,] 30875 30500 30687.5 [5,] 38750 39000 38875.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 17616.65 17890.75 17753.7 [2,] 29133.35 28609.25 28871.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(11000, 18250, 23375, 30875, 38750, 11000, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lvuo1476817715.ps tmp/1lvuo1476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/24e4h1476817715.ps tmp/24e4h1476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/36lbs1476817715.ps tmp/36lbs1476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/47l3k1476817715.ps tmp/47l3k1476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/5sawn1476817715.ps tmp/5sawn1476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/6ozp91476817715.ps tmp/6ozp91476817715.png",intern=TRUE)) character(0) > try(system("convert tmp/7xsjd1476817715.ps tmp/7xsjd1476817715.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.449 0.155 2.646