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(83.61,83.89,83.4,82.96,82.76,83.35,87.78,88.99,88.92,88.91,89.79,90.54,93.15,92.79,93.21,95.35,100.91,103.69,104.04,104.16,104.71,105.18,104.92,104.83,104.9,105.05,104.6,103.21,102.52,101.09,101.19,102.34,102.62,102.47,101.82,101.86,101.54,101.98,101.23,100.4,99.94,99.94,100,98.8,99.07,99.46,99.18,98.47,97.12,96.91,96.09,97.17,96.8,97.13,99.9,100.56,100.84,99.81,100.44,100.07,101.32,103.98,104.81,106.23,106.48,107.59,107.16,107.54,107.1,106.38,106.64,106.13) > 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,] 83.61 93.15 104.90 101.54 97.12 101.32 NA [2,] 83.89 92.79 105.05 101.98 96.91 103.98 NA [3,] 83.40 93.21 104.60 101.23 96.09 104.81 NA [4,] 82.96 95.35 103.21 100.40 97.17 106.23 NA [5,] 82.76 100.91 102.52 99.94 96.80 106.48 NA [6,] 83.35 103.69 101.09 99.94 97.13 107.59 NA [7,] 87.78 104.04 101.19 100.00 99.90 107.16 NA [8,] 88.99 104.16 102.34 98.80 100.56 107.54 NA [9,] 88.92 104.71 102.62 99.07 100.84 107.10 NA [10,] 88.91 105.18 102.47 99.46 99.81 106.38 NA [11,] 89.79 104.92 101.82 99.18 100.44 106.64 NA [12,] 90.54 104.83 101.86 98.47 100.07 106.13 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.28 -0.36 0.15 0.44 -0.21 2.66 NA [2,] -0.49 0.42 -0.45 -0.75 -0.82 0.83 NA [3,] -0.44 2.14 -1.39 -0.83 1.08 1.42 NA [4,] -0.20 5.56 -0.69 -0.46 -0.37 0.25 NA [5,] 0.59 2.78 -1.43 0.00 0.33 1.11 NA [6,] 4.43 0.35 0.10 0.06 2.77 -0.43 NA [7,] 1.21 0.12 1.15 -1.20 0.66 0.38 NA [8,] -0.07 0.55 0.28 0.27 0.28 -0.44 NA [9,] -0.01 0.47 -0.15 0.39 -1.03 -0.72 NA [10,] 0.88 -0.26 -0.65 -0.28 0.63 0.26 NA [11,] 0.75 -0.09 0.04 -0.71 -0.37 -0.51 NA [12,] 2.61 0.07 -0.32 -1.35 1.25 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/1bmv01456927600.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/2snup1456927600.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/3ui6e1456927600.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/4u3ou1456927600.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,] 83.61 83.890 83.40 95.350 96.800 97.130 99.900 98.80 99.07 99.46 [2,] 93.15 92.790 93.21 95.350 96.800 97.130 99.900 98.80 99.07 99.46 [3,] 99.22 99.445 98.66 98.785 100.425 100.515 100.595 101.45 101.73 101.14 [4,] 101.54 103.980 104.60 103.210 102.520 103.690 104.040 104.16 104.71 105.18 [5,] 104.90 105.050 104.81 106.230 106.480 107.590 107.160 107.54 107.10 106.38 [,11] [,12] [1,] 99.18 90.540 [2,] 99.18 98.470 [3,] 101.13 100.965 [4,] 104.92 104.830 [5,] 106.64 106.130 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 93.80818 92.22709 91.31308 93.71505 96.73542 96.28359 97.92457 [2,] 104.63182 106.66291 106.00692 103.85495 104.11458 104.74641 103.26543 [,8] [,9] [,10] [,11] [,12] [1,] 97.99263 98.09202 97.45042 97.42751 96.86259 [2,] 104.90737 105.36798 104.82958 104.83249 105.06741 $out [1] 82.96 82.76 83.35 87.78 88.99 88.92 88.91 89.79 $group [1] 4 5 6 7 8 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(83.61, 93.15, 99.22, 101.54, 104.9, 83.89, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f4d91456927600.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] [1,] -0.360 -0.82 -1.39 -0.690 -1.43 -0.430 -1.20 -0.440 -1.03 -0.65 -0.71 [2,] -0.210 -0.75 -0.83 -0.460 0.00 0.060 0.12 -0.070 -0.72 -0.28 -0.51 [3,] 0.215 -0.47 0.32 -0.285 0.46 0.225 0.52 0.275 -0.08 0.00 -0.23 [4,] 0.440 0.42 1.42 0.250 1.11 2.770 1.15 0.280 0.39 0.63 0.04 [5,] 0.440 0.83 2.14 0.250 1.11 4.430 1.21 0.550 0.47 0.88 0.75 [,12] [1,] -1.35 [2,] -0.32 [3,] 0.07 [4,] 1.25 [5,] 2.61 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.204271 -1.2246878 -1.131323 -0.7429729 -0.2559859 -1.523038 -0.1443833 [2,] 0.634271 0.2846878 1.771323 0.1729729 1.1759859 1.973038 1.1843833 [,8] [,9] [,10] [,11] [,12] [1,] 0.0492387 -0.7959859 -0.5869794 -0.5847678 -1.039358 [2,] 0.5007613 0.6359859 0.5869794 0.1247678 1.179358 $out [1] 2.66 5.56 2.78 $group [1] 1 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.359999999999999, -0.210000000000008, 0.214999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j0uw1456927600.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,] 82.760 92.790 101.090 98.470 96.090 103.98 NA [2,] 83.375 94.280 101.840 99.125 97.015 105.47 NA [3,] 85.835 103.865 102.495 99.940 98.490 106.43 NA [4,] 88.955 104.770 103.905 100.815 100.255 107.13 NA [5,] 90.540 105.180 105.050 101.980 100.840 107.59 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 83.28992 99.08044 101.5531 99.16918 97.01221 105.6729 NA [2,] 88.38008 108.64956 103.4369 100.71082 99.96779 107.1871 NA $out [1] 101.32 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(82.76, 83.375, 85.835, 88.955, 90.54, 92.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lyii1456927600.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.94000 98.6600 97.81375 [2,] 97.49333 99.3325 99.00000 [3,] 99.40500 100.5550 100.95437 [4,] 100.38333 101.1350 101.72312 [5,] 100.54333 101.7300 102.02500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.08685 99.73287 99.71234 [2,] 100.72315 101.37713 102.19641 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96.94, 97.4933333333333, 99.405, 100.383333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bmv01456927600.ps tmp/1bmv01456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/2snup1456927600.ps tmp/2snup1456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/3ui6e1456927600.ps tmp/3ui6e1456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/4u3ou1456927600.ps tmp/4u3ou1456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/5f4d91456927600.ps tmp/5f4d91456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/6j0uw1456927600.ps tmp/6j0uw1456927600.png",intern=TRUE)) character(0) > try(system("convert tmp/7lyii1456927600.ps tmp/7lyii1456927600.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.479 0.499 3.003