R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 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.88,91.69,91.66,90.26,91.11,92.33,91.82,92.24,93.35,93.53,93.34,92.59,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) > 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.88 92.42 97.75 101.60 104.63 NA [2,] 91.69 92.64 99.27 102.30 105.55 NA [3,] 91.66 94.44 100.63 103.26 106.12 NA [4,] 90.26 93.59 99.80 104.56 106.62 NA [5,] 91.11 93.39 99.50 104.61 106.72 NA [6,] 92.33 93.33 99.72 104.62 106.52 NA [7,] 91.82 93.72 99.77 105.03 106.79 NA [8,] 92.24 95.43 100.18 104.93 106.95 NA [9,] 93.35 97.06 101.11 104.73 106.92 NA [10,] 93.53 97.70 100.67 104.33 106.74 NA [11,] 93.34 97.59 101.13 104.60 108.13 NA [12,] 92.59 96.97 100.46 104.41 107.86 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.19 0.22 1.52 0.70 0.92 NA [2,] -0.03 1.80 1.36 0.96 0.57 NA [3,] -1.40 -0.85 -0.83 1.30 0.50 NA [4,] 0.85 -0.20 -0.30 0.05 0.10 NA [5,] 1.22 -0.06 0.22 0.01 -0.20 NA [6,] -0.51 0.39 0.05 0.41 0.27 NA [7,] 0.42 1.71 0.41 -0.10 0.16 NA [8,] 1.11 1.63 0.93 -0.20 -0.03 NA [9,] 0.18 0.64 -0.44 -0.40 -0.18 NA [10,] -0.19 -0.11 0.46 0.27 1.39 NA [11,] -0.75 -0.62 -0.67 -0.19 -0.27 NA [12,] -0.17 0.78 1.14 0.22 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/1tv901457389186.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/2ky5k1457389186.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/3mp3z1457389186.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/4ee4l1457389186.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 91.69 91.66 90.26 91.11 92.33 91.82 92.24 93.35 93.53 [2,] 92.88 92.64 94.44 93.59 93.39 93.33 93.72 95.43 97.06 97.70 [3,] 97.75 99.27 100.63 99.80 99.50 99.72 99.77 100.18 101.11 100.67 [4,] 101.60 102.30 103.26 104.56 104.61 104.62 105.03 104.93 104.73 104.33 [5,] 104.63 105.55 106.12 106.62 106.72 106.52 106.79 106.95 106.92 106.74 [,11] [,12] [1,] 93.34 92.59 [2,] 97.59 96.97 [3,] 101.13 100.46 [4,] 104.60 104.41 [5,] 108.13 107.86 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.58847 92.44427 94.39781 92.04863 91.57198 91.74251 91.77838 [2,] 103.91153 106.09573 106.86219 107.55137 107.42802 107.69749 107.76162 [,8] [,9] [,10] [,11] [,12] [1,] 93.46732 95.6904 95.98526 96.17675 95.20291 [2,] 106.89268 106.5296 105.35474 106.08325 105.71709 $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, 92.88, 97.75, 101.6, 104.63, 91.69, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kc5h1457389186.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.03 -1.40 -0.30 -0.20 0.05 -0.10 -0.20 -0.44 -0.19 -0.75 -0.170 [2,] 0.22 0.57 -0.85 -0.20 -0.06 0.05 0.16 -0.03 -0.40 -0.11 -0.67 0.025 [3,] 0.70 0.96 -0.83 0.05 0.01 0.27 0.41 0.93 -0.18 0.27 -0.62 0.500 [4,] 0.92 1.36 0.50 0.10 0.22 0.39 0.42 1.11 0.18 0.46 -0.27 0.960 [5,] 1.52 1.80 1.30 0.10 0.22 0.41 0.42 1.63 0.64 0.46 -0.19 1.140 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2053818 0.401788 -1.7839066 -0.1619792 -0.1878473 0.02975686 0.2262847 [2,] 1.1946182 1.518212 0.1239066 0.2619792 0.2078473 0.51024314 0.5937153 [,8] [,9] [,10] [,11] [,12] [1,] 0.1244789 -0.5898265 -0.1327606 -0.902639 -0.23865 [2,] 1.7355211 0.2298265 0.6727606 -0.337361 1.23865 $out [1] -1.19 0.85 1.22 -0.51 1.71 1.39 $group [1] 1 4 5 6 7 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.219999999999999, 0.219999999999999, 0.700000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6xqi71457389186.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,] 90.260 92.420 99.27 103.260 105.550 NA [2,] 91.675 93.360 99.61 103.795 106.320 NA [3,] 92.285 94.080 99.99 104.580 106.730 NA [4,] 93.110 97.015 100.65 104.675 106.935 NA [5,] 93.530 97.700 101.13 105.030 106.950 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.63049 92.41293 99.51565 104.1786 106.4495 NA [2,] 92.93951 95.74707 100.46435 104.9814 107.0105 NA $out [1] 97.75 101.60 102.30 104.63 108.13 107.86 $group [1] 3 4 4 5 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(90.26, 91.675, 92.285, 93.11, 93.53, 92.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7cqh01457389186.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,] 97.856 99.27 97.2400 [2,] 99.016 99.61 98.9125 [3,] 99.365 99.99 99.2250 [4,] 100.526 100.65 100.7925 [5,] 100.958 101.13 101.0950 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.67628 99.51565 98.36752 [2,] 100.05372 100.46435 100.08248 $out [1] 97.75 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.856, 99.016, 99.365, 100.526, 100.958, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tv901457389186.ps tmp/1tv901457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/2ky5k1457389186.ps tmp/2ky5k1457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/3mp3z1457389186.ps tmp/3mp3z1457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/4ee4l1457389186.ps tmp/4ee4l1457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/5kc5h1457389186.ps tmp/5kc5h1457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/6xqi71457389186.ps tmp/6xqi71457389186.png",intern=TRUE)) character(0) > try(system("convert tmp/7cqh01457389186.ps tmp/7cqh01457389186.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.549 0.445 3.018