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.49,92.46,92.55,92.24,92.41,92.83,92.85,93.04,93.04,92.83,92.96,92.83,93.01,93.21,93.58,94.07,94.57,95.03,95.21,95.89,96.43,96.35,96.71,96.32,97.23,97.88,98.2,98.56,99.31,99.69,99.77,101.06,101.77,101.91,102.52,102.09,102.22,102.74,103.56,104.4,104.76,104.86,104.84,104.96,104.83,104.58,104.8,104.17,104.63,105.32,106.16,107.22,107.51,107.87,107.79,108.04,107.74,107.71,111.19,110.82) > 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.49 93.01 97.23 102.22 104.63 NA [2,] 92.46 93.21 97.88 102.74 105.32 NA [3,] 92.55 93.58 98.20 103.56 106.16 NA [4,] 92.24 94.07 98.56 104.40 107.22 NA [5,] 92.41 94.57 99.31 104.76 107.51 NA [6,] 92.83 95.03 99.69 104.86 107.87 NA [7,] 92.85 95.21 99.77 104.84 107.79 NA [8,] 93.04 95.89 101.06 104.96 108.04 NA [9,] 93.04 96.43 101.77 104.83 107.74 NA [10,] 92.83 96.35 101.91 104.58 107.71 NA [11,] 92.96 96.71 102.52 104.80 111.19 NA [12,] 92.83 96.32 102.09 104.17 110.82 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.03 0.20 0.65 0.52 0.69 NA [2,] 0.09 0.37 0.32 0.82 0.84 NA [3,] -0.31 0.49 0.36 0.84 1.06 NA [4,] 0.17 0.50 0.75 0.36 0.29 NA [5,] 0.42 0.46 0.38 0.10 0.36 NA [6,] 0.02 0.18 0.08 -0.02 -0.08 NA [7,] 0.19 0.68 1.29 0.12 0.25 NA [8,] 0.00 0.54 0.71 -0.13 -0.30 NA [9,] -0.21 -0.08 0.14 -0.25 -0.03 NA [10,] 0.13 0.36 0.61 0.22 3.48 NA [11,] -0.13 -0.39 -0.43 -0.63 -0.37 NA [12,] 0.18 0.91 0.13 0.46 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/1u3zy1457186399.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/2wgwf1457186399.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/32mrl1457186399.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/4uj181457186399.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.49 92.46 92.55 92.24 92.41 92.83 92.85 93.04 93.04 92.83 [2,] 93.01 93.21 93.58 94.07 94.57 95.03 95.21 95.89 96.43 96.35 [3,] 97.23 97.88 98.20 98.56 99.31 99.69 99.77 101.06 101.77 101.91 [4,] 102.22 102.74 103.56 104.40 104.76 104.86 104.84 104.96 104.83 104.58 [5,] 104.63 105.32 106.16 107.22 107.51 107.87 107.79 108.04 107.74 107.71 [,11] [,12] [1,] 92.96 92.83 [2,] 96.71 96.32 [3,] 102.52 102.09 [4,] 104.80 104.17 [5,] 111.19 110.82 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.72224 91.14613 91.14816 91.26085 92.10977 92.74415 92.96547 [2,] 103.73776 104.61387 105.25184 105.85915 106.51023 106.63585 106.57453 [,8] [,9] [,10] [,11] [,12] [1,] 94.65116 95.83458 96.0947 96.80363 96.54321 [2,] 107.46884 107.70542 107.7253 108.23637 107.63679 $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.49, 93.01, 97.23, 102.22, 104.63, 92.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/58i011457186399.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.03 0.09 -0.31 0.17 0.36 -0.08 0.12 -0.30 -0.25 0.13 -0.43 0.130 [2,] 0.20 0.32 0.36 0.29 0.36 -0.02 0.19 -0.13 -0.21 0.22 -0.43 0.155 [3,] 0.52 0.37 0.49 0.36 0.38 0.02 0.25 0.00 -0.08 0.36 -0.39 0.320 [4,] 0.65 0.82 0.84 0.50 0.42 0.08 0.68 0.54 -0.03 0.61 -0.37 0.685 [5,] 0.69 0.84 1.06 0.75 0.46 0.18 1.29 0.71 0.14 0.61 -0.37 0.910 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2020311 0.01670126 0.1508332 0.2116145 0.3376042 -0.05065975 -0.09623277 [2,] 0.8379689 0.72329874 0.8291668 0.5083855 0.4223958 0.09065975 0.59623277 [,8] [,9] [,10] [,11] [,12] [1,] -0.4734203 -0.20718755 0.08442698 -0.4323958 -0.0987 [2,] 0.4734203 0.04718755 0.63557302 -0.3476042 0.7387 $out [1] 0.10 3.48 -0.13 -0.63 $group [1] 5 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0300000000000011, 0.199999999999989, 0.519999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rh5q1457186399.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.240 93.010 97.23 102.740 105.320 NA [2,] 92.475 93.825 98.38 103.865 106.690 NA [3,] 92.830 95.120 99.73 104.670 107.725 NA [4,] 92.905 96.335 101.84 104.835 107.955 NA [5,] 93.040 96.710 102.52 104.960 108.040 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 92.63387 93.97517 98.15187 104.2276 107.148 NA [2,] 93.02613 96.26483 101.30813 105.1124 108.302 NA $out [1] 102.22 104.63 111.19 110.82 $group [1] 4 5 5 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.24, 92.475, 92.83, 92.905, 93.04, 93.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fmds1457186399.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.916 97.23 97.6150 [2,] 99.054 98.38 98.9025 [3,] 100.074 99.73 99.9850 [4,] 100.719 101.84 100.4450 [5,] 101.636 102.52 100.7550 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.31458 98.15187 99.28146 [2,] 100.83342 101.30813 100.68854 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.916, 99.054, 100.074, 100.719, 101.636, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u3zy1457186399.ps tmp/1u3zy1457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/2wgwf1457186399.ps tmp/2wgwf1457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/32mrl1457186399.ps tmp/32mrl1457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/4uj181457186399.ps tmp/4uj181457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/58i011457186399.ps tmp/58i011457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/6rh5q1457186399.ps tmp/6rh5q1457186399.png",intern=TRUE)) character(0) > try(system("convert tmp/7fmds1457186399.ps tmp/7fmds1457186399.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.738 0.422 3.190