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(94.47,94.19,94.34,94.3,94.4,94.54,94.09,95.87,98.46,98.7,98.75,98.72,98.72,98.67,98.82,99.39,99.33,99.22,99.05,98.83,98.84,98.89,98.8,99.4,98.89,98.85,98.69,98.48,98.39,98.35,98.26,98.06,98.14,98.17,98.41,98.64,99.25,99.61,100.28,100.31,100.55,100.45,100.78,100.68,101.69,98.09,99.13,99.18,96.22,96.11,96,95.96,97.95,98.43,98.32,97.45,96.42,95.36,95.1,95.54,94.07,93.48,92.86,90.98,91.45,91.16,90.71,90.31,89.78,91.02,90.77,90.69) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.47 98.72 98.89 99.25 96.22 94.07 NA [2,] 94.19 98.67 98.85 99.61 96.11 93.48 NA [3,] 94.34 98.82 98.69 100.28 96.00 92.86 NA [4,] 94.30 99.39 98.48 100.31 95.96 90.98 NA [5,] 94.40 99.33 98.39 100.55 97.95 91.45 NA [6,] 94.54 99.22 98.35 100.45 98.43 91.16 NA [7,] 94.09 99.05 98.26 100.78 98.32 90.71 NA [8,] 95.87 98.83 98.06 100.68 97.45 90.31 NA [9,] 98.46 98.84 98.14 101.69 96.42 89.78 NA [10,] 98.70 98.89 98.17 98.09 95.36 91.02 NA [11,] 98.75 98.80 98.41 99.13 95.10 90.77 NA [12,] 98.72 99.40 98.64 99.18 95.54 90.69 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.28 -0.05 -0.04 0.36 -0.11 -0.59 NA [2,] 0.15 0.15 -0.16 0.67 -0.11 -0.62 NA [3,] -0.04 0.57 -0.21 0.03 -0.04 -1.88 NA [4,] 0.10 -0.06 -0.09 0.24 1.99 0.47 NA [5,] 0.14 -0.11 -0.04 -0.10 0.48 -0.29 NA [6,] -0.45 -0.17 -0.09 0.33 -0.11 -0.45 NA [7,] 1.78 -0.22 -0.20 -0.10 -0.87 -0.40 NA [8,] 2.59 0.01 0.08 1.01 -1.03 -0.53 NA [9,] 0.24 0.05 0.03 -3.60 -1.06 1.24 NA [10,] 0.05 -0.09 0.24 1.04 -0.26 -0.25 NA [11,] -0.03 0.60 0.23 0.05 0.44 -0.08 NA [12,] 0.00 -0.51 0.61 -2.96 -1.47 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/1yj7z1489665398.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/2r0jd1489665398.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/32rm71489665398.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/4pqjw1489665398.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] [1,] 94.07 93.48 92.860 90.98 91.45 91.16 90.71 95.870 96.42 91.02 90.77 [2,] 94.47 94.19 94.340 94.30 94.40 94.54 94.09 95.870 96.42 95.36 95.10 [3,] 97.47 97.39 97.345 97.22 98.17 98.39 98.29 97.755 98.30 98.13 98.58 [4,] 98.89 98.85 98.820 99.39 99.33 99.22 99.05 98.830 98.84 98.70 98.80 [5,] 99.25 99.61 100.280 100.31 100.55 100.45 100.78 100.680 101.69 98.89 99.13 [,12] [1,] 90.69 [2,] 95.54 [3,] 98.68 [4,] 99.18 [5,] 99.40 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.61896 94.38415 94.45526 93.93679 94.98999 95.37125 95.09064 [2,] 100.32104 100.39585 100.23474 100.50321 101.35001 101.40875 101.48936 [,8] [,9] [,10] [,11] [,12] [1,] 95.8457 96.73902 95.97559 96.19338 96.33208 [2,] 99.6643 99.86098 100.28441 100.96662 101.02792 $out [1] 90.31 89.78 $group [1] 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.07, 94.47, 97.47, 98.89, 99.25, 93.48, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5p6u81489665398.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.59 -0.62 -0.21 -0.09 -0.29 -0.45 -0.40 -1.030 -1.06 -0.26 -0.08 -2.96 [2,] -0.28 -0.16 -0.21 -0.06 -0.11 -0.45 -0.40 -0.530 -1.06 -0.25 -0.03 -1.47 [3,] -0.08 0.02 -0.04 0.17 -0.07 -0.14 -0.21 0.045 0.04 -0.02 0.14 -0.51 [4,] -0.04 0.15 0.03 0.47 0.14 -0.09 -0.10 1.010 0.24 0.24 0.44 0.00 [5,] -0.04 0.15 0.03 0.47 0.48 0.33 -0.10 2.590 1.24 0.24 0.60 0.61 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.23480775 -0.17996 -0.1948078 -0.1718671 -0.23125807 -0.37221163 [2,] 0.07480775 0.21996 0.1148078 0.5118671 0.09125807 0.09221163 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.40350969 -0.9483497 -0.798542 -0.3360658 -0.1631652 -1.5486983 [2,] -0.01649031 1.0383497 0.878542 0.2960658 0.4431652 0.5286983 $out [1] 0.36 0.67 0.57 -1.88 1.99 1.78 -0.87 -3.60 1.04 $group [1] 1 2 3 3 4 7 7 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.589999999999989, -0.280000000000001, -0.0799999999999983, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cmgh1489665398.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] [,7] [1,] 94.090 98.670 98.060 98.090 95.100 89.780 NA [2,] 94.320 98.810 98.215 99.215 95.750 90.700 NA [3,] 94.505 98.865 98.400 100.295 96.165 91.000 NA [4,] 98.580 99.275 98.665 100.615 97.700 92.155 NA [5,] 98.750 99.400 98.890 101.690 98.430 94.070 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.56199 98.65291 98.19475 99.65645 95.27559 90.33636 NA [2,] 96.44801 99.07709 98.60525 100.93355 97.05441 91.66364 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94.09, 94.32, 94.505, 98.58, 98.75, 98.67, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hleo1489665398.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,] 96.57000 97.220 96.73750 [2,] 96.82250 97.430 96.90812 [3,] 96.86750 98.150 97.22437 [4,] 97.01833 98.345 97.40437 [5,] 97.22167 98.680 97.79750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.77818 97.73266 96.99803 [2,] 96.95682 98.56734 97.45072 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.57, 96.8225, 96.8675, 97.0183333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1yj7z1489665398.ps tmp/1yj7z1489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/2r0jd1489665398.ps tmp/2r0jd1489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/32rm71489665398.ps tmp/32rm71489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/4pqjw1489665398.ps tmp/4pqjw1489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/5p6u81489665398.ps tmp/5p6u81489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/6cmgh1489665398.ps tmp/6cmgh1489665398.png",intern=TRUE)) character(0) > try(system("convert tmp/7hleo1489665398.ps tmp/7hleo1489665398.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.735 0.202 3.007