R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(102.8,103.66,103.55,103.87,104.03,104.02,104.02,102.97,103.18,103.53,103.78,103.85,103.85,104.78,104.76,104.84,104.85,104.83,104.83,103.71,103.84,104.37,104.44,104.4,99.54,100.42,100.34,100.36,100.37,100.42,100.41,99.13,99.42,99.76,99.92,99.92,100.47,100.44,100.47,100.61,100.73,100.64,99.99,99.74,99.49,99.41,99.49,99.53,99.91,99.84,99.67,99.39,99.38,99.29,97.91,97.62,97.67,97.64,97.63,97.66) > 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,] 102.80 103.85 99.54 100.47 99.91 NA [2,] 103.66 104.78 100.42 100.44 99.84 NA [3,] 103.55 104.76 100.34 100.47 99.67 NA [4,] 103.87 104.84 100.36 100.61 99.39 NA [5,] 104.03 104.85 100.37 100.73 99.38 NA [6,] 104.02 104.83 100.42 100.64 99.29 NA [7,] 104.02 104.83 100.41 99.99 97.91 NA [8,] 102.97 103.71 99.13 99.74 97.62 NA [9,] 103.18 103.84 99.42 99.49 97.67 NA [10,] 103.53 104.37 99.76 99.41 97.64 NA [11,] 103.78 104.44 99.92 99.49 97.63 NA [12,] 103.85 104.40 99.92 99.53 97.66 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.86 0.93 0.88 -0.03 -0.07 NA [2,] -0.11 -0.02 -0.08 0.03 -0.17 NA [3,] 0.32 0.08 0.02 0.14 -0.28 NA [4,] 0.16 0.01 0.01 0.12 -0.01 NA [5,] -0.01 -0.02 0.05 -0.09 -0.09 NA [6,] 0.00 0.00 -0.01 -0.65 -1.38 NA [7,] -1.05 -1.12 -1.28 -0.25 -0.29 NA [8,] 0.21 0.13 0.29 -0.25 0.05 NA [9,] 0.35 0.53 0.34 -0.08 -0.03 NA [10,] 0.25 0.07 0.16 0.08 -0.01 NA [11,] 0.07 -0.04 0.00 0.04 0.03 NA [12,] 0.00 -4.86 0.55 0.38 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/1t1ri1476265714.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/2bna91476265714.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/3jb2m1476265714.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/4j8vv1476265714.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,] 99.54 99.84 99.67 99.39 99.38 99.29 97.91 97.62 97.67 97.64 [2,] 99.91 100.42 100.34 100.36 100.37 100.42 99.99 99.13 99.42 99.41 [3,] 100.47 100.44 100.47 100.61 100.73 100.64 100.41 99.74 99.49 99.76 [4,] 102.80 103.66 103.55 103.87 104.03 104.02 104.02 102.97 103.18 103.53 [5,] 103.85 104.78 104.76 104.84 104.85 104.83 104.83 103.71 103.84 104.37 [,11] [,12] [1,] 97.63 97.66 [2,] 99.49 99.53 [3,] 99.92 99.92 [4,] 103.78 103.85 [5,] 104.44 104.40 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.42793 98.15062 98.20182 98.12984 98.14385 98.09625 97.56241 [2,] 102.51207 102.72938 102.73818 103.09016 103.31615 103.18375 103.25759 [,8] [,9] [,10] [,11] [,12] [1,] 97.02667 96.83319 96.84882 96.8887 96.8675 [2,] 102.45333 102.14681 102.67118 102.9513 102.9725 $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(99.54, 99.91, 100.47, 102.8, 103.85, 99.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5u1i31476265714.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.07 -0.17 0.02 -0.01 -0.09 -1.38 -1.28 0.05 -0.08 -0.01 -0.04 -4.860 [2,] -0.03 -0.11 0.02 0.01 -0.09 -0.65 -1.12 0.05 -0.03 0.07 0.00 -2.430 [3,] 0.86 -0.08 0.08 0.01 -0.02 -0.01 -1.05 0.13 0.34 0.08 0.03 0.190 [4,] 0.88 -0.02 0.14 0.12 -0.01 0.00 -0.29 0.21 0.35 0.16 0.04 0.465 [5,] 0.93 0.03 0.32 0.16 0.05 0.00 -0.25 0.29 0.53 0.25 0.07 0.550 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.2169963 -0.14359377 -0.004791698 -0.06772572 -0.0765278 -0.4692884 [2,] 1.5030037 -0.01640623 0.164791698 0.08772572 0.0365278 0.4492884 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -1.6364759 0.0169444 0.07149296 0.01640623 0.001736101 -2.09705 [2,] -0.4635241 0.2430556 0.60850704 0.14359377 0.058263899 2.47705 $out [1] -0.28 -0.25 $group [1] 3 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0699999999999932, -0.0300000000000011, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6i4zk1476265714.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,] 102.800 103.71 99.13 99.410 97.62 NA [2,] 103.355 104.11 99.65 99.510 97.65 NA [3,] 103.720 104.60 100.13 100.215 98.60 NA [4,] 103.945 104.83 100.39 100.540 99.53 NA [5,] 104.030 104.85 100.42 100.730 99.91 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.4509 104.2716 99.79248 99.74521 97.74252 NA [2,] 103.9891 104.9284 100.46752 100.68479 99.45748 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(102.8, 103.355, 103.72, 103.945, 104.03, 103.71, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7e15g1476265714.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.634 99.490 101.0500 [2,] 100.997 99.840 101.4125 [3,] 101.373 100.425 101.8175 [4,] 101.821 100.540 102.0775 [5,] 101.872 100.730 102.2200 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.9972 100.1057 101.5142 [2,] 101.7488 100.7443 102.1208 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.634, 100.997, 101.373, 101.821, 101.872, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1t1ri1476265714.ps tmp/1t1ri1476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/2bna91476265714.ps tmp/2bna91476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/3jb2m1476265714.ps tmp/3jb2m1476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/4j8vv1476265714.ps tmp/4j8vv1476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/5u1i31476265714.ps tmp/5u1i31476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/6i4zk1476265714.ps tmp/6i4zk1476265714.png",intern=TRUE)) character(0) > try(system("convert tmp/7e15g1476265714.ps tmp/7e15g1476265714.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.459 0.188 2.700