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(81.83,82.58,82.6,82.71,82.98,83.11,83.22,83.32,83.39,83.45,83.52,83.59,83.97,84.48,84.8,84.93,85.14,85.22,85.54,85.5,85.61,85.75,85.89,85.94,86.08,86.3,86.97,87.3,87.62,87.59,87.78,87.87,88.17,88.67,88.84,88.9,88.98,89.27,89.69,89.72,89.79,89.82,89.98,90.09,90.31,90.3,90.48,90.52,90.53,91.38,91.87,91.9,92.08,92.14,92.09,92.32,92.67,92.78,92.96,93.12,93.32,94.12,94.34,94.52,94.81,94.95,94.99,95.03,95.16,95.41,95.46,95.62,95.66,95.96,96.18,96.24,97.03,97.11,97.28,97.74,97.83,98.14,98.18,98.21,98.43,98.67,99.51,99.64,99.83,99.84,99.94,100.17,100.56,101.05,101.17,101.21,101.01,101.92,102.33,102.41,102.5,102.69,102.98,103.11,103.36,103.8,104.07,104.15,104.19,104.64,104.98,105.25,105.43,105.59,105.84,105.87,106,106.14,106.24,106.31) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 81.83 83.97 86.08 88.98 90.53 93.32 95.66 98.43 101.01 104.19 NA [2,] 82.58 84.48 86.30 89.27 91.38 94.12 95.96 98.67 101.92 104.64 NA [3,] 82.60 84.80 86.97 89.69 91.87 94.34 96.18 99.51 102.33 104.98 NA [4,] 82.71 84.93 87.30 89.72 91.90 94.52 96.24 99.64 102.41 105.25 NA [5,] 82.98 85.14 87.62 89.79 92.08 94.81 97.03 99.83 102.50 105.43 NA [6,] 83.11 85.22 87.59 89.82 92.14 94.95 97.11 99.84 102.69 105.59 NA [7,] 83.22 85.54 87.78 89.98 92.09 94.99 97.28 99.94 102.98 105.84 NA [8,] 83.32 85.50 87.87 90.09 92.32 95.03 97.74 100.17 103.11 105.87 NA [9,] 83.39 85.61 88.17 90.31 92.67 95.16 97.83 100.56 103.36 106.00 NA [10,] 83.45 85.75 88.67 90.30 92.78 95.41 98.14 101.05 103.80 106.14 NA [11,] 83.52 85.89 88.84 90.48 92.96 95.46 98.18 101.17 104.07 106.24 NA [12,] 83.59 85.94 88.90 90.52 93.12 95.62 98.21 101.21 104.15 106.31 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.75 0.51 0.22 0.29 0.85 0.80 0.30 0.24 0.91 0.45 NA [2,] 0.02 0.32 0.67 0.42 0.49 0.22 0.22 0.84 0.41 0.34 NA [3,] 0.11 0.13 0.33 0.03 0.03 0.18 0.06 0.13 0.08 0.27 NA [4,] 0.27 0.21 0.32 0.07 0.18 0.29 0.79 0.19 0.09 0.18 NA [5,] 0.13 0.08 -0.03 0.03 0.06 0.14 0.08 0.01 0.19 0.16 NA [6,] 0.11 0.32 0.19 0.16 -0.05 0.04 0.17 0.10 0.29 0.25 NA [7,] 0.10 -0.04 0.09 0.11 0.23 0.04 0.46 0.23 0.13 0.03 NA [8,] 0.07 0.11 0.30 0.22 0.35 0.13 0.09 0.39 0.25 0.13 NA [9,] 0.06 0.14 0.50 -0.01 0.11 0.25 0.31 0.49 0.44 0.14 NA [10,] 0.07 0.14 0.17 0.18 0.18 0.05 0.04 0.12 0.27 0.10 NA [11,] 0.07 0.05 0.06 0.04 0.16 0.16 0.03 0.04 0.08 0.07 NA [12,] 0.38 0.14 0.08 0.01 0.20 0.04 0.22 -0.20 0.04 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/1fvvc1457428252.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/2d46u1457428252.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/3qbce1457428252.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/49mpm1457428252.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] [1,] 81.830 82.58 82.600 82.71 82.980 83.110 83.22 83.320 83.390 [2,] 86.080 86.30 86.970 87.30 87.620 87.590 87.78 87.870 88.170 [3,] 91.925 92.75 93.105 93.21 93.445 93.545 93.54 93.675 93.915 [4,] 98.430 98.67 99.510 99.64 99.830 99.840 99.94 100.170 100.560 [5,] 104.190 104.64 104.980 105.25 105.430 105.590 105.84 105.870 106.000 [,10] [,11] [,12] [1,] 83.450 83.52 83.59 [2,] 88.670 88.84 88.90 [3,] 94.095 94.21 94.37 [4,] 101.050 101.17 101.21 [5,] 106.140 106.24 106.31 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.75445 86.56945 86.83952 87.04444 87.3444 87.42441 87.46438 87.52943 [2,] 98.09555 98.93055 99.37048 99.37556 99.5456 99.66559 99.61562 99.82057 [,9] [,10] [,11] [,12] [1,] 87.72446 87.90946 88.04944 88.21943 [2,] 100.10554 100.28054 100.37056 100.52057 $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(81.83, 86.08, 91.925, 98.43, 104.19, 82.58, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5uo7d1457428252.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.22 0.020 0.03 0.07 -0.03 -0.050 -0.040 0.070 -0.010 0.04 0.030 -0.20 [2,] 0.29 0.220 0.06 0.18 0.03 0.100 0.040 0.110 0.110 0.07 0.040 0.04 [3,] 0.48 0.375 0.12 0.20 0.08 0.165 0.105 0.175 0.195 0.13 0.065 0.08 [4,] 0.80 0.490 0.18 0.29 0.14 0.250 0.230 0.300 0.440 0.18 0.080 0.20 [5,] 0.91 0.840 0.33 0.32 0.19 0.320 0.460 0.390 0.500 0.27 0.080 0.38 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2251837 0.2400972 0.06004322 0.1450396 0.02503961 0.09005402 0.01006842 [2,] 0.7348163 0.5099028 0.17995678 0.2549604 0.13496039 0.23994598 0.19993158 [,8] [,9] [,10] [,11] [,12] [1,] 0.08006842 0.03011884 0.07503961 0.04501441 -0.004266667 [2,] 0.26993158 0.35988116 0.18496039 0.08498559 0.164266667 $out [1] 0.79 0.16 0.16 $group [1] 4 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.219999999999999, 0.289999999999992, 0.480000000000004, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6v08e1457428252.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] [,8] [,9] [,10] [1,] 81.830 83.970 86.080 88.980 91.380 93.320 95.660 98.430 101.010 104.190 [2,] 82.655 84.865 87.135 89.705 91.885 94.430 96.210 99.575 102.370 105.115 [3,] 83.165 85.360 87.700 89.900 92.115 94.970 97.195 99.890 102.835 105.715 [4,] 83.420 85.680 88.420 90.305 92.725 95.285 97.985 100.805 103.580 106.070 [5,] 83.590 85.940 88.900 90.520 93.120 95.620 98.210 101.210 104.150 106.310 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82.81608 84.98827 87.1139 89.62634 91.73187 94.58003 96.38541 99.32899 [2,] 83.51392 85.73173 88.2861 90.17366 92.49813 95.35997 98.00459 100.45101 [,9] [,10] [,11] [1,] 102.2831 105.2794 NA [2,] 103.3869 106.1506 NA $out [1] 90.53 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(81.83, 82.655, 83.165, 83.42, 83.59, 83.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rxwv1457428252.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,] 92.4000 91.9250 92.27125 [2,] 93.3945 93.1575 93.25562 [3,] 93.8850 93.5425 93.72750 [4,] 94.4275 94.0050 94.49562 [5,] 94.7570 94.3700 94.88250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.41384 93.15595 93.16193 [2,] 94.35616 93.92905 94.29307 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(92.4, 93.3945, 93.885, 94.4275, 94.757, 91.925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1fvvc1457428252.ps tmp/1fvvc1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/2d46u1457428252.ps tmp/2d46u1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/3qbce1457428252.ps tmp/3qbce1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/49mpm1457428252.ps tmp/49mpm1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/5uo7d1457428252.ps tmp/5uo7d1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/6v08e1457428252.ps tmp/6v08e1457428252.png",intern=TRUE)) character(0) > try(system("convert tmp/7rxwv1457428252.ps tmp/7rxwv1457428252.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.452 0.402 2.885