R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(101.74,100.73,100.86,100.78,100.76,100.77,100.77,101.93,101.98,102.47,102.59,102.54,102.54,101.29,101.49,101.71,101.98,102.11,102.11,103.13,103.43,103.8,103.99,104.03,104.03,102.58,102.65,102.81,102.98,103.12,103.12,104.33,104.41,104.66,104.81,104.9,100.15,98.74,98.74,98.96,99.34,99.4,99.5,100.5,100.77,101.08,101.39,101.43,101.43,101.29,101.33,101.15,101.25,101.13,101.07,101.33,101.61,101.29,101.39,101.46,101.81,101.78,101.93,102.01,102.03,102.14,101.81,101.52,101.38,101.5,101.65,101.64) > 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,] 101.74 102.54 104.03 100.15 101.43 101.81 NA [2,] 100.73 101.29 102.58 98.74 101.29 101.78 NA [3,] 100.86 101.49 102.65 98.74 101.33 101.93 NA [4,] 100.78 101.71 102.81 98.96 101.15 102.01 NA [5,] 100.76 101.98 102.98 99.34 101.25 102.03 NA [6,] 100.77 102.11 103.12 99.40 101.13 102.14 NA [7,] 100.77 102.11 103.12 99.50 101.07 101.81 NA [8,] 101.93 103.13 104.33 100.50 101.33 101.52 NA [9,] 101.98 103.43 104.41 100.77 101.61 101.38 NA [10,] 102.47 103.80 104.66 101.08 101.29 101.50 NA [11,] 102.59 103.99 104.81 101.39 101.39 101.65 NA [12,] 102.54 104.03 104.90 101.43 101.46 101.64 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.01 -1.25 -1.45 -1.41 -0.14 -0.03 NA [2,] 0.13 0.20 0.07 0.00 0.04 0.15 NA [3,] -0.08 0.22 0.16 0.22 -0.18 0.08 NA [4,] -0.02 0.27 0.17 0.38 0.10 0.02 NA [5,] 0.01 0.13 0.14 0.06 -0.12 0.11 NA [6,] 0.00 0.00 0.00 0.10 -0.06 -0.33 NA [7,] 1.16 1.02 1.21 1.00 0.26 -0.29 NA [8,] 0.05 0.30 0.08 0.27 0.28 -0.14 NA [9,] 0.49 0.37 0.25 0.31 -0.32 0.12 NA [10,] 0.12 0.19 0.15 0.31 0.10 0.15 NA [11,] -0.05 0.04 0.09 0.04 0.07 -0.01 NA [12,] 0.00 0.00 -4.75 0.00 0.35 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/12tg81489855235.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/2voz71489855235.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/3tnp01489855235.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/49y711489855235.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,] 100.150 100.73 100.86 98.96 99.340 99.40 99.50 100.500 100.770 101.080 [2,] 101.430 100.73 100.86 100.78 100.760 100.77 100.77 101.330 101.380 101.290 [3,] 101.775 101.29 101.41 101.43 101.615 101.62 101.44 101.725 101.795 101.985 [4,] 102.540 101.78 101.93 102.01 102.030 102.14 102.11 103.130 103.430 103.800 [5,] 104.030 102.58 102.65 102.81 102.980 103.12 103.12 104.330 104.410 104.660 [,11] [,12] [1,] 101.39 101.43 [2,] 101.39 101.46 [3,] 102.12 102.09 [4,] 103.99 104.03 [5,] 104.81 104.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.059 100.6127 100.7198 100.6366 100.7958 100.7363 100.5757 100.5639 [2,] 102.491 101.9673 102.1002 102.2234 102.4342 102.5037 102.3043 102.8861 [,9] [,10] [,11] [,12] [1,] 100.4727 100.366 100.4429 100.4323 [2,] 103.1173 103.604 103.7971 103.7477 $out [1] 98.74 98.74 $group [1] 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(100.15, 101.43, 101.775, 102.54, 104.03, 100.73, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5qwcw1489855235.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,] -1.45 0.00 -0.18 -0.020 -0.120 -0.06 -0.29 -0.140 0.12 0.10 -0.05 0 [2,] -1.41 0.04 -0.08 0.020 0.010 -0.06 0.26 0.050 0.12 0.12 -0.01 0 [3,] -1.13 0.10 0.12 0.135 0.085 0.00 1.01 0.175 0.28 0.15 0.04 0 [4,] -0.14 0.15 0.22 0.270 0.130 0.00 1.16 0.280 0.37 0.19 0.07 0 [5,] -0.03 0.20 0.22 0.380 0.140 0.00 1.21 0.300 0.49 0.19 0.09 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.949191 0.02904645 -0.07350969 -0.02625807 0.007596124 -0.03870194 [2,] -0.310809 0.17095355 0.31350969 0.29625807 0.162403876 0.03870194 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.4294709 0.02664257 0.1187419 0.1048477 -0.01160258 0 [2,] 1.5905291 0.32335743 0.4412581 0.1951523 0.09160258 0 $out [1] 0.10 -0.33 -0.32 0.31 -4.75 0.35 $group [1] 6 6 9 10 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.45, -1.41000000000001, -1.13, -0.140000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6cetj1489855235.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,] 100.730 101.290 102.580 98.740 101.07 101.380 NA [2,] 100.770 101.845 102.895 99.150 101.20 101.580 NA [3,] 101.300 102.325 103.575 99.825 101.31 101.795 NA [4,] 102.225 103.615 104.535 100.925 101.41 101.970 NA [5,] 102.590 104.030 104.900 101.430 101.61 102.140 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 100.6364 101.5177 102.827 99.01541 101.2142 101.6171 NA [2,] 101.9636 103.1323 104.323 100.63459 101.4058 101.9729 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(100.73, 100.77, 101.3, 102.225, 102.59, 101.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7z6l91489855235.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,] 101.0683 101.2900 101.2638 [2,] 101.3133 101.4350 101.4219 [3,] 101.6975 101.6725 101.7144 [4,] 102.3650 101.8900 102.3287 [5,] 102.6667 102.1200 102.5813 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.2178 101.465 101.3007 [2,] 102.1772 101.880 102.1280 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.068333333333, 101.313333333333, 101.6975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12tg81489855235.ps tmp/12tg81489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/2voz71489855235.ps tmp/2voz71489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/3tnp01489855235.ps tmp/3tnp01489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/49y711489855235.ps tmp/49y711489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/5qwcw1489855235.ps tmp/5qwcw1489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/6cetj1489855235.ps tmp/6cetj1489855235.png",intern=TRUE)) character(0) > try(system("convert tmp/7z6l91489855235.ps tmp/7z6l91489855235.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.842 0.218 3.124