R version 3.2.2 (2015-08-14) -- "Fire Safety" 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) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 92.09 98.92 105.91 110.39 102.59 99.99 99.15 99.63 97.99 NA [2,] 93.77 97.98 108.95 111.05 102.91 99.39 100.17 100.08 97.57 NA [3,] 94.44 98.76 110.07 110.85 101.94 99.52 99.98 100.07 98.28 NA [4,] 94.91 99.76 109.92 110.24 101.80 99.21 100.07 100.55 97.97 NA [5,] 94.78 99.87 109.87 108.70 102.25 99.38 99.94 99.98 97.99 NA [6,] 94.51 100.09 110.54 109.93 102.60 99.37 100.05 99.89 97.84 NA [7,] 94.36 100.07 110.79 109.53 102.49 99.38 99.13 99.86 97.33 NA [8,] 96.60 99.46 110.32 109.83 102.13 99.26 98.74 99.61 96.70 NA [9,] 96.72 100.40 110.76 107.86 100.76 99.36 98.64 100.12 96.79 NA [10,] 96.71 101.25 110.24 104.61 100.86 99.20 98.44 100.24 96.76 NA [11,] 97.44 102.29 110.27 103.61 101.12 98.53 98.81 100.10 96.23 NA [12,] 97.83 102.10 110.11 103.11 100.74 98.65 98.88 99.86 96.29 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.68 -0.94 3.04 0.66 0.32 -0.60 1.02 0.45 -0.42 NA [2,] 0.67 0.78 1.12 -0.20 -0.97 0.13 -0.19 -0.01 0.71 NA [3,] 0.47 1.00 -0.15 -0.61 -0.14 -0.31 0.09 0.48 -0.31 NA [4,] -0.13 0.11 -0.05 -1.54 0.45 0.17 -0.13 -0.57 0.02 NA [5,] -0.27 0.22 0.67 1.23 0.35 -0.01 0.11 -0.09 -0.15 NA [6,] -0.15 -0.02 0.25 -0.40 -0.11 0.01 -0.92 -0.03 -0.51 NA [7,] 2.24 -0.61 -0.47 0.30 -0.36 -0.12 -0.39 -0.25 -0.63 NA [8,] 0.12 0.94 0.44 -1.97 -1.37 0.10 -0.10 0.51 0.09 NA [9,] -0.01 0.85 -0.52 -3.25 0.10 -0.16 -0.20 0.12 -0.03 NA [10,] 0.73 1.04 0.03 -1.00 0.26 -0.67 0.37 -0.14 -0.53 NA [11,] 0.39 -0.19 -0.16 -0.50 -0.38 0.12 0.07 -0.24 0.06 NA [12,] 1.09 3.81 0.28 -0.52 -0.75 0.50 0.75 -1.87 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/1zm5z1445086901.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/21oxe1445086901.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/3h5y31445086901.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/4scau1445086901.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,] 97.99 93.77 94.44 97.97 97.99 97.84 94.36 96.60 96.72 96.71 [2,] 98.92 97.98 98.76 99.21 99.38 99.37 99.13 98.74 98.64 98.44 [3,] 99.63 100.08 99.98 100.07 99.94 100.05 99.86 99.46 100.12 100.24 [4,] 102.59 102.91 101.94 101.80 102.25 102.60 102.49 102.13 100.76 101.25 [5,] 105.91 108.95 101.94 101.80 102.25 102.60 102.49 102.13 100.76 104.61 [,11] [,12] [1,] 96.23 96.29 [2,] 98.53 98.65 [3,] 100.10 99.86 [4,] 102.29 102.10 [5,] 103.61 103.11 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 97.69713 97.48353 98.3052 98.70593 98.42847 98.34887 98.0904 [2,] 101.56287 102.67647 101.6548 101.43407 101.45153 101.75113 101.6296 [,8] [,9] [,10] [,11] [,12] [1,] 97.6746 99.00347 98.76007 98.11973 98.043 [2,] 101.2454 101.23653 101.71993 102.08027 101.677 $out [1] 92.09 110.39 111.05 110.07 110.85 94.91 109.92 110.24 94.78 109.87 [11] 108.70 94.51 110.54 109.93 110.79 109.53 110.32 109.83 110.76 107.86 [21] 110.24 110.27 110.11 $group [1] 1 1 2 3 3 4 4 4 5 5 5 6 6 6 7 7 8 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(97.99, 98.92, 99.63, 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/5b6cv1445086901.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.94 -0.97 -0.61 -0.13 -0.27 -0.92 -0.63 -0.10 -0.52 -1.00 -0.50 -1.870 [2,] -0.42 -0.19 -0.31 -0.13 -0.09 -0.40 -0.47 -0.10 -0.20 -0.53 -0.24 -0.635 [3,] 0.45 0.13 -0.14 -0.05 0.11 -0.11 -0.36 0.10 -0.03 0.03 -0.16 0.390 [4,] 1.02 0.71 0.47 0.11 0.35 -0.02 -0.12 0.44 0.10 0.37 0.07 0.920 [5,] 3.04 1.12 1.00 0.45 0.67 0.25 0.30 0.94 0.12 1.04 0.39 1.090 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -0.3084 -0.344 -0.5508 -0.1764 -0.1217333 -0.31013333 -0.5443333 -0.1844 [2,] 1.2084 0.604 0.2708 0.0764 0.3417333 0.09013333 -0.1756667 0.3844 [,9] [,10] [,11] [,12] [1,] -0.188 -0.444 -0.323266667 -0.4786453 [2,] 0.128 0.504 0.003266667 1.2586453 $out [1] -1.54 -0.57 1.23 2.24 -1.97 -1.37 0.85 -3.25 3.81 $group [1] 4 4 5 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.450000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/63orr1445086901.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 NA [2,] 94.400 99.190 109.895 106.235 100.990 99.205 98.775 99.860 96.73 NA [3,] 94.845 99.970 110.175 109.680 102.035 99.365 99.140 100.025 97.45 NA [4,] 96.715 100.825 110.430 110.315 102.540 99.385 100.015 100.110 97.98 NA [5,] 97.830 102.290 110.790 111.050 102.910 99.520 100.170 100.240 98.28 NA $n [1] 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] [1,] 96.87987 NA [2,] 98.02013 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" 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/7sllq1445086901.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.7400 99.630 99.8450 [2,] 100.9283 99.860 100.3625 [3,] 101.3622 100.015 100.4400 [4,] 101.4917 100.090 100.7825 [5,] 101.6467 100.240 100.9850 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.1053 99.9101 100.2484 [2,] 101.6192 100.1199 100.6316 $out [1] 99.46 99.70 $group [1] 2 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.74, 100.928333333333, 101.362222222222, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zm5z1445086901.ps tmp/1zm5z1445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/21oxe1445086901.ps tmp/21oxe1445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/3h5y31445086901.ps tmp/3h5y31445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/4scau1445086901.ps tmp/4scau1445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/5b6cv1445086901.ps tmp/5b6cv1445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/63orr1445086901.ps tmp/63orr1445086901.png",intern=TRUE)) character(0) > try(system("convert tmp/7sllq1445086901.ps tmp/7sllq1445086901.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.442 0.429 2.898