R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(122.9,122.82,120.26,118.82,126.69,125.79,123.96,128.7,127.74,127.55,126.16,124.74,122.32,120.92,117.09,115.77,117.88,117.77,122.61,127.31,124.62,119.07,116.92,115.07,113.84,112.89,111.86,111.58,107.72,106.49,108.53,108.62,107.92,106.43,117.66,115.11,113.98,112.16,109.72,117.99,112.57,113.66,118.18,115.66,114.72,110.46,108.38,106.52,107.01,105.89,103.76,103.71,101.07,100.4,102.24,99.18,98.14,96.22,94.38,94.62,94.71,94.97,93.69,106.42,105.73,105.18,104.8,102.77,100.29,99.3,96.63,95.5) > 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,] 122.90 122.32 113.84 113.98 107.01 94.71 NA [2,] 122.82 120.92 112.89 112.16 105.89 94.97 NA [3,] 120.26 117.09 111.86 109.72 103.76 93.69 NA [4,] 118.82 115.77 111.58 117.99 103.71 106.42 NA [5,] 126.69 117.88 107.72 112.57 101.07 105.73 NA [6,] 125.79 117.77 106.49 113.66 100.40 105.18 NA [7,] 123.96 122.61 108.53 118.18 102.24 104.80 NA [8,] 128.70 127.31 108.62 115.66 99.18 102.77 NA [9,] 127.74 124.62 107.92 114.72 98.14 100.29 NA [10,] 127.55 119.07 106.43 110.46 96.22 99.30 NA [11,] 126.16 116.92 117.66 108.38 94.38 96.63 NA [12,] 124.74 115.07 115.11 106.52 94.62 95.50 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.08 -1.40 -0.95 -1.82 -1.12 0.26 NA [2,] -2.56 -3.83 -1.03 -2.44 -2.13 -1.28 NA [3,] -1.44 -1.32 -0.28 8.27 -0.05 12.73 NA [4,] 7.87 2.11 -3.86 -5.42 -2.64 -0.69 NA [5,] -0.90 -0.11 -1.23 1.09 -0.67 -0.55 NA [6,] -1.83 4.84 2.04 4.52 1.84 -0.38 NA [7,] 4.74 4.70 0.09 -2.52 -3.06 -2.03 NA [8,] -0.96 -2.69 -0.70 -0.94 -1.04 -2.48 NA [9,] -0.19 -5.55 -1.49 -4.26 -1.92 -0.99 NA [10,] -1.39 -2.15 11.23 -2.08 -1.84 -2.67 NA [11,] -1.42 -1.85 -2.55 -1.86 0.24 -1.13 NA [12,] -2.42 -1.23 -1.13 0.49 0.09 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/1ygxy1476395007.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/2miul1476395007.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/30tmp1476395007.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/4hh6l1476395007.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,] 94.71 94.970 93.69 103.710 101.070 100.400 102.240 99.18 98.14 [2,] 107.01 105.890 103.76 106.420 105.730 105.180 104.800 102.77 100.29 [3,] 113.91 112.525 110.79 113.675 110.145 110.075 113.355 112.14 111.32 [4,] 122.32 120.920 117.09 117.990 117.880 117.770 122.610 127.31 124.62 [5,] 122.90 122.820 120.26 118.820 126.690 125.790 123.960 128.70 127.74 [,10] [,11] [,12] [1,] 96.220 94.38 94.620 [2,] 99.300 96.63 95.500 [3,] 108.445 112.65 110.795 [4,] 119.070 117.66 115.110 [5,] 127.550 126.16 124.740 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 104.0346 102.8302 102.1917 106.212 102.3079 101.954 101.867 96.31091 [2,] 123.7854 122.2198 119.3883 121.138 117.9821 118.196 124.843 127.96909 [,9] [,10] [,11] [,12] [1,] 95.62636 95.69271 99.08497 98.14592 [2,] 127.01364 121.19729 126.21503 123.44408 $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(94.71, 107.01, 113.91, 122.32, 122.9, 94.97, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/544kv1476395007.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,] -1.820 -3.830 -1.440 -5.420 -1.23 -1.83 -3.06 -2.69 -5.550 -2.67 -2.550 [2,] -1.400 -2.560 -1.320 -3.860 -0.90 -0.38 -2.52 -2.48 -4.260 -2.15 -1.860 [3,] -1.035 -2.285 -0.165 -1.665 -0.61 1.94 -0.97 -1.00 -1.705 -1.96 -1.635 [4,] -0.080 -1.280 8.270 2.110 -0.11 4.52 4.70 -0.94 -0.990 -1.39 -1.130 [5,] 0.260 -1.030 12.730 7.870 -0.11 4.84 4.74 -0.70 -0.190 -1.39 -1.130 [,12] [1,] -2.42 [2,] -1.23 [3,] -1.13 [4,] 0.09 [5,] 0.49 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.8864426 -3.110641 -6.35086 -5.515843 -1.1195755 -1.220658 -5.627133 [2,] -0.1835574 -1.459359 6.02086 2.185843 -0.1004245 5.100658 3.687133 [,8] [,9] [,10] [,11] [,12] [1,] -1.99334974 -3.8142556 -2.450225 -2.105874 -2.0627087 [2,] -0.00665026 0.4042556 -1.469775 -1.164126 -0.1972913 $out [1] 1.09 11.23 0.24 $group [1] 5 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.82000000000001, -1.39999999999999, -1.035, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u9401476395007.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,] 118.820 115.070 106.430 106.520 94.380 93.690 NA [2,] 122.860 117.005 107.820 110.090 97.180 95.235 NA [3,] 125.265 118.475 110.100 113.115 100.735 99.795 NA [4,] 127.120 122.465 113.365 115.190 103.735 104.990 NA [5,] 128.700 127.310 117.660 118.180 107.010 106.420 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 123.322 115.9847 107.5709 110.7889 97.74522 95.34568 NA [2,] 127.208 120.9653 112.6291 115.4411 103.72478 104.24432 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(118.82, 122.86, 125.265, 127.12, 128.7, 115.07, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7bpc21476395007.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,] 108.5933 108.4450 106.6775 [2,] 109.9300 110.4675 109.7581 [3,] 111.7758 111.7300 111.7806 [4,] 112.4208 113.0025 113.4013 [5,] 113.7067 113.9100 114.4762 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110.6397 110.5738 110.1190 [2,] 112.9119 112.8862 113.4423 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.593333333333, 109.93, 111.775833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ygxy1476395007.ps tmp/1ygxy1476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/2miul1476395007.ps tmp/2miul1476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/30tmp1476395007.ps tmp/30tmp1476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/4hh6l1476395007.ps tmp/4hh6l1476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/544kv1476395007.ps tmp/544kv1476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/6u9401476395007.ps tmp/6u9401476395007.png",intern=TRUE)) character(0) > try(system("convert tmp/7bpc21476395007.ps tmp/7bpc21476395007.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.379 0.199 2.619