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(92.42,92.64,94.44,93.59,93.39,93.33,93.72,95.43,97.06,97.7,97.59,96.97,97.75,99.27,100.63,99.8,99.5,99.72,99.77,100.18,101.11,100.67,101.13,100.46,101.6,102.3,103.26,104.56,104.61,104.62,105.03,104.93,104.73,104.33,104.6,104.41,104.63,105.55,106.12,106.62,106.72,106.52,106.79,106.95,106.92,106.74,108.13,107.86,108.6,110.97,111.8,111,113.41,114.32,111.89,112.48,112.32,110.35,109.77,111.25) > 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,] 92.42 97.75 101.60 104.63 108.60 NA [2,] 92.64 99.27 102.30 105.55 110.97 NA [3,] 94.44 100.63 103.26 106.12 111.80 NA [4,] 93.59 99.80 104.56 106.62 111.00 NA [5,] 93.39 99.50 104.61 106.72 113.41 NA [6,] 93.33 99.72 104.62 106.52 114.32 NA [7,] 93.72 99.77 105.03 106.79 111.89 NA [8,] 95.43 100.18 104.93 106.95 112.48 NA [9,] 97.06 101.11 104.73 106.92 112.32 NA [10,] 97.70 100.67 104.33 106.74 110.35 NA [11,] 97.59 101.13 104.60 108.13 109.77 NA [12,] 96.97 100.46 104.41 107.86 111.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.22 1.52 0.70 0.92 2.37 NA [2,] 1.80 1.36 0.96 0.57 0.83 NA [3,] -0.85 -0.83 1.30 0.50 -0.80 NA [4,] -0.20 -0.30 0.05 0.10 2.41 NA [5,] -0.06 0.22 0.01 -0.20 0.91 NA [6,] 0.39 0.05 0.41 0.27 -2.43 NA [7,] 1.71 0.41 -0.10 0.16 0.59 NA [8,] 1.63 0.93 -0.20 -0.03 -0.16 NA [9,] 0.64 -0.44 -0.40 -0.18 -1.97 NA [10,] -0.11 0.46 0.27 1.39 -0.58 NA [11,] -0.62 -0.67 -0.19 -0.27 1.48 NA [12,] 0.78 1.14 0.22 0.74 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/1rggr1489407201.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/2b9rr1489407201.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/3f0kh1489407201.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/4936q1489407201.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,] 92.42 92.64 94.44 93.59 93.39 93.33 93.72 95.43 97.06 97.70 [2,] 97.75 99.27 100.63 99.80 99.50 99.72 99.77 100.18 101.11 100.67 [3,] 101.60 102.30 103.26 104.56 104.61 104.62 105.03 104.93 104.73 104.33 [4,] 104.63 105.55 106.12 106.62 106.72 106.52 106.79 106.95 106.92 106.74 [5,] 108.60 110.97 111.80 111.00 113.41 114.32 111.89 112.48 112.32 110.35 [,11] [,12] [1,] 97.59 96.97 [2,] 101.13 100.46 [3,] 104.60 104.41 [4,] 108.13 107.86 [5,] 109.77 111.25 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 96.73861 97.86257 99.38078 99.74101 99.50837 99.81514 100.0697 [2,] 106.46139 106.73743 107.13922 109.37899 109.71163 109.42486 109.9903 [,8] [,9] [,10] [,11] [,12] [1,] 100.1463 100.6247 100.041 99.65382 99.18118 [2,] 109.7137 108.8353 108.619 109.54618 109.63882 $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(92.42, 97.75, 101.6, 104.63, 108.6, 92.64, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qch81489407201.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.22 0.57 -0.85 -0.30 -0.20 0.05 -0.10 -0.20 -0.44 -0.58 -0.67 0.22 [2,] 0.70 0.83 -0.83 -0.20 -0.06 0.05 0.16 -0.16 -0.44 -0.11 -0.62 0.48 [3,] 0.92 0.96 -0.80 0.05 0.01 0.27 0.41 -0.03 -0.40 0.27 -0.27 0.76 [4,] 1.52 1.36 0.50 0.10 0.22 0.39 0.59 0.93 -0.18 0.46 -0.19 0.96 [5,] 2.37 1.80 1.30 0.10 0.22 0.41 0.59 1.63 -0.18 0.46 -0.19 1.14 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3405901 0.5855033 -1.7397746 -0.1619792 -0.1878473 0.02975686 0.1061631 [2,] 1.4994099 1.3344967 0.1397746 0.2619792 0.2078473 0.51024314 0.7138369 [,8] [,9] [,10] [,11] [,12] [1,] -0.8001913 -0.5837153 -0.1327606 -0.57383692 0.3808 [2,] 0.7401913 -0.2162847 0.6727606 0.03383692 1.1392 $out [1] 2.41 0.91 -2.43 1.71 0.64 -1.97 1.39 1.48 $group [1] 4 5 6 7 9 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.219999999999999, 0.700000000000003, 0.920000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jsev1489407201.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,] 92.420 99.27 103.260 105.550 108.600 NA [2,] 93.360 99.61 103.795 106.320 110.660 NA [3,] 94.080 99.99 104.580 106.730 111.525 NA [4,] 97.015 100.65 104.675 106.935 112.400 NA [5,] 97.700 101.13 105.030 106.950 114.320 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.41293 99.51565 104.1786 106.4495 110.7314 NA [2,] 95.74707 100.46435 104.9814 107.0105 112.3186 NA $out [1] 97.75 101.60 102.30 104.63 108.13 107.86 $group [1] 2 3 3 4 4 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.42, 93.36, 94.08, 97.015, 97.7, 99.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wqbi1489407201.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,] 102.146 103.260 102.4100 [2,] 103.182 103.795 103.1150 [3,] 103.614 104.580 103.3275 [4,] 104.092 104.675 103.8600 [5,] 104.428 105.030 104.6300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103.1989 104.1786 102.9877 [2,] 104.0291 104.9814 103.6673 $out [1] 101.00 101.60 102.30 101.19 $group [1] 1 2 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(102.146, 103.182, 103.614, 104.092, 104.428, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rggr1489407201.ps tmp/1rggr1489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/2b9rr1489407201.ps tmp/2b9rr1489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/3f0kh1489407201.ps tmp/3f0kh1489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/4936q1489407201.ps tmp/4936q1489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/5qch81489407201.ps tmp/5qch81489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/6jsev1489407201.ps tmp/6jsev1489407201.png",intern=TRUE)) character(0) > try(system("convert tmp/7wqbi1489407201.ps tmp/7wqbi1489407201.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.676 0.232 2.960