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(91.27,91.51,91.78,91.83,92.01,92.1,92.35,92.46,93.08,93.38,93.46,93.58,93.74,94.18,94.43,94.53,94.66,94.8,95.04,95.29,95.42,95.64,95.82,96.01,96.16,96.4,96.87,97,97.26,97.42,97.64,97.93,98.1,98.29,98.42,98.49,98.67,99.1,99.37,99.54,99.58,99.77,100.06,100.26,100.57,100.94,101.03,101.12,101.26,101.94,102.26,102.51,102.61,102.76,103.04,103.22,103.47,103.64,103.76,103.85) > 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,] 91.27 93.74 96.16 98.67 101.26 NA [2,] 91.51 94.18 96.40 99.10 101.94 NA [3,] 91.78 94.43 96.87 99.37 102.26 NA [4,] 91.83 94.53 97.00 99.54 102.51 NA [5,] 92.01 94.66 97.26 99.58 102.61 NA [6,] 92.10 94.80 97.42 99.77 102.76 NA [7,] 92.35 95.04 97.64 100.06 103.04 NA [8,] 92.46 95.29 97.93 100.26 103.22 NA [9,] 93.08 95.42 98.10 100.57 103.47 NA [10,] 93.38 95.64 98.29 100.94 103.64 NA [11,] 93.46 95.82 98.42 101.03 103.76 NA [12,] 93.58 96.01 98.49 101.12 103.85 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.24 0.44 0.24 0.43 0.68 NA [2,] 0.27 0.25 0.47 0.27 0.32 NA [3,] 0.05 0.10 0.13 0.17 0.25 NA [4,] 0.18 0.13 0.26 0.04 0.10 NA [5,] 0.09 0.14 0.16 0.19 0.15 NA [6,] 0.25 0.24 0.22 0.29 0.28 NA [7,] 0.11 0.25 0.29 0.20 0.18 NA [8,] 0.62 0.13 0.17 0.31 0.25 NA [9,] 0.30 0.22 0.19 0.37 0.17 NA [10,] 0.08 0.18 0.13 0.09 0.12 NA [11,] 0.12 0.19 0.07 0.09 0.09 NA [12,] 0.16 0.15 0.18 0.14 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/1e5oz1457391684.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/2v7wb1457391684.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/3pd0t1457391684.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/4v3wq1457391684.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,] 91.27 91.51 91.78 91.83 92.01 92.10 92.35 92.46 93.08 93.38 [2,] 93.74 94.18 94.43 94.53 94.66 94.80 95.04 95.29 95.42 95.64 [3,] 96.16 96.40 96.87 97.00 97.26 97.42 97.64 97.93 98.10 98.29 [4,] 98.67 99.10 99.37 99.54 99.58 99.77 100.06 100.26 100.57 100.94 [5,] 101.26 101.94 102.26 102.51 102.61 102.76 103.04 103.22 103.47 103.64 [,11] [,12] [1,] 93.46 93.58 [2,] 95.82 96.01 [3,] 98.42 98.49 [4,] 101.03 101.12 [5,] 103.76 103.85 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 92.67647 92.92354 93.37941 93.45995 93.78354 93.90821 94.09288 [2,] 99.64353 99.87646 100.36059 100.54005 100.73646 100.93179 101.18712 [,8] [,9] [,10] [,11] [,12] [1,] 94.41821 94.46102 94.54503 94.73863 94.87929 [2,] 101.44179 101.73898 102.03497 102.10137 102.10071 $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(91.27, 93.74, 96.16, 98.67, 101.26, 91.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fzdk1457391684.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.24 0.25 0.05 0.04 0.14 0.22 0.11 0.13 0.17 0.08 0.07 0.140 [2,] 0.24 0.27 0.10 0.10 0.14 0.24 0.18 0.17 0.19 0.09 0.09 0.145 [3,] 0.43 0.27 0.13 0.13 0.15 0.25 0.20 0.25 0.22 0.12 0.09 0.155 [4,] 0.44 0.32 0.17 0.18 0.16 0.28 0.25 0.31 0.30 0.13 0.12 0.170 [5,] 0.68 0.32 0.25 0.26 0.16 0.29 0.29 0.31 0.37 0.18 0.12 0.180 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2886805 0.2346701 0.08053818 0.0734722 0.1358681 0.2217361 0.1505382 [2,] 0.5713195 0.3053299 0.17946182 0.1865278 0.1641319 0.2782639 0.2494618 [,8] [,9] [,10] [,11] [,12] [1,] 0.1510764 0.1422743 0.0917361 0.06880208 0.13525 [2,] 0.3489236 0.2977257 0.1482639 0.11119792 0.17475 $out [1] 0.47 0.09 0.19 0.62 0.19 $group [1] 2 5 5 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.240000000000009, 0.240000000000009, 0.429999999999993, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6obcs1457391684.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,] 91.270 93.74 96.160 98.670 101.260 NA [2,] 91.805 94.48 96.935 99.455 102.385 NA [3,] 92.225 94.92 97.530 99.915 102.900 NA [4,] 93.230 95.53 98.195 100.755 103.555 NA [5,] 93.580 96.01 98.490 101.120 103.850 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 91.57505 94.44109 96.95531 99.32206 102.3664 NA [2,] 92.87495 95.39891 98.10469 100.50794 103.4336 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(91.27, 91.805, 92.225, 93.23, 93.58, 93.74, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7j8um1457391684.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.220 96.160 96.2050 [2,] 97.012 96.935 96.9675 [3,] 97.498 97.530 97.4175 [4,] 98.253 98.195 98.1425 [5,] 98.610 98.490 98.5650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 96.93197 96.95531 96.88157 [2,] 98.06403 98.10469 97.95343 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.22, 97.012, 97.498, 98.253, 98.61, 96.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e5oz1457391684.ps tmp/1e5oz1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/2v7wb1457391684.ps tmp/2v7wb1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/3pd0t1457391684.ps tmp/3pd0t1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/4v3wq1457391684.ps tmp/4v3wq1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/5fzdk1457391684.ps tmp/5fzdk1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/6obcs1457391684.ps tmp/6obcs1457391684.png",intern=TRUE)) character(0) > try(system("convert tmp/7j8um1457391684.ps tmp/7j8um1457391684.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.575 0.459 3.062