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(37.43,38.39,38.99,39.83,41.21,41.72,42.12,43.18,43.43,43.77,44.19,44.38,44.57,45.13,45.84,46.11,46.35,46.41,46.78,47.09,47.34,47.64,48.17,48.24,48.59,49.29,50.44,52.42,52.9,53.19,53.19,53.38,54.17,54.69,55.39,55.64,55.64,56.57,57.16,57.87,58.89,59.28,59.94,60.35,60.59,61.2,61.62,62.07,62.38,62.62,64.15,64.97,66.12,67.08,68.66,69.04,70.8,73.2,74.19,75.36,75.54,76.81,77.69,79.34,80.36,80.74,81.12,82.95,87.31,88.93,90.8,91.29,91.36,92.72,95.75,97.19,98.73,99.03,99.4,99.66,100.5,101.21,101.26,101.44,101.97,102.23,102.58,101.91,101.63,101.1,100.71,100.75,100.14,97.72,94.91,94.34,97.11,96.51,95.8,95.25,95.09,94.97,95.21,95.46,95.33,95.14,95.6,95.66,95.66,96.33,97.66,98.27,99.53,100.86,101.26,101.29,101.38,101.49,101.29,101.26) > 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,] 37.43 44.57 48.59 55.64 62.38 75.54 91.36 101.97 97.11 95.66 NA [2,] 38.39 45.13 49.29 56.57 62.62 76.81 92.72 102.23 96.51 96.33 NA [3,] 38.99 45.84 50.44 57.16 64.15 77.69 95.75 102.58 95.80 97.66 NA [4,] 39.83 46.11 52.42 57.87 64.97 79.34 97.19 101.91 95.25 98.27 NA [5,] 41.21 46.35 52.90 58.89 66.12 80.36 98.73 101.63 95.09 99.53 NA [6,] 41.72 46.41 53.19 59.28 67.08 80.74 99.03 101.10 94.97 100.86 NA [7,] 42.12 46.78 53.19 59.94 68.66 81.12 99.40 100.71 95.21 101.26 NA [8,] 43.18 47.09 53.38 60.35 69.04 82.95 99.66 100.75 95.46 101.29 NA [9,] 43.43 47.34 54.17 60.59 70.80 87.31 100.50 100.14 95.33 101.38 NA [10,] 43.77 47.64 54.69 61.20 73.20 88.93 101.21 97.72 95.14 101.49 NA [11,] 44.19 48.17 55.39 61.62 74.19 90.80 101.26 94.91 95.60 101.29 NA [12,] 44.38 48.24 55.64 62.07 75.36 91.29 101.44 94.34 95.66 101.26 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.96 0.56 0.70 0.93 0.24 1.27 1.36 0.26 -0.60 0.67 NA [2,] 0.60 0.71 1.15 0.59 1.53 0.88 3.03 0.35 -0.71 1.33 NA [3,] 0.84 0.27 1.98 0.71 0.82 1.65 1.44 -0.67 -0.55 0.61 NA [4,] 1.38 0.24 0.48 1.02 1.15 1.02 1.54 -0.28 -0.16 1.26 NA [5,] 0.51 0.06 0.29 0.39 0.96 0.38 0.30 -0.53 -0.12 1.33 NA [6,] 0.40 0.37 0.00 0.66 1.58 0.38 0.37 -0.39 0.24 0.40 NA [7,] 1.06 0.31 0.19 0.41 0.38 1.83 0.26 0.04 0.25 0.03 NA [8,] 0.25 0.25 0.79 0.24 1.76 4.36 0.84 -0.61 -0.13 0.09 NA [9,] 0.34 0.30 0.52 0.61 2.40 1.62 0.71 -2.42 -0.19 0.11 NA [10,] 0.42 0.53 0.70 0.42 0.99 1.87 0.05 -2.81 0.46 -0.20 NA [11,] 0.19 0.07 0.25 0.45 1.17 0.49 0.18 -0.57 0.06 -0.03 NA [12,] 0.19 0.35 0.00 0.31 0.18 0.07 0.53 2.77 0.00 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/1ys3x1457208372.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/2vwmk1457208372.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/3q11y1457208372.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/4jisk1457208372.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,] 37.43 38.390 38.99 39.830 41.21 41.72 42.12 43.180 43.430 43.770 [2,] 48.59 49.290 50.44 52.420 52.90 53.19 53.19 53.380 54.170 54.690 [3,] 68.96 69.715 70.92 72.155 73.24 73.91 74.89 75.995 79.055 81.065 [4,] 95.66 96.330 95.80 97.190 98.73 99.03 99.40 99.660 100.140 97.720 [5,] 101.97 102.230 102.58 101.910 101.63 101.10 101.26 101.290 101.380 101.490 [,11] [,12] [1,] 44.190 44.380 [2,] 55.390 55.640 [3,] 82.495 83.325 [4,] 95.600 95.660 [5,] 101.290 101.440 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 45.44195 46.21194 48.25634 49.78612 50.3415 51.00651 51.80164 52.87167 [2,] 92.47805 93.21806 93.58366 94.52388 96.1385 96.81349 97.97836 99.11833 [,9] [,10] [,11] [,12] [1,] 56.08656 59.5655 62.40448 63.32941 [2,] 102.02344 102.5645 102.58552 103.32059 $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(37.43, 48.59, 68.96, 95.66, 101.97, 38.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ypoy1457208372.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.600 0.350 -0.670 -0.28 -0.53 0.000 0.030 -0.61 -0.19 -0.20 -0.030 0.00 [2,] 0.260 0.590 0.270 0.24 0.06 0.240 0.190 0.09 0.11 0.05 0.060 0.07 [3,] 0.685 0.795 0.765 1.02 0.34 0.375 0.285 0.25 0.43 0.44 0.185 0.19 [4,] 0.960 1.330 1.440 1.26 0.51 0.400 0.410 0.84 0.71 0.70 0.450 0.35 [5,] 1.360 1.530 1.980 1.54 0.96 0.400 0.410 1.76 0.71 0.99 0.490 0.53 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3352521 0.4252665 0.1804214 0.5103673 0.1151621 0.2950576 0.1750792 [2,] 1.0347479 1.1647335 1.3495786 1.5296327 0.5648379 0.4549424 0.3949208 [,8] [,9] [,10] [,11] [,12] [1,] -0.1247299 0.1302161 0.1152341 -0.009859549 0.04253333 [2,] 0.6247299 0.7297839 0.7647659 0.379859549 0.33746667 $out [1] 3.03 -0.71 1.33 0.66 1.58 -0.39 1.06 1.83 4.36 2.40 1.62 -2.42 [13] 1.87 -2.81 1.17 -0.57 2.77 $group [1] 2 2 5 6 6 6 7 7 8 9 9 9 10 10 11 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.599999999999994, 0.260000000000005, 0.684999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e2d71457208372.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,] 37.43 44.570 48.59 55.640 62.38 75.540 91.360 94.910 94.970 95.660 [2,] 39.41 45.975 51.43 57.515 64.56 78.515 96.470 98.930 95.175 97.965 [3,] 41.92 46.595 53.19 59.610 67.87 80.930 99.215 100.925 95.395 101.060 [4,] 43.60 47.490 54.43 60.895 72.00 88.120 100.855 101.940 95.730 101.290 [5,] 44.38 48.240 55.64 62.070 75.36 91.290 101.440 102.580 96.510 101.490 [,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,] 40.00891 45.904 51.82168 58.06836 64.47657 76.5491 97.21497 99.55212 [2,] 43.83109 47.286 54.55832 61.15164 71.26343 85.3109 101.21503 102.29788 [,9] [,10] [,11] [1,] 95.14186 99.54345 NA [2,] 95.64814 102.57655 NA $out [1] 94.34 97.11 $group [1] 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(37.43, 39.41, 41.92, 43.6, 44.38, 44.57, 45.975, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72xl51457208372.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,] 71.0250 68.9600 72.46875 [2,] 72.9610 71.5375 74.59875 [3,] 74.6385 74.4000 76.23812 [4,] 76.2990 80.0600 76.65563 [5,] 76.9680 83.3250 77.35625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 73.11602 70.51283 75.29997 [2,] 76.16098 78.28717 77.17628 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(71.025, 72.961, 74.6385, 76.299, 76.968, 68.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ys3x1457208372.ps tmp/1ys3x1457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/2vwmk1457208372.ps tmp/2vwmk1457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/3q11y1457208372.ps tmp/3q11y1457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/4jisk1457208372.ps tmp/4jisk1457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/5ypoy1457208372.ps tmp/5ypoy1457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/6e2d71457208372.ps tmp/6e2d71457208372.png",intern=TRUE)) character(0) > try(system("convert tmp/72xl51457208372.ps tmp/72xl51457208372.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.219 0.328 2.580