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(84.97,85.57,85.74,85.88,85.88,85.96,85.96,85.99,86.02,86.14,86.3,86.32,86.32,86.77,87.47,87.39,87.3,87.31,87.31,87.38,87.4,87.32,87.37,87.4,87.4,87.89,87.7,87.89,88.02,88.08,88.08,88.15,88.21,88.41,88.39,88.41,88.41,89.1,90.35,90.61,91.18,91.22,91.22,91.4,91.52,91.68,91.71,91.77,91.77,92.16,93.64,93.78,93.96,93.82,93.82,93.89,94.05,94.46,94.62,94.72,94.72,95.76,96.14,97.11,97.19,97.43,97.43,97.56,97.66,97.75,97.82,97.82,97.82,98.35,98.19,98.19,98.21,98.22,98.26,98.23,98.26,98.5,98.51,98.51,98.51,98.89,99.55,99.9,100.12,100.09,100.09,100.09,100.46,100.71,100.79,100.79,100.93,101.15,101.53,101.91,102.18,102.24,102.2,102.32,102.43,102.45,102.84,102.96,102.96,103.1,103.4,103.74,103.97,104.29,104.33,104.46,104.9,105.31,105.63,105.68) > 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,] 84.97 86.32 87.40 88.41 91.77 94.72 97.82 98.51 100.93 102.96 NA [2,] 85.57 86.77 87.89 89.10 92.16 95.76 98.35 98.89 101.15 103.10 NA [3,] 85.74 87.47 87.70 90.35 93.64 96.14 98.19 99.55 101.53 103.40 NA [4,] 85.88 87.39 87.89 90.61 93.78 97.11 98.19 99.90 101.91 103.74 NA [5,] 85.88 87.30 88.02 91.18 93.96 97.19 98.21 100.12 102.18 103.97 NA [6,] 85.96 87.31 88.08 91.22 93.82 97.43 98.22 100.09 102.24 104.29 NA [7,] 85.96 87.31 88.08 91.22 93.82 97.43 98.26 100.09 102.20 104.33 NA [8,] 85.99 87.38 88.15 91.40 93.89 97.56 98.23 100.09 102.32 104.46 NA [9,] 86.02 87.40 88.21 91.52 94.05 97.66 98.26 100.46 102.43 104.90 NA [10,] 86.14 87.32 88.41 91.68 94.46 97.75 98.50 100.71 102.45 105.31 NA [11,] 86.30 87.37 88.39 91.71 94.62 97.82 98.51 100.79 102.84 105.63 NA [12,] 86.32 87.40 88.41 91.77 94.72 97.82 98.51 100.79 102.96 105.68 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 0.60 0.45 0.49 0.69 0.39 1.04 0.53 0.38 0.22 0.14 NA [2,] 0.17 0.70 -0.19 1.25 1.48 0.38 -0.16 0.66 0.38 0.30 NA [3,] 0.14 -0.08 0.19 0.26 0.14 0.97 0.00 0.35 0.38 0.34 NA [4,] 0.00 -0.09 0.13 0.57 0.18 0.08 0.02 0.22 0.27 0.23 NA [5,] 0.08 0.01 0.06 0.04 -0.14 0.24 0.01 -0.03 0.06 0.32 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 0.04 0.00 -0.04 0.04 NA [7,] 0.03 0.07 0.07 0.18 0.07 0.13 -0.03 0.00 0.12 0.13 NA [8,] 0.03 0.02 0.06 0.12 0.16 0.10 0.03 0.37 0.11 0.44 NA [9,] 0.12 -0.08 0.20 0.16 0.41 0.09 0.24 0.25 0.02 0.41 NA [10,] 0.16 0.05 -0.02 0.03 0.16 0.07 0.01 0.08 0.39 0.32 NA [11,] 0.02 0.03 0.02 0.06 0.10 0.00 0.00 0.00 0.12 0.05 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.14 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/1ts951457119302.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/2013c1457119302.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/30dl71457119302.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/4r8kx1457119302.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,] 84.970 85.57 85.74 85.880 85.880 85.960 85.960 85.990 86.020 [2,] 87.400 87.89 87.70 87.890 88.020 88.080 88.080 88.150 88.210 [3,] 93.245 93.96 94.89 95.445 95.575 95.625 95.625 95.725 95.855 [4,] 98.510 98.89 99.55 99.900 100.120 100.090 100.090 100.090 100.460 [5,] 102.960 103.10 103.40 103.740 103.970 104.290 104.330 104.460 104.900 [,10] [,11] [,12] [1,] 86.140 86.30 86.32 [2,] 88.410 88.39 88.41 [3,] 96.105 96.22 96.27 [4,] 100.710 100.79 100.79 [5,] 105.310 105.63 105.68 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.694 88.46396 88.96927 89.44433 89.52936 89.62433 89.62433 89.7593 [2,] 98.796 99.45604 100.81073 101.44567 101.62064 101.62567 101.62567 101.6907 [,9] [,10] [,11] [,12] [1,] 89.73441 89.95943 90.02447 90.08446 [2,] 101.97559 102.25057 102.41553 102.45554 $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(84.97, 87.4, 93.245, 98.51, 102.96, 85.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5nghj1457119302.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.14 -0.19 -0.080 -0.090 -0.03 0 -0.03 0.020 -0.08 -0.020 0.000 0 [2,] 0.38 0.17 0.140 0.020 0.01 0 0.03 0.030 0.09 0.030 0.000 0 [3,] 0.47 0.38 0.225 0.155 0.05 0 0.07 0.105 0.18 0.075 0.025 0 [4,] 0.60 0.70 0.350 0.230 0.08 0 0.13 0.160 0.25 0.160 0.060 0 [5,] 0.69 1.48 0.380 0.270 0.08 0 0.18 0.160 0.41 0.320 0.120 0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.3600792 0.1151909 0.1200756 0.05007563 0.01502521 0 0.02003601 [2,] 0.5799208 0.6448091 0.3299244 0.25992437 0.08497479 0 0.11996399 [,8] [,9] [,10] [,11] [,12] [1,] 0.04004682 0.1000576 0.01004682 -0.004978392 0 [2,] 0.16995318 0.2599424 0.13995318 0.054978392 0 $out [1] 1.04 0.97 0.57 -0.14 0.24 0.32 0.04 -0.04 0.04 0.37 0.44 0.39 [13] 0.14 $group [1] 1 3 4 5 5 5 6 6 6 8 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.140000000000001, 0.379999999999995, 0.469999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6akd91457119302.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] [,11] [1,] 85.57 87.300 87.40 89.10 93.640 95.760 98.190 98.510 100.93 102.960 NA [2,] 85.81 87.305 87.89 90.48 93.710 96.625 98.200 99.725 101.72 103.570 NA [3,] 85.96 87.345 88.08 91.22 93.855 97.430 98.245 100.090 102.22 104.310 NA [4,] 86.08 87.395 88.30 91.60 94.255 97.705 98.425 100.585 102.44 105.105 NA [5,] 86.32 87.470 88.41 91.77 94.720 97.820 98.510 100.790 102.96 105.680 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.83685 87.30395 87.893 90.70916 93.60642 96.9374 98.14238 99.69775 [2,] 86.08315 87.38605 88.267 91.73084 94.10358 97.9226 98.34762 100.48225 [,9] [,10] [,11] [1,] 101.8916 103.6099 NA [2,] 102.5484 105.0101 NA $out [1] 84.97 86.32 86.77 88.41 91.77 92.16 94.72 97.82 $group [1] 1 2 2 4 5 5 6 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(85.57, 85.81, 85.96, 86.08, 86.32, 87.3, 87.305, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7qxqs1457119302.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,] 93.8740 93.9600 92.99500 [2,] 94.5055 95.1675 93.90375 [3,] 94.8680 95.6250 94.24625 [4,] 95.1820 95.9800 94.58312 [5,] 95.4380 96.2700 94.73500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 94.55944 95.25441 93.93638 [2,] 95.17656 95.99559 94.55612 $out [1] 93.381 93.245 $group [1] 1 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.874, 94.5055, 94.868, 95.182, 95.438, 93.96, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ts951457119302.ps tmp/1ts951457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/2013c1457119302.ps tmp/2013c1457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/30dl71457119302.ps tmp/30dl71457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/4r8kx1457119302.ps tmp/4r8kx1457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/5nghj1457119302.ps tmp/5nghj1457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/6akd91457119302.ps tmp/6akd91457119302.png",intern=TRUE)) character(0) > try(system("convert tmp/7qxqs1457119302.ps tmp/7qxqs1457119302.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.305 0.342 2.673