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(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,101.84,101.79,101.88,101.9,101.91,101.96,101.26,101.06,100.98,101.12,101.24,101.25) > 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.68 102.02 103.58 99.92 101.29 101.84 NA [2,] 101.25 101.51 102.83 99.18 101.10 101.79 NA [3,] 101.24 101.62 102.86 99.18 101.20 101.88 NA [4,] 101.11 101.83 103.03 99.35 101.15 101.90 NA [5,] 101.08 102.06 103.20 99.62 101.24 101.91 NA [6,] 101.09 102.14 103.28 99.67 101.16 101.96 NA [7,] 101.09 102.14 103.28 99.72 100.81 101.26 NA [8,] 101.62 102.59 103.79 100.08 101.02 101.06 NA [9,] 101.66 102.92 103.92 100.39 101.15 100.98 NA [10,] 101.96 103.31 104.26 100.77 101.06 101.12 NA [11,] 102.04 103.54 104.41 101.03 101.17 101.24 NA [12,] 102.02 103.58 104.45 101.07 101.22 101.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.43 -0.51 -0.75 -0.74 -0.19 -0.05 NA [2,] -0.01 0.11 0.03 0.00 0.10 0.09 NA [3,] -0.13 0.21 0.17 0.17 -0.05 0.02 NA [4,] -0.03 0.23 0.17 0.27 0.09 0.01 NA [5,] 0.01 0.08 0.08 0.05 -0.08 0.05 NA [6,] 0.00 0.00 0.00 0.05 -0.35 -0.70 NA [7,] 0.53 0.45 0.51 0.36 0.21 -0.20 NA [8,] 0.04 0.33 0.13 0.31 0.13 -0.08 NA [9,] 0.30 0.39 0.34 0.38 -0.09 0.14 NA [10,] 0.08 0.23 0.15 0.26 0.11 0.12 NA [11,] -0.02 0.04 0.04 0.04 0.05 0.01 NA [12,] 0.00 0.00 -4.53 0.22 0.62 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/18o3t1457009273.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/2daf91457009273.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/383yk1457009273.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/4hszo1457009273.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,] 101.29 101.10 101.20 101.11 99.620 99.67 99.720 100.08 100.390 100.77 [2,] 101.29 101.10 101.20 101.11 101.080 101.09 100.810 101.02 100.980 101.06 [3,] 101.76 101.38 101.43 101.49 101.575 101.56 101.175 101.34 101.405 101.54 [4,] 102.02 101.79 101.88 101.90 102.060 102.14 102.140 102.59 102.920 103.31 [5,] 102.02 101.79 102.86 103.03 103.200 103.28 103.280 103.79 103.920 104.26 [,11] [,12] [1,] 101.03 101.070 [2,] 101.17 101.220 [3,] 101.64 101.635 [4,] 103.54 103.580 [5,] 104.41 104.450 $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.2891 100.9349 100.9914 100.9804 100.9429 100.8827 100.3171 100.3273 [2,] 102.2309 101.8251 101.8686 101.9996 102.2071 102.2373 102.0329 102.3527 [,9] [,10] [,11] [,12] [1,] 100.1536 100.0887 100.1113 100.1127 [2,] 102.6564 102.9913 103.1687 103.1573 $out [1] 103.58 99.92 102.83 99.18 99.18 99.35 $group [1] 1 1 2 2 3 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(101.29, 101.29, 101.76, 102.02, 102.02, 101.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yq271457009273.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.01 -0.130 -0.03 -0.08 -0.70 -0.200 -0.08 -0.09 0.080 -0.02 0.00 [2,] -0.74 0.00 -0.050 0.01 0.01 -0.35 0.210 0.04 0.14 0.110 0.01 0.00 [3,] -0.47 0.06 0.095 0.13 0.05 0.00 0.405 0.13 0.32 0.135 0.04 0.00 [4,] -0.19 0.10 0.170 0.23 0.08 0.00 0.510 0.31 0.38 0.230 0.04 0.22 [5,] -0.05 0.11 0.210 0.27 0.08 0.05 0.530 0.33 0.39 0.260 0.05 0.22 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.8247678 -0.00450323 -0.04690711 -0.01190711 0.004847739 -0.2257613 [2,] -0.1152322 0.12450323 0.23690711 0.27190711 0.095152261 0.2257613 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.2114903 -0.04415872 0.1651922 0.05759612 0.02064903 -0.1554514 [2,] 0.5985097 0.30415872 0.4748078 0.21240388 0.05935097 0.1554514 $out [1] -4.53 0.62 $group [1] 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.739999999999995, -0.469999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6yx161457009273.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,] 101.080 101.510 102.830 99.180 101.020 100.980 NA [2,] 101.100 101.925 103.115 99.485 101.080 101.180 NA [3,] 101.435 102.140 103.430 99.820 101.155 101.525 NA [4,] 101.820 103.115 104.090 100.580 101.210 101.890 NA [5,] 102.040 103.580 104.450 101.070 101.290 101.960 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 101.1066 101.5972 102.9853 99.32056 101.0957 101.2012 NA [2,] 101.7634 102.6828 103.8747 100.31944 101.2143 101.8488 NA $out [1] 100.81 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.08, 101.1, 101.435, 101.82, 102.04, 101.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70ete1457009273.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.2767 101.1750 101.4000 [2,] 101.3892 101.3925 101.5069 [3,] 101.6217 101.5150 101.6412 [4,] 101.9583 101.6050 101.9188 [5,] 102.2650 101.7600 102.2087 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.3621 101.4181 101.4534 [2,] 101.8813 101.6119 101.8291 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(101.276666666667, 101.389166666667, 101.621666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18o3t1457009273.ps tmp/18o3t1457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/2daf91457009273.ps tmp/2daf91457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/383yk1457009273.ps tmp/383yk1457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/4hszo1457009273.ps tmp/4hszo1457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/5yq271457009273.ps tmp/5yq271457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/6yx161457009273.ps tmp/6yx161457009273.png",intern=TRUE)) character(0) > try(system("convert tmp/70ete1457009273.ps tmp/70ete1457009273.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.545 0.392 2.977