R version 3.2.4 (2016-03-10) -- "Very Secure Dishes" Copyright (C) 2016 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(68.733,41.381,51.310,39.036,42.157,52.574,39.168,41.325,40.645,42.303,38.167,8.980,66.356,50.335,47.212,42.247,45.793,48.248,40.074,39.602,41.283,41.900,29.812,7.236,56.184,33.958,34.532,30.277,30.850,35.492,33.544,27.829,33.663,35.690,27.356,8.033,62.798,37.581,44.753,37.546,36.830,50.683,38.487,36.522,45.544,43.575,36.921,11.393,74.787,49.019,56.601,47.637,49.806,50.499,42.092,39.062,44.382,43.635,41.082,17.244,70.170,43.949,52.333,41.032,47.758,76.116,30.917,32.996,31.951,26.775,30.268,18.214,47.957,31.901,35.559,30.408,30.083,35.043,30.475,28.309,31.394,36.313,40.357,38.918,44.368,33.298,29.366,28.282,30.943,32.699,29.764,25.524,29.807,35.112,32.192,36.214) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 68.733 66.356 56.184 62.798 74.787 70.170 47.957 44.368 NA [2,] 41.381 50.335 33.958 37.581 49.019 43.949 31.901 33.298 NA [3,] 51.310 47.212 34.532 44.753 56.601 52.333 35.559 29.366 NA [4,] 39.036 42.247 30.277 37.546 47.637 41.032 30.408 28.282 NA [5,] 42.157 45.793 30.850 36.830 49.806 47.758 30.083 30.943 NA [6,] 52.574 48.248 35.492 50.683 50.499 76.116 35.043 32.699 NA [7,] 39.168 40.074 33.544 38.487 42.092 30.917 30.475 29.764 NA [8,] 41.325 39.602 27.829 36.522 39.062 32.996 28.309 25.524 NA [9,] 40.645 41.283 33.663 45.544 44.382 31.951 31.394 29.807 NA [10,] 42.303 41.900 35.690 43.575 43.635 26.775 36.313 35.112 NA [11,] 38.167 29.812 27.356 36.921 41.082 30.268 40.357 32.192 NA [12,] 8.980 7.236 8.033 11.393 17.244 18.214 38.918 36.214 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -27.352 -16.021 -22.226 -25.217 -25.768 -26.221 -16.056 -11.070 NA [2,] 9.929 -3.123 0.574 7.172 7.582 8.384 3.658 -3.932 NA [3,] -12.274 -4.965 -4.255 -7.207 -8.964 -11.301 -5.151 -1.084 NA [4,] 3.121 3.546 0.573 -0.716 2.169 6.726 -0.325 2.661 NA [5,] 10.417 2.455 4.642 13.853 0.693 28.358 4.960 1.756 NA [6,] -13.406 -8.174 -1.948 -12.196 -8.407 -45.199 -4.568 -2.935 NA [7,] 2.157 -0.472 -5.715 -1.965 -3.030 2.079 -2.166 -4.240 NA [8,] -0.680 1.681 5.834 9.022 5.320 -1.045 3.085 4.283 NA [9,] 1.658 0.617 2.027 -1.969 -0.747 -5.176 4.919 5.305 NA [10,] -4.136 -12.088 -8.334 -6.654 -2.553 3.493 4.044 -2.920 NA [11,] -29.187 -22.576 -19.323 -25.528 -23.838 -12.054 -1.439 4.022 NA [12,] 57.376 48.948 54.765 63.394 52.926 29.743 5.450 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/1ikv81458078821.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/2kq231458078821.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/3jdmg1458078821.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/4sl831458078821.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,] 44.3680 31.901 29.3660 28.2820 30.0830 32.6990 29.7640 25.524 29.8070 [2,] 52.0705 33.628 35.0455 30.3425 30.8965 35.2675 30.6960 28.069 31.6725 [3,] 64.5770 39.481 45.9825 38.2910 39.4935 49.3735 36.0155 34.759 37.1540 [4,] 69.4515 46.484 51.8215 41.6395 46.7755 51.6285 39.6210 39.332 42.8325 [5,] 74.7870 50.335 56.6010 47.6370 49.8060 76.1160 42.0920 41.325 45.5440 [,10] [,11] [,12] [1,] 26.7750 27.3560 7.2360 [2,] 35.4010 30.0400 8.5065 [3,] 39.1065 34.5565 14.3185 [4,] 42.9390 39.2620 27.2140 [5,] 43.6350 41.0820 38.9180 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 54.86772 32.29945 36.61119 31.98033 30.62326 40.23401 31.02987 28.46733 [2,] 74.28628 46.66255 55.35381 44.60167 48.36374 58.51299 41.00113 41.05067 [,9] [,10] [,11] [,12] [1,] 30.91986 34.89566 29.40496 3.868222 [2,] 43.38814 43.31734 39.70804 24.768778 $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(44.368, 52.0705, 64.577, 69.4515, 74.787, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53ln11458078821.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] [1,] -27.3520 -3.9320 -12.2740 -0.7160 0.6930 -13.4060 -5.7150 -1.0450 -5.1760 [2,] -25.9945 -1.2745 -10.1325 0.1240 2.1055 -12.8010 -3.6350 0.5005 -1.3580 [3,] -23.7215 5.4150 -6.1790 2.4150 4.8010 -8.2905 -2.0655 3.6840 1.1375 [4,] -16.0385 7.9830 -4.6100 3.3335 12.1350 -3.7515 0.8035 5.5770 3.4730 [5,] -11.0700 9.9290 -1.0840 6.7260 13.8530 -1.9480 2.1570 9.0220 5.3050 [,10] [,11] [,12] [1,] -12.088 -29.1870 29.7430 [2,] -7.494 -24.6830 39.3455 [3,] -3.528 -20.9495 52.9260 [4,] 0.470 -6.7465 56.0705 [5,] 4.044 4.0220 63.3940 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -29.28306 0.2436276 -9.263948 0.6221272 -0.8016227 -13.345681 -4.5449098 [2,] -18.15994 10.5863724 -3.094052 4.2078728 10.4036227 -3.235319 0.4139098 [,8] [,9] [,10] [,11] [,12] [1,] 0.8481942 -1.561166 -7.9768047 -30.96909 42.9381 [2,] 6.5198058 3.836166 0.9208047 -10.92991 62.9139 $out [1] 28.358 -45.199 5.450 $group [1] 5 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-27.352, -25.9945, -23.7215, -16.0385, -11.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vxtj1458078821.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] [1,] 38.1670 29.8120 27.3560 36.5220 39.0620 18.2140 28.3090 25.5240 NA [2,] 39.1020 39.8380 29.0530 36.8755 41.5870 30.5925 30.4415 29.5650 NA [3,] 41.3530 42.0735 33.6035 38.0340 46.0095 37.0140 33.4720 31.5675 NA [4,] 46.8065 47.7300 35.0120 45.1485 50.1525 50.0455 37.6155 34.2050 NA [5,] 52.5740 50.3350 35.6900 50.6830 56.6010 76.1160 47.9570 36.2140 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 37.83893 38.47391 30.88556 34.26063 42.10272 28.14136 30.19989 29.45116 [2,] 44.86707 45.67309 36.32144 41.80737 49.91628 45.88664 36.74411 33.68384 [,9] [1,] NA [2,] NA $out [1] 68.733 8.980 66.356 7.236 56.184 8.033 62.798 11.393 74.787 17.244 [11] 44.368 $group [1] 1 1 2 2 3 3 4 4 5 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(38.167, 39.102, 41.353, 46.8065, 52.574, 29.812, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lgdq1458078821.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,] 33.89612 34.55650 33.69300 [2,] 35.04225 35.38725 34.76738 [3,] 37.74825 38.69875 37.76838 [4,] 42.06800 42.73800 41.38625 [5,] 47.66925 49.37350 43.43400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 34.54376 35.34602 34.74946 [2,] 40.95274 42.05148 40.78729 $out [1] 61.41913 18.27900 64.57700 14.31850 61.60975 15.72862 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(33.896125, 35.04225, 37.74825, 42.068, 47.66925, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ikv81458078821.ps tmp/1ikv81458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/2kq231458078821.ps tmp/2kq231458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/3jdmg1458078821.ps tmp/3jdmg1458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/4sl831458078821.ps tmp/4sl831458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/53ln11458078821.ps tmp/53ln11458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/6vxtj1458078821.ps tmp/6vxtj1458078821.png",intern=TRUE)) character(0) > try(system("convert tmp/7lgdq1458078821.ps tmp/7lgdq1458078821.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.478 0.422 2.920