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(103.75,103.89,104.01,104.28,104.34,104.48,104.56,104.71,104.79,104.87,104.95,105,105.05,105.57,105.98,106.45,107.13,107.87,108.56,109.04,109.98,110.4,110.99,111.23,111.76,112.18,112.88,113.54,114.11,114.8,115.56,116.03,116.98,117.65,118.12,118.6,119.03,119.82,120.76,121.4,122.12,123.08,123.86,124.46,125.14,125.89,126.32,126.93,127.48,128.28,129.11,130.23,131.04,132.2,133.12,134.48,135.74,136.88,138.12,139.99) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.75 105.05 111.76 119.03 127.48 NA [2,] 103.89 105.57 112.18 119.82 128.28 NA [3,] 104.01 105.98 112.88 120.76 129.11 NA [4,] 104.28 106.45 113.54 121.40 130.23 NA [5,] 104.34 107.13 114.11 122.12 131.04 NA [6,] 104.48 107.87 114.80 123.08 132.20 NA [7,] 104.56 108.56 115.56 123.86 133.12 NA [8,] 104.71 109.04 116.03 124.46 134.48 NA [9,] 104.79 109.98 116.98 125.14 135.74 NA [10,] 104.87 110.40 117.65 125.89 136.88 NA [11,] 104.95 110.99 118.12 126.32 138.12 NA [12,] 105.00 111.23 118.60 126.93 139.99 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.14 0.52 0.42 0.79 0.80 NA [2,] 0.12 0.41 0.70 0.94 0.83 NA [3,] 0.27 0.47 0.66 0.64 1.12 NA [4,] 0.06 0.68 0.57 0.72 0.81 NA [5,] 0.14 0.74 0.69 0.96 1.16 NA [6,] 0.08 0.69 0.76 0.78 0.92 NA [7,] 0.15 0.48 0.47 0.60 1.36 NA [8,] 0.08 0.94 0.95 0.68 1.26 NA [9,] 0.08 0.42 0.67 0.75 1.14 NA [10,] 0.08 0.59 0.47 0.43 1.24 NA [11,] 0.05 0.24 0.48 0.61 1.87 NA [12,] 0.05 0.53 0.43 0.55 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/1lagx1483464104.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/2m55b1483464104.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/3br251483464104.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/4wkxi1483464104.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] [1,] 103.75 103.89 104.01 104.28 104.34 104.48 104.56 104.71 104.79 104.87 [2,] 105.05 105.57 105.98 106.45 107.13 107.87 108.56 109.04 109.98 110.40 [3,] 111.76 112.18 112.88 113.54 114.11 114.80 115.56 116.03 116.98 117.65 [4,] 119.03 119.82 120.76 121.40 122.12 123.08 123.86 124.46 125.14 125.89 [5,] 127.48 128.28 129.11 130.23 131.04 132.20 133.12 134.48 135.74 136.88 [,11] [,12] [1,] 104.95 105.00 [2,] 110.99 111.23 [3,] 118.12 118.60 [4,] 126.32 126.93 [5,] 138.12 139.99 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.8818 102.111 102.4365 102.9764 103.5181 104.0527 104.7491 105.1343 [2,] 121.6382 122.249 123.3235 124.1036 124.7019 125.5473 126.3709 126.9257 [,9] [,10] [,11] [,12] [1,] 106.268 106.7048 107.2879 107.5064 [2,] 127.692 128.5952 128.9521 129.6936 $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(103.75, 105.05, 111.76, 119.03, 127.48, 103.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zrie1483464104.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,] 0.14 0.12 0.27 0.57 0.69 0.69 0.47 0.68 0.08 0.43 0.05 0.05 [2,] 0.42 0.41 0.47 0.57 0.69 0.69 0.47 0.68 0.42 0.43 0.24 0.24 [3,] 0.52 0.70 0.64 0.68 0.74 0.76 0.48 0.94 0.67 0.47 0.48 0.48 [4,] 0.79 0.83 0.66 0.72 0.96 0.78 0.60 0.95 0.75 0.59 0.61 0.54 [5,] 0.80 0.94 0.66 0.81 1.16 0.78 0.60 1.26 1.14 0.59 0.61 0.55 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2585589 0.4032291 0.5057465 0.5740104 0.5492187 0.6964062 0.3881423 [2,] 0.7814411 0.9967709 0.7742535 0.7859896 0.9307813 0.8235938 0.5718577 [,8] [,9] [,10] [,11] [,12] [1,] 0.7492187 0.4368228 0.3569444 0.2185589 0.243 [2,] 1.1307813 0.9031772 0.5830556 0.7414411 0.717 $out [1] 1.12 0.06 0.14 0.08 0.92 0.15 1.36 0.08 0.08 1.24 1.87 $group [1] 3 4 5 6 6 7 7 8 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.140000000000001, 0.420000000000002, 0.519999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/65scz1483464104.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] [1,] 103.750 105.050 111.760 119.030 127.48 NA [2,] 104.145 106.215 113.210 121.080 129.67 NA [3,] 104.520 108.215 115.180 123.470 132.66 NA [4,] 104.830 110.190 117.315 125.515 136.31 NA [5,] 105.000 111.230 118.600 126.930 139.99 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 104.2076 106.402 113.3077 121.4472 129.6315 NA [2,] 104.8324 110.028 117.0523 125.4928 135.6885 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(103.75, 104.145, 104.52, 104.83, 105, 105.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/708yf1483464104.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,] 113.414 111.760 112.0400 [2,] 114.864 113.210 113.6475 [3,] 116.809 115.180 115.8425 [4,] 118.832 117.315 117.8525 [5,] 120.350 118.600 119.0800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 114.9992 113.3077 113.9246 [2,] 118.6188 117.0523 117.7604 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1lagx1483464104.ps tmp/1lagx1483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/2m55b1483464104.ps tmp/2m55b1483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/3br251483464104.ps tmp/3br251483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/4wkxi1483464104.ps tmp/4wkxi1483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/5zrie1483464104.ps tmp/5zrie1483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/65scz1483464104.ps tmp/65scz1483464104.png",intern=TRUE)) character(0) > try(system("convert tmp/708yf1483464104.ps tmp/708yf1483464104.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.865 0.272 3.226