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(11,13,15,29,31,22,36,39,30,20,18,13,11,16,20,29,31,24,40,41,25,19,19,18,10,17,25,30,32,24,38,36,26,25,26,16,12,15,21,33,32,24,41,38,28,24,30,18) > par1 = '48' > par1 <- '48' > #'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] 1 > 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] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 11 NA [2,] 13 NA [3,] 15 NA [4,] 29 NA [5,] 31 NA [6,] 22 NA [7,] 36 NA [8,] 39 NA [9,] 30 NA [10,] 20 NA [11,] 18 NA [12,] 13 NA [13,] 11 NA [14,] 16 NA [15,] 20 NA [16,] 29 NA [17,] 31 NA [18,] 24 NA [19,] 40 NA [20,] 41 NA [21,] 25 NA [22,] 19 NA [23,] 19 NA [24,] 18 NA [25,] 10 NA [26,] 17 NA [27,] 25 NA [28,] 30 NA [29,] 32 NA [30,] 24 NA [31,] 38 NA [32,] 36 NA [33,] 26 NA [34,] 25 NA [35,] 26 NA [36,] 16 NA [37,] 12 NA [38,] 15 NA [39,] 21 NA [40,] 33 NA [41,] 32 NA [42,] 24 NA [43,] 41 NA [44,] 38 NA [45,] 28 NA [46,] 24 NA [47,] 30 NA [48,] 18 NA > darr [,1] [,2] [1,] 2 NA [2,] 2 NA [3,] 14 NA [4,] 2 NA [5,] -9 NA [6,] 14 NA [7,] 3 NA [8,] -9 NA [9,] -10 NA [10,] -2 NA [11,] -5 NA [12,] -2 NA [13,] 5 NA [14,] 4 NA [15,] 9 NA [16,] 2 NA [17,] -7 NA [18,] 16 NA [19,] 1 NA [20,] -16 NA [21,] -6 NA [22,] 0 NA [23,] -1 NA [24,] -8 NA [25,] 7 NA [26,] 8 NA [27,] 5 NA [28,] 2 NA [29,] -8 NA [30,] 14 NA [31,] -2 NA [32,] -10 NA [33,] -1 NA [34,] 1 NA [35,] -10 NA [36,] -4 NA [37,] 3 NA [38,] 6 NA [39,] 12 NA [40,] -1 NA [41,] -8 NA [42,] 17 NA [43,] -3 NA [44,] -10 NA [45,] -4 NA [46,] 6 NA [47,] -12 NA [48,] 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/1q0301476390600.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/2j8fz1476390600.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/3k88s1476390600.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/4ikw11476390600.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] [,13] [,14] [1,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [2,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [3,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [4,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [5,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 20 29 31 24 40 41 25 19 19 18 10 17 [2,] 20 29 31 24 40 41 25 19 19 18 10 17 [3,] 20 29 31 24 40 41 25 19 19 18 10 17 [4,] 20 29 31 24 40 41 25 19 19 18 10 17 [5,] 20 29 31 24 40 41 25 19 19 18 10 17 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 25 30 32 24 38 36 26 25 26 16 12 15 [2,] 25 30 32 24 38 36 26 25 26 16 12 15 [3,] 25 30 32 24 38 36 26 25 26 16 12 15 [4,] 25 30 32 24 38 36 26 25 26 16 12 15 [5,] 25 30 32 24 38 36 26 25 26 16 12 15 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 21 33 32 24 41 38 28 24 30 18 [2,] 21 33 32 24 41 38 28 24 30 18 [3,] 21 33 32 24 41 38 28 24 30 18 [4,] 21 33 32 24 41 38 28 24 30 18 [5,] 21 33 32 24 41 38 28 24 30 18 $n [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [2,] 11 13 15 29 31 22 36 39 30 20 18 13 11 16 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 20 29 31 24 40 41 25 19 19 18 10 17 [2,] 20 29 31 24 40 41 25 19 19 18 10 17 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 25 30 32 24 38 36 26 25 26 16 12 15 [2,] 25 30 32 24 38 36 26 25 26 16 12 15 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 21 33 32 24 41 38 28 24 30 18 [2,] 21 33 32 24 41 38 28 24 30 18 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5i31s1476390600.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] [,13] [,14] [1,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [2,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [3,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [4,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [5,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [2,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [3,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [4,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [5,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [2,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [3,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [4,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [5,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 12 -1 -8 17 -3 -10 -4 6 -12 NA [2,] 12 -1 -8 17 -3 -10 -4 6 -12 NA [3,] 12 -1 -8 17 -3 -10 -4 6 -12 NA [4,] 12 -1 -8 17 -3 -10 -4 6 -12 NA [5,] 12 -1 -8 17 -3 -10 -4 6 -12 NA $n [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [2,] 2 2 14 2 -9 14 3 -9 -10 -2 -5 -2 5 4 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [2,] 9 2 -7 16 1 -16 -6 0 -1 -8 7 8 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [2,] 5 2 -8 14 -2 -10 -1 1 -10 -4 3 6 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 12 -1 -8 17 -3 -10 -4 6 -12 NA [2,] 12 -1 -8 17 -3 -10 -4 6 -12 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sa1e1476390600.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] [1,] 10.0 NA [2,] 18.0 NA [3,] 24.5 NA [4,] 31.0 NA [5,] 41.0 NA $n [1] 48 0 $conf [,1] [,2] [1,] 21.53531 NA [2,] 27.46469 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7bngv1476390600.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,] 10.0 10.0 10.0 [2,] 18.0 18.0 18.0 [3,] 24.5 24.5 24.5 [4,] 31.0 31.0 31.0 [5,] 41.0 41.0 41.0 $n [1] 48 48 48 $conf [,1] [,2] [,3] [1,] 21.53531 21.53531 21.53531 [2,] 27.46469 27.46469 27.46469 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1q0301476390600.ps tmp/1q0301476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/2j8fz1476390600.ps tmp/2j8fz1476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/3k88s1476390600.ps tmp/3k88s1476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/4ikw11476390600.ps tmp/4ikw11476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/5i31s1476390600.ps tmp/5i31s1476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/6sa1e1476390600.ps tmp/6sa1e1476390600.png",intern=TRUE)) character(0) > try(system("convert tmp/7bngv1476390600.ps tmp/7bngv1476390600.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.028 0.232 3.450