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(96.44,96.35,96.4,96.66,96.95,97.14,97.27,97.34,97.42,97.47,97.29,97.36,97.47,97.48,97.84,97.9,97.53,97.61,97.73,97.76,97.87,97.85,98.13,98.21,98.3,98.34,98.38,98.42,98.16,98.18,98.22,98.29,98.45,98.54,98.54,98.78,98.84,99.14,99.2,99.33,98.56,98.65,98.77,98.82,98.9,98.89,98.9,99.07,99.09,99.12,99.03,99,99.21,99.35,99.37,99.39,99.41,99.43,99.6,99.73,99.78,99.8,99.88,99.74,100.15,100.27,100.26,100.36,100.37,100.54,99.8,99.82,99.82,99.82,99.67,99.78,99.44,99.61,99.71,99.71,99.77,99.77,99.89,99.96,100.02,100,100.04,99.99,99.97,99.77,99.93,99.9,100.01,100.08,100.21,100.28,100.48,100.72,100.74,100.88,101.03,101.47,101.46,101.46,101.45,101.74,102.41,102.54,102.67,102.87,102.9,102.88,102.82,102.94,102.97,103.01,103.11,103.21,104.66,104.79) > 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,] 96.44 97.47 98.30 98.84 99.09 99.78 99.82 100.02 100.48 102.67 NA [2,] 96.35 97.48 98.34 99.14 99.12 99.80 99.82 100.00 100.72 102.87 NA [3,] 96.40 97.84 98.38 99.20 99.03 99.88 99.67 100.04 100.74 102.90 NA [4,] 96.66 97.90 98.42 99.33 99.00 99.74 99.78 99.99 100.88 102.88 NA [5,] 96.95 97.53 98.16 98.56 99.21 100.15 99.44 99.97 101.03 102.82 NA [6,] 97.14 97.61 98.18 98.65 99.35 100.27 99.61 99.77 101.47 102.94 NA [7,] 97.27 97.73 98.22 98.77 99.37 100.26 99.71 99.93 101.46 102.97 NA [8,] 97.34 97.76 98.29 98.82 99.39 100.36 99.71 99.90 101.46 103.01 NA [9,] 97.42 97.87 98.45 98.90 99.41 100.37 99.77 100.01 101.45 103.11 NA [10,] 97.47 97.85 98.54 98.89 99.43 100.54 99.77 100.08 101.74 103.21 NA [11,] 97.29 98.13 98.54 98.90 99.60 99.80 99.89 100.21 102.41 104.66 NA [12,] 97.36 98.21 98.78 99.07 99.73 99.82 99.96 100.28 102.54 104.79 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -0.09 0.01 0.04 0.30 0.03 0.02 0.00 -0.02 0.24 0.20 NA [2,] 0.05 0.36 0.04 0.06 -0.09 0.08 -0.15 0.04 0.02 0.03 NA [3,] 0.26 0.06 0.04 0.13 -0.03 -0.14 0.11 -0.05 0.14 -0.02 NA [4,] 0.29 -0.37 -0.26 -0.77 0.21 0.41 -0.34 -0.02 0.15 -0.06 NA [5,] 0.19 0.08 0.02 0.09 0.14 0.12 0.17 -0.20 0.44 0.12 NA [6,] 0.13 0.12 0.04 0.12 0.02 -0.01 0.10 0.16 -0.01 0.03 NA [7,] 0.07 0.03 0.07 0.05 0.02 0.10 0.00 -0.03 0.00 0.04 NA [8,] 0.08 0.11 0.16 0.08 0.02 0.01 0.06 0.11 -0.01 0.10 NA [9,] 0.05 -0.02 0.09 -0.01 0.02 0.17 0.00 0.07 0.29 0.10 NA [10,] -0.18 0.28 0.00 0.01 0.17 -0.74 0.12 0.13 0.67 1.45 NA [11,] 0.07 0.08 0.24 0.17 0.13 0.02 0.07 0.07 0.13 0.13 NA [12,] 0.11 0.09 0.06 0.02 0.05 0.00 0.06 0.20 0.13 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/1nyf21457116538.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/2m6ac1457116538.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/34zn21457116538.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/44l5l1457116538.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,] 96.440 96.35 96.400 96.660 96.950 97.14 97.27 97.34 97.42 97.47 [2,] 98.300 98.34 98.380 98.420 98.160 98.18 98.22 98.29 98.45 98.54 [3,] 99.435 99.47 99.435 99.535 99.325 99.48 99.54 99.55 99.59 99.60 [4,] 100.020 100.00 100.040 99.990 100.150 100.27 100.26 100.36 100.37 100.54 [5,] 100.480 100.72 100.740 100.880 102.820 102.94 102.97 103.01 103.11 103.21 [,11] [,12] [1,] 97.29 97.360 [2,] 98.54 98.780 [3,] 99.70 99.775 [4,] 100.21 100.280 [5,] 102.41 100.280 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.57562 98.6406 98.6056 98.75057 98.33072 98.43575 98.52073 [2,] 100.29438 100.2994 100.2644 100.31943 100.31928 100.52425 100.55927 [,8] [,9] [,10] [,11] [,12] [1,] 98.51575 98.63069 98.60072 98.8656 99.02554 [2,] 100.58425 100.54931 100.59928 100.5344 100.52446 $out [1] 102.67 102.87 102.90 102.88 104.66 102.54 104.79 $group [1] 1 2 3 4 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(96.44, 98.3, 99.435, 100.02, 100.48, 96.35, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5yfpw1457116538.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.090 0.02 -0.14 -0.77 0.02 -0.01 -0.030 -0.01 -0.02 -0.180 0.020 0.00 [2,] 0.000 0.02 -0.03 -0.34 0.08 0.02 0.000 0.02 0.00 0.000 0.070 0.05 [3,] 0.025 0.04 0.05 -0.04 0.12 0.07 0.035 0.08 0.06 0.125 0.105 0.06 [4,] 0.200 0.06 0.13 0.21 0.17 0.12 0.070 0.11 0.10 0.280 0.130 0.11 [5,] 0.300 0.08 0.26 0.41 0.19 0.16 0.100 0.16 0.17 0.670 0.170 0.20 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.07492797 0.02001441 -0.02994238 -0.3148019 0.07503241 0.02003601 [2,] 0.12492797 0.05998559 0.12994238 0.2348019 0.16496759 0.11996399 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 2.520908e-05 0.03503241 0.01003601 -0.01489916 0.07502161 0.0284 [2,] 6.997479e-02 0.12496759 0.10996399 0.26489916 0.13497839 0.0916 $out [1] 0.36 -0.09 -0.15 -0.20 0.44 0.29 -0.74 1.45 0.24 $group [1] 2 2 2 5 5 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0900000000000034, 0, 0.0249999999999986, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6a8351457116538.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,] 96.350 97.470 98.160 98.560 99.000 99.740 99.61 99.900 100.480 102.670 [2,] 96.550 97.570 98.255 98.795 99.105 99.800 99.69 99.950 100.810 102.875 [3,] 97.205 97.800 98.360 98.895 99.360 100.015 99.77 100.005 101.455 102.955 [4,] 97.350 97.885 98.495 99.105 99.420 100.315 99.82 100.060 101.605 103.160 [5,] 97.470 98.210 98.780 99.330 99.730 100.540 99.96 100.210 102.540 103.210 [,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,] 96.84011 97.65633 98.25053 98.75361 99.21633 99.78011 99.71071 99.95483 [2,] 97.56989 97.94367 98.46947 99.03639 99.50367 100.24989 99.82929 100.05517 [,9] [,10] [,11] [1,] 101.0924 102.825 NA [2,] 101.8176 103.085 NA $out [1] 99.44 99.77 100.28 104.66 104.79 $group [1] 7 8 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(96.35, 96.55, 97.205, 97.35, 97.47, 97.47, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7839e1457116538.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,] 99.291 99.3250 99.18250 [2,] 99.395 99.4525 99.23313 [3,] 99.534 99.5375 99.26937 [4,] 99.714 99.5950 99.40062 [5,] 100.054 99.7750 99.52625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.3885 99.4725 99.19298 [2,] 99.6795 99.6025 99.34577 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(99.291, 99.395, 99.534, 99.714, 100.054, 99.325, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nyf21457116538.ps tmp/1nyf21457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/2m6ac1457116538.ps tmp/2m6ac1457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/34zn21457116538.ps tmp/34zn21457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/44l5l1457116538.ps tmp/44l5l1457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/5yfpw1457116538.ps tmp/5yfpw1457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/6a8351457116538.ps tmp/6a8351457116538.png",intern=TRUE)) character(0) > try(system("convert tmp/7839e1457116538.ps tmp/7839e1457116538.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.509 0.446 2.990