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(95.31,93.47,98.92,101.21,95.19,90.95,93.09,90.16,91.86,88.82,91.58,94.9,99.85,98.03,93.46,94.15,93.47,88.98,89.26,84.62,82.7,84.37,89.52,89.82,93.08,98.02,97.49,97.35,99.33,96.92,96.42,93.94,89.95,94.38,95.13,96.01,100.37,99.57,100.53,106.51,106.22,106.93,103.24,98.54,95.6,91.97,93.99,96.53,102.37,98.81,96.88,100.4,91.54,90.36,94.28,84.17,86.65,84.09,90.2,92.47,96.92,98.3,94.27,105.58,99.89,97.46,99.21,97.72,99.31,102.57,102.16,99.12) > 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,] 95.31 99.85 93.08 100.37 102.37 96.92 NA [2,] 93.47 98.03 98.02 99.57 98.81 98.30 NA [3,] 98.92 93.46 97.49 100.53 96.88 94.27 NA [4,] 101.21 94.15 97.35 106.51 100.40 105.58 NA [5,] 95.19 93.47 99.33 106.22 91.54 99.89 NA [6,] 90.95 88.98 96.92 106.93 90.36 97.46 NA [7,] 93.09 89.26 96.42 103.24 94.28 99.21 NA [8,] 90.16 84.62 93.94 98.54 84.17 97.72 NA [9,] 91.86 82.70 89.95 95.60 86.65 99.31 NA [10,] 88.82 84.37 94.38 91.97 84.09 102.57 NA [11,] 91.58 89.52 95.13 93.99 90.20 102.16 NA [12,] 94.90 89.82 96.01 96.53 92.47 99.12 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.84 -1.82 4.94 -0.80 -3.56 1.38 NA [2,] 5.45 -4.57 -0.53 0.96 -1.93 -4.03 NA [3,] 2.29 0.69 -0.14 5.98 3.52 11.31 NA [4,] -6.02 -0.68 1.98 -0.29 -8.86 -5.69 NA [5,] -4.24 -4.49 -2.41 0.71 -1.18 -2.43 NA [6,] 2.14 0.28 -0.50 -3.69 3.92 1.75 NA [7,] -2.93 -4.64 -2.48 -4.70 -10.11 -1.49 NA [8,] 1.70 -1.92 -3.99 -2.94 2.48 1.59 NA [9,] -3.04 1.67 4.43 -3.63 -2.56 3.26 NA [10,] 2.76 5.15 0.75 2.02 6.11 -0.41 NA [11,] 3.32 0.30 0.88 2.54 2.27 -3.04 NA [12,] 4.95 3.26 4.36 5.84 4.45 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/1e3vh1476119893.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/2km501476119893.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/3veap1476119893.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/4nedq1476119893.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,] 93.080 98.020 93.460 94.150 91.54 88.980 89.26 84.17 82.700 84.090 [2,] 95.310 98.020 94.270 97.350 93.47 90.360 93.09 84.62 86.650 84.370 [3,] 98.385 98.165 97.185 100.805 97.26 93.935 95.35 92.05 90.905 90.395 [4,] 100.370 98.810 98.920 105.580 99.89 97.460 99.21 97.72 95.600 94.380 [5,] 102.370 99.570 100.530 106.510 106.22 106.930 103.24 98.54 99.310 102.570 [,11] [,12] [1,] 89.520 89.820 [2,] 90.200 92.470 [3,] 92.785 95.455 [4,] 95.130 96.530 [5,] 102.160 99.120 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 95.12114 97.65542 94.1856 95.49638 93.11889 89.35527 91.4024 83.60008 [2,] 101.64886 98.67458 100.1844 106.11362 101.40111 98.51473 99.2976 100.49992 [,9] [,10] [,11] [,12] [1,] 85.13196 83.93823 89.60499 92.83617 [2,] 96.67804 96.85177 95.96501 98.07383 $out [1] 93.47 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(93.08, 95.31, 98.385, 100.37, 102.37, 98.02, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k90g1476119893.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,] -3.56 -4.57 -0.140 -8.860 -4.49 -3.690 -4.700 -3.990 -3.630 -0.41 -3.040 [2,] -1.84 -4.03 0.690 -6.020 -4.24 -0.500 -4.700 -2.940 -3.040 0.75 0.300 [3,] -1.31 -1.23 2.905 -3.185 -2.42 1.015 -3.785 -0.165 -0.445 2.39 1.575 [4,] 1.38 0.96 5.980 -0.290 -1.18 2.140 -2.480 1.700 3.260 5.15 2.540 [5,] 4.94 5.45 11.310 1.980 0.71 3.920 -1.490 2.480 4.430 6.11 3.320 [,12] [1,] 4.36 [2,] 4.36 [3,] 4.45 [4,] 4.95 [5,] 4.95 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3.387004 -4.448711 -0.5072209 -6.8810351 -4.3937988 -0.6878853 -5.216972 [2,] 0.767004 1.988711 6.3172209 0.5110351 -0.4462012 2.7178853 -2.353028 [,8] [,9] [,10] [,11] [,12] [1,] -3.15795 -4.508703 -0.4481421 0.1301277 4.033107 [2,] 2.82795 3.618703 5.2281421 3.0198723 4.866893 $out [1] -10.11 3.26 5.84 $group [1] 7 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3.56, -1.84, -1.31, 1.38, 4.94, -4.57000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/60b101476119893.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,] 88.820 82.70 89.950 91.970 84.090 94.270 NA [2,] 91.265 86.80 94.160 96.065 88.425 97.590 NA [3,] 93.280 89.67 96.215 99.970 92.005 99.165 NA [4,] 95.250 93.81 97.420 104.730 97.845 101.025 NA [5,] 101.210 99.85 99.330 106.930 102.370 105.580 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 91.46241 86.47269 94.72809 96.01784 87.70847 97.59827 NA [2,] 95.09759 92.86731 97.70191 103.92216 96.30153 100.73173 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(88.82, 91.265, 93.28, 95.25, 101.21, 82.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/70rw41476119893.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,] 91.01167 90.3950 89.63000 [2,] 92.64417 92.4175 92.04250 [3,] 95.59167 95.4025 95.34437 [4,] 97.65333 97.7125 97.40062 [5,] 100.86667 100.8050 101.30000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.30695 92.98741 92.90050 [2,] 97.87638 97.81759 97.78825 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(91.0116666666667, 92.6441666666667, 95.5916666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e3vh1476119893.ps tmp/1e3vh1476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/2km501476119893.ps tmp/2km501476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/3veap1476119893.ps tmp/3veap1476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/4nedq1476119893.ps tmp/4nedq1476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/5k90g1476119893.ps tmp/5k90g1476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/60b101476119893.ps tmp/60b101476119893.png",intern=TRUE)) character(0) > try(system("convert tmp/70rw41476119893.ps tmp/70rw41476119893.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.165 2.730