R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(98.85,98.86,98.86,98.89,98.85,98.85,98.85,98.96,98.99,99.21,99.29,99.32,99.32,99.17,99.13,99.12,99.23,99.25,99.25,99.36,99.43,99.57,99.64,99.68,99.68,99.52,99.69,99.7,99.85,99.94,99.94,99.93,100.19,100.57,100.76,100.86,100.86,100.39,100.61,100.67,100.81,100.86,100.86,100.98,101.03,101.37,101.64,101.68,101.68,101.25,101.24,101.11,101.08,101.09,101.09,101.62,101.66,101.96,102.04,102.02,102.02,101.51,101.62,101.83,102.06,102.14,102.14,102.59,102.92,103.31,103.54,103.58,103.58,102.83,102.86,103.03,103.2,103.28,103.28,103.79,103.92,104.26,104.41,104.45,99.92,99.18,99.18,99.35,99.62,99.67,99.72,100.08,100.39,100.77,101.03,101.07,101.29,101.1,101.2,101.15,101.24,101.16,100.81,101.02,101.15,101.06,101.17,101.22) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 98.85 99.32 99.68 100.86 101.68 102.02 103.58 99.92 101.29 NA [2,] 98.86 99.17 99.52 100.39 101.25 101.51 102.83 99.18 101.10 NA [3,] 98.86 99.13 99.69 100.61 101.24 101.62 102.86 99.18 101.20 NA [4,] 98.89 99.12 99.70 100.67 101.11 101.83 103.03 99.35 101.15 NA [5,] 98.85 99.23 99.85 100.81 101.08 102.06 103.20 99.62 101.24 NA [6,] 98.85 99.25 99.94 100.86 101.09 102.14 103.28 99.67 101.16 NA [7,] 98.85 99.25 99.94 100.86 101.09 102.14 103.28 99.72 100.81 NA [8,] 98.96 99.36 99.93 100.98 101.62 102.59 103.79 100.08 101.02 NA [9,] 98.99 99.43 100.19 101.03 101.66 102.92 103.92 100.39 101.15 NA [10,] 99.21 99.57 100.57 101.37 101.96 103.31 104.26 100.77 101.06 NA [11,] 99.29 99.64 100.76 101.64 102.04 103.54 104.41 101.03 101.17 NA [12,] 99.32 99.68 100.86 101.68 102.02 103.58 104.45 101.07 101.22 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.01 -0.15 -0.16 -0.47 -0.43 -0.51 -0.75 -0.74 -0.19 NA [2,] 0.00 -0.04 0.17 0.22 -0.01 0.11 0.03 0.00 0.10 NA [3,] 0.03 -0.01 0.01 0.06 -0.13 0.21 0.17 0.17 -0.05 NA [4,] -0.04 0.11 0.15 0.14 -0.03 0.23 0.17 0.27 0.09 NA [5,] 0.00 0.02 0.09 0.05 0.01 0.08 0.08 0.05 -0.08 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.05 -0.35 NA [7,] 0.11 0.11 -0.01 0.12 0.53 0.45 0.51 0.36 0.21 NA [8,] 0.03 0.07 0.26 0.05 0.04 0.33 0.13 0.31 0.13 NA [9,] 0.22 0.14 0.38 0.34 0.30 0.39 0.34 0.38 -0.09 NA [10,] 0.08 0.07 0.19 0.27 0.08 0.23 0.15 0.26 0.11 NA [11,] 0.03 0.04 0.10 0.04 -0.02 0.04 0.04 0.04 0.05 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 -4.53 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/105bn1445174575.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/2rc3f1445174575.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/39tqm1445174575.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/4gxg61445174575.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,] 98.85 98.86 98.86 98.89 98.85 98.85 98.85 98.96 98.99 99.21 [2,] 99.68 99.18 99.18 99.35 99.62 99.67 99.72 99.93 100.19 100.57 [3,] 100.86 100.39 100.61 100.67 100.81 100.86 100.81 100.98 101.03 101.06 [4,] 101.68 101.25 101.24 101.15 101.24 101.16 101.09 101.62 101.66 101.96 [5,] 103.58 102.83 102.86 103.03 103.20 103.28 102.14 103.79 102.92 103.31 [,11] [,12] [1,] 99.29 99.32 [2,] 100.76 100.86 [3,] 101.17 101.22 [4,] 102.04 102.02 [5,] 103.54 103.58 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 99.80667 99.2998 99.52507 99.722 99.9568 100.0753 100.0885 100.0899 [2,] 101.91333 101.4802 101.69493 101.618 101.6632 101.6447 101.5315 101.8701 [,9] [,10] [,11] [,12] [1,] 100.2558 100.3279 100.4959 100.6091 [2,] 101.8042 101.7921 101.8441 101.8309 $out [1] 103.28 103.92 104.26 104.41 104.45 $group [1] 7 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.85, 99.68, 100.86, 101.68, 103.58, 98.86, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5c2ks1445174575.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.75 -0.04 -0.13 -0.03 -0.08 0 -0.01 0.03 0.14 0.07 0.04 0 [2,] -0.51 0.00 -0.01 0.09 0.01 0 0.11 0.05 0.22 0.08 0.04 0 [3,] -0.43 0.03 0.03 0.14 0.05 0 0.21 0.13 0.34 0.15 0.04 0 [4,] -0.16 0.11 0.17 0.17 0.08 0 0.45 0.26 0.38 0.23 0.04 0 [5,] 0.01 0.22 0.21 0.27 0.09 0 0.53 0.33 0.39 0.27 0.04 0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.6143333 -0.02793333 -0.0648 0.09786667 0.01313333 0 0.03093333 [2,] -0.2456667 0.08793333 0.1248 0.18213333 0.08686667 0 0.38906667 [,8] [,9] [,10] [,11] [,12] [1,] 0.0194 0.2557333 0.071 0.04 0 [2,] 0.2406 0.4242667 0.229 0.04 0 $out [1] -0.04 0.05 -0.35 -0.09 0.03 0.10 -0.02 0.05 -4.53 0.22 $group [1] 4 6 6 9 11 11 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.75, -0.509999999999991, -0.430000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6f24l1445174575.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] [,8] [,9] [,10] [1,] 98.850 99.120 99.520 100.39 101.080 101.510 102.830 99.180 101.020 NA [2,] 98.850 99.200 99.695 100.74 101.100 101.925 103.115 99.485 101.080 NA [3,] 98.875 99.285 99.935 100.86 101.435 102.140 103.430 99.820 101.155 NA [4,] 99.100 99.500 100.380 101.20 101.820 103.115 104.090 100.580 101.210 NA [5,] 99.320 99.680 100.860 101.68 102.040 103.580 104.450 101.070 101.290 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.76097 99.14817 99.62257 100.6502 101.1066 101.5972 102.9853 99.32056 [2,] 98.98903 99.42183 100.24743 101.0698 101.7634 102.6828 103.8747 100.31944 [,9] [,10] [1,] 101.0957 NA [2,] 101.2143 NA $out [1] 100.81 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(98.85, 98.85, 98.875, 99.1, 99.32, 99.12, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wzny1445174575.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,] 100.4233 100.390 100.2100 [2,] 100.5994 100.740 100.3275 [3,] 100.7467 100.860 100.5550 [4,] 101.2089 101.045 101.0950 [5,] 101.5422 101.220 101.4400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.4687 100.7209 100.2049 [2,] 101.0246 100.9991 100.9051 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.423333333333, 100.599444444444, 100.746666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/105bn1445174575.ps tmp/105bn1445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/2rc3f1445174575.ps tmp/2rc3f1445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/39tqm1445174575.ps tmp/39tqm1445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/4gxg61445174575.ps tmp/4gxg61445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/5c2ks1445174575.ps tmp/5c2ks1445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/6f24l1445174575.ps tmp/6f24l1445174575.png",intern=TRUE)) character(0) > try(system("convert tmp/7wzny1445174575.ps tmp/7wzny1445174575.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.509 0.449 2.990