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(72.04,72.26,72.53,72.41,72.91,72.84,72.92,73.03,72.98,72.99,73.15,73.34,73.8,74.46,74.54,74.92,74.19,74.34,74.54,74.4,73.78,74.42,73.54,74.45,76.31,76.44,76.64,76.44,76.49,76.52,78.15,78.54,78.79,78.75,78.28,78.44,78.75,80.54,80.84,81.11,80.47,80.53,80.35,80.29,80.27,80.1,79.8,79.84,79.92,80.26,80.69,84.5,85.45,86.19,86.4,85.98,85.87,86.06,86.43,86.43,86.37,86.84,86.73,90.99,92.61,93.83,94.2,94.01,93.47,93.27,94.3,94.53,94.59,94.69,94.67,96.55,97.14,97.32,97.97,98.49,99.11,99.09,98.76,99.2,99.61,99.54,99.68,100.75,100.38,100.79,100.39,100.39,100.12,100,99.17,99.17,99.59,99.96,99.68,101.03,100.99,101.38,101.84,101.52,101.37,101.22,101.45,101.99) > 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] 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,] 72.04 73.80 76.31 78.75 79.92 86.37 94.59 99.61 99.59 NA [2,] 72.26 74.46 76.44 80.54 80.26 86.84 94.69 99.54 99.96 NA [3,] 72.53 74.54 76.64 80.84 80.69 86.73 94.67 99.68 99.68 NA [4,] 72.41 74.92 76.44 81.11 84.50 90.99 96.55 100.75 101.03 NA [5,] 72.91 74.19 76.49 80.47 85.45 92.61 97.14 100.38 100.99 NA [6,] 72.84 74.34 76.52 80.53 86.19 93.83 97.32 100.79 101.38 NA [7,] 72.92 74.54 78.15 80.35 86.40 94.20 97.97 100.39 101.84 NA [8,] 73.03 74.40 78.54 80.29 85.98 94.01 98.49 100.39 101.52 NA [9,] 72.98 73.78 78.79 80.27 85.87 93.47 99.11 100.12 101.37 NA [10,] 72.99 74.42 78.75 80.10 86.06 93.27 99.09 100.00 101.22 NA [11,] 73.15 73.54 78.28 79.80 86.43 94.30 98.76 99.17 101.45 NA [12,] 73.34 74.45 78.44 79.84 86.43 94.53 99.20 99.17 101.99 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.22 0.66 0.13 1.79 0.34 0.47 0.10 -0.07 0.37 NA [2,] 0.27 0.08 0.20 0.30 0.43 -0.11 -0.02 0.14 -0.28 NA [3,] -0.12 0.38 -0.20 0.27 3.81 4.26 1.88 1.07 1.35 NA [4,] 0.50 -0.73 0.05 -0.64 0.95 1.62 0.59 -0.37 -0.04 NA [5,] -0.07 0.15 0.03 0.06 0.74 1.22 0.18 0.41 0.39 NA [6,] 0.08 0.20 1.63 -0.18 0.21 0.37 0.65 -0.40 0.46 NA [7,] 0.11 -0.14 0.39 -0.06 -0.42 -0.19 0.52 0.00 -0.32 NA [8,] -0.05 -0.62 0.25 -0.02 -0.11 -0.54 0.62 -0.27 -0.15 NA [9,] 0.01 0.64 -0.04 -0.17 0.19 -0.20 -0.02 -0.12 -0.15 NA [10,] 0.16 -0.88 -0.47 -0.30 0.37 1.03 -0.33 -0.83 0.23 NA [11,] 0.19 0.91 0.16 0.04 0.00 0.23 0.44 0.00 0.54 NA [12,] 0.46 1.86 0.31 0.08 -0.06 0.06 0.41 0.42 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/1lzar1450536582.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/2oizo1450536582.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/3ebph1450536582.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/48ksc1450536582.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] [,11] [1,] 72.04 72.26 72.53 72.41 72.91 72.84 72.92 73.03 72.98 72.99 73.15 [2,] 76.31 76.44 76.64 76.44 76.49 76.52 78.15 78.54 78.79 78.75 78.28 [3,] 79.92 80.54 80.84 84.50 85.45 86.19 86.40 85.98 85.87 86.06 86.43 [4,] 94.59 94.69 94.67 96.55 97.14 97.32 97.97 98.49 99.11 99.09 98.76 [5,] 99.61 99.96 99.68 101.03 100.99 101.38 101.84 101.52 101.37 101.22 101.45 [,12] [1,] 73.34 [2,] 78.44 [3,] 86.43 [4,] 99.17 [5,] 101.99 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 70.29253 70.92833 71.3442 73.90873 74.57433 75.23533 75.96147 75.473 [2,] 89.54747 90.15167 90.3358 95.09127 96.32567 97.14467 96.83853 96.487 [,9] [,10] [,11] [,12] [1,] 75.16813 75.3476 75.64387 75.5122 [2,] 96.57187 96.7724 97.21613 97.3478 $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(72.04, 76.31, 79.92, 94.59, 99.61, 72.26, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gb4h1450536582.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.07 -0.28 -0.20 -0.73 -0.07 -0.40 -0.42 -0.62 -0.20 -0.88 0.00 -0.06 [2,] 0.13 -0.02 0.27 -0.37 0.06 0.08 -0.19 -0.27 -0.15 -0.47 0.04 0.07 [3,] 0.34 0.14 1.07 0.05 0.18 0.21 -0.06 -0.11 -0.04 -0.30 0.19 0.36 [4,] 0.47 0.27 1.88 0.59 0.41 0.46 0.11 -0.02 0.01 0.23 0.44 0.44 [5,] 0.66 0.43 4.26 1.62 0.74 0.65 0.52 0.25 0.19 1.03 0.91 0.46 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1609333 -0.01273333 0.2220667 -0.4556 -0.004333333 0.009866667 -0.218 [2,] 0.5190667 0.29273333 1.9179333 0.5556 0.364333333 0.410133333 0.098 [,8] [,9] [,10] [,11] [,12] [1,] -0.24166667 -0.12426667 -0.66866667 -0.02066667 0.1533127 [2,] 0.02166667 0.04426667 0.06866667 0.40066667 0.5666873 $out [1] 1.79 1.22 1.63 0.62 0.64 1.86 $group [1] 1 5 6 8 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0699999999999932, 0.129999999999995, 0.340000000000003, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qk1a1450536582.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,] 72.040 73.540 76.310 79.800 79.920 86.370 94.590 99.170 99.590 NA [2,] 72.470 73.995 76.465 79.970 82.595 88.915 95.620 99.575 100.475 NA [3,] 72.915 74.410 77.395 80.320 85.925 93.370 97.645 100.060 101.295 NA [4,] 73.010 74.500 78.490 80.535 86.295 94.105 98.925 100.390 101.485 NA [5,] 73.340 74.920 78.790 81.110 86.430 94.530 99.200 100.790 101.990 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 72.6687 74.17967 76.47138 80.0623 84.23741 91.00281 96.13757 99.68827 [2,] 73.1613 74.64033 78.31862 80.5777 87.61259 95.73719 99.15243 100.43173 [,9] [,10] [1,] 100.8343 NA [2,] 101.7557 NA $out [1] 78.75 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(72.04, 72.47, 72.915, 73.01, 73.34, 73.54, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74vol1450536582.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,] 84.55333 79.920 85.4500 [2,] 85.81667 82.670 86.0750 [3,] 87.14556 85.925 87.4900 [4,] 87.36389 86.295 88.6625 [5,] 87.48778 86.430 88.9500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 86.43986 84.27161 86.30982 [2,] 87.85125 87.57839 88.67018 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(84.5533333333333, 85.8166666666667, 87.1455555555556, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1lzar1450536582.ps tmp/1lzar1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/2oizo1450536582.ps tmp/2oizo1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/3ebph1450536582.ps tmp/3ebph1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/48ksc1450536582.ps tmp/48ksc1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/5gb4h1450536582.ps tmp/5gb4h1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/6qk1a1450536582.ps tmp/6qk1a1450536582.png",intern=TRUE)) character(0) > try(system("convert tmp/74vol1450536582.ps tmp/74vol1450536582.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.442 0.499 2.970