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(92.09,93.77,94.44,94.91,94.78,94.51,94.36,96.6,96.72,96.71,97.44,97.83,98.92,97.98,98.76,99.76,99.87,100.09,100.07,99.46,100.4,101.25,102.29,102.1,105.91,108.95,110.07,109.92,109.87,110.54,110.79,110.32,110.76,110.24,110.27,110.11,110.39,111.05,110.85,110.24,108.7,109.93,109.53,109.83,107.86,104.61,103.61,103.11,102.59,102.91,101.94,101.8,102.25,102.6,102.49,102.13,100.76,100.86,101.12,100.74,99.99,99.39,99.52,99.21,99.38,99.37,99.38,99.26,99.36,99.2,98.53,98.65,99.15,100.17,99.98,100.07,99.94,100.05,99.13,98.74,98.64,98.44,98.81,98.88,99.63,100.08,100.07,100.55,99.98,99.89,99.86,99.61,100.12,100.24,100.1,99.86,97.99,97.57,98.28,97.97,97.99,97.84,97.33,96.7,96.79,96.76,96.23,96.29,96.46,97.23,97.59,97.13,97.37,96.12,96.96,96.7,97,97.15,96.51,96.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,] 92.09 98.92 105.91 110.39 102.59 99.99 99.15 99.63 97.99 96.46 NA [2,] 93.77 97.98 108.95 111.05 102.91 99.39 100.17 100.08 97.57 97.23 NA [3,] 94.44 98.76 110.07 110.85 101.94 99.52 99.98 100.07 98.28 97.59 NA [4,] 94.91 99.76 109.92 110.24 101.80 99.21 100.07 100.55 97.97 97.13 NA [5,] 94.78 99.87 109.87 108.70 102.25 99.38 99.94 99.98 97.99 97.37 NA [6,] 94.51 100.09 110.54 109.93 102.60 99.37 100.05 99.89 97.84 96.12 NA [7,] 94.36 100.07 110.79 109.53 102.49 99.38 99.13 99.86 97.33 96.96 NA [8,] 96.60 99.46 110.32 109.83 102.13 99.26 98.74 99.61 96.70 96.70 NA [9,] 96.72 100.40 110.76 107.86 100.76 99.36 98.64 100.12 96.79 97.00 NA [10,] 96.71 101.25 110.24 104.61 100.86 99.20 98.44 100.24 96.76 97.15 NA [11,] 97.44 102.29 110.27 103.61 101.12 98.53 98.81 100.10 96.23 96.51 NA [12,] 97.83 102.10 110.11 103.11 100.74 98.65 98.88 99.86 96.29 96.68 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 1.68 -0.94 3.04 0.66 0.32 -0.60 1.02 0.45 -0.42 0.77 NA [2,] 0.67 0.78 1.12 -0.20 -0.97 0.13 -0.19 -0.01 0.71 0.36 NA [3,] 0.47 1.00 -0.15 -0.61 -0.14 -0.31 0.09 0.48 -0.31 -0.46 NA [4,] -0.13 0.11 -0.05 -1.54 0.45 0.17 -0.13 -0.57 0.02 0.24 NA [5,] -0.27 0.22 0.67 1.23 0.35 -0.01 0.11 -0.09 -0.15 -1.25 NA [6,] -0.15 -0.02 0.25 -0.40 -0.11 0.01 -0.92 -0.03 -0.51 0.84 NA [7,] 2.24 -0.61 -0.47 0.30 -0.36 -0.12 -0.39 -0.25 -0.63 -0.26 NA [8,] 0.12 0.94 0.44 -1.97 -1.37 0.10 -0.10 0.51 0.09 0.30 NA [9,] -0.01 0.85 -0.52 -3.25 0.10 -0.16 -0.20 0.12 -0.03 0.15 NA [10,] 0.73 1.04 0.03 -1.00 0.26 -0.67 0.37 -0.14 -0.53 -0.64 NA [11,] 0.39 -0.19 -0.16 -0.50 -0.38 0.12 0.07 -0.24 0.06 0.17 NA [12,] 1.09 3.81 0.28 -0.52 -0.75 0.50 0.75 -1.87 0.17 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/1j4da1458035705.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/2gam11458035705.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/309fr1458035705.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/47teo1458035705.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,] 92.09 93.770 94.44 94.910 94.780 94.51 94.36 96.60 96.72 96.71 [2,] 97.99 97.570 98.28 97.970 97.990 97.84 97.33 96.70 97.00 97.15 [3,] 99.39 99.735 99.75 99.915 99.905 99.97 99.62 99.36 99.74 99.72 [4,] 102.59 102.910 101.94 101.800 102.250 102.60 102.49 102.13 100.76 101.25 [5,] 105.91 108.950 101.94 101.800 102.250 102.60 109.53 109.83 100.76 104.61 [,11] [,12] [1,] 96.230 96.29 [2,] 97.440 97.83 [3,] 99.455 99.37 [4,] 102.290 102.10 [5,] 103.610 103.11 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.09166 97.06692 97.92132 98.00138 97.77653 97.59171 97.04186 [2,] 101.68834 102.40308 101.57868 101.82862 102.03347 102.34829 102.19814 [,8] [,9] [,10] [,11] [,12] [1,] 96.64696 97.86135 97.67148 97.03175 97.23654 [2,] 102.07304 101.61865 101.76852 101.87825 101.50346 $out [1] 110.39 111.05 110.07 110.85 109.92 110.24 109.87 108.70 110.54 109.93 [11] 110.79 110.32 110.76 107.86 110.24 110.27 110.11 $group [1] 1 2 3 3 4 4 5 5 6 6 7 8 9 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(92.09, 97.99, 99.39, 102.59, 105.91, 93.77, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pw0e1458035705.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,] -0.940 -0.970 -0.610 -0.570 -0.27 -0.92 -0.63 -0.10 -0.52 -1.000 -0.50 [2,] -0.420 -0.190 -0.310 -0.130 -0.15 -0.40 -0.47 -0.10 -0.20 -0.640 -0.24 [3,] 0.555 0.245 -0.145 -0.015 0.05 -0.07 -0.31 0.11 -0.02 -0.055 -0.05 [4,] 1.020 0.710 0.470 0.170 0.35 0.01 -0.12 0.44 0.12 0.370 0.12 [5,] 3.040 1.120 1.000 0.450 0.67 0.25 0.30 0.94 0.15 1.040 0.39 [,12] [1,] -1.87 [2,] -0.52 [3,] 0.28 [4,] 0.75 [5,] 1.09 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1644814 -0.2046759 -0.5347191 -0.164892 -0.1998199 -0.2748523 -0.484874 [2,] 1.2744814 0.6946759 0.2447191 0.134892 0.2998199 0.1348523 -0.135126 [,8] [,9] [,10] [,11] [,12] [1,] -0.1598055 -0.1798848 -0.5596363 -0.2298704 -0.3888667 [2,] 0.3798055 0.1398848 0.4496363 0.1298704 0.9488667 $out [1] -1.54 1.23 -1.25 0.84 2.24 -1.97 -1.37 0.85 -3.25 3.81 $group [1] 4 5 5 6 7 8 8 9 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.939999999999998, -0.420000000000002, 0.555, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/687ye1458035705.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,] 92.090 97.980 109.870 103.110 100.740 99.200 98.440 99.610 96.23 96.120 [2,] 94.400 99.190 109.895 106.235 100.990 99.205 98.775 99.860 96.73 96.595 [3,] 94.845 99.970 110.175 109.680 102.035 99.365 99.140 100.025 97.45 96.980 [4,] 96.715 100.825 110.430 110.315 102.540 99.385 100.015 100.110 97.98 97.190 [5,] 97.830 102.290 110.790 111.050 102.910 99.520 100.170 100.240 98.28 97.590 [,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,] 93.78911 99.22427 109.931 107.8191 101.328 99.2829 98.57443 99.91097 [2,] 95.90089 100.71573 110.419 111.5409 102.742 99.4471 99.70557 100.13903 [,9] [,10] [,11] [1,] 96.87987 96.70862 NA [2,] 98.02013 97.25138 NA $out [1] 105.91 108.95 99.99 98.53 98.65 100.55 $group [1] 3 3 6 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(92.09, 94.4, 94.845, 96.715, 97.83, 97.98, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7w6vk1458035705.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,] 100.3120 99.3600 99.04000 [2,] 100.5185 99.4225 99.59375 [3,] 100.9225 99.7275 99.89062 [4,] 101.0535 99.8275 99.97938 [5,] 101.1560 99.9700 100.09750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.6785 99.54278 99.71474 [2,] 101.1665 99.91222 100.06651 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.312, 100.5185, 100.9225, 101.0535, 101.156, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1j4da1458035705.ps tmp/1j4da1458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/2gam11458035705.ps tmp/2gam11458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/309fr1458035705.ps tmp/309fr1458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/47teo1458035705.ps tmp/47teo1458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/5pw0e1458035705.ps tmp/5pw0e1458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/687ye1458035705.ps tmp/687ye1458035705.png",intern=TRUE)) character(0) > try(system("convert tmp/7w6vk1458035705.ps tmp/7w6vk1458035705.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.468 0.499 3.002