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(80.44,80.9,81.03,81.6,81.56,82.08,83.44,83.55,82.63,82.43,82.42,82.48,82.51,83.23,83.41,83.88,83.96,84.32,85.82,85.72,84.36,84.36,84.36,85.08,84.95,85.62,86.22,86.4,86.71,87.51,89.22,89.43,88.24,88.9,88.78,89.25,88.8,89.46,89.66,90.29,90.08,90.42,92.14,92.09,91.35,91.22,90.99,91.48,90.98,91.52,91.62,92.12,92.26,92.18,94.12,93.82,93.2,93.34,93.11,93.63,93.29,93.69,94.19,94.82,94.52,94.94,96.87,96.6,95.43,95.56,95.37,96,95.6,96.17,96.26,97.2,97.23,97.74,99.37,99.37,98.22,98.27,97.98,98.53,97.98,98.63,98.74,99.37,99.51,99.66,101.62,101.71,100.49,100.81,100.48,101.01,100.62,101.12,101.45,101.34,101.39,101.93,102.42,102.18,102.72,102.43,102.35,102.69) > 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,] 80.44 82.51 84.95 88.80 90.98 93.29 95.60 97.98 100.62 NA [2,] 80.90 83.23 85.62 89.46 91.52 93.69 96.17 98.63 101.12 NA [3,] 81.03 83.41 86.22 89.66 91.62 94.19 96.26 98.74 101.45 NA [4,] 81.60 83.88 86.40 90.29 92.12 94.82 97.20 99.37 101.34 NA [5,] 81.56 83.96 86.71 90.08 92.26 94.52 97.23 99.51 101.39 NA [6,] 82.08 84.32 87.51 90.42 92.18 94.94 97.74 99.66 101.93 NA [7,] 83.44 85.82 89.22 92.14 94.12 96.87 99.37 101.62 102.42 NA [8,] 83.55 85.72 89.43 92.09 93.82 96.60 99.37 101.71 102.18 NA [9,] 82.63 84.36 88.24 91.35 93.20 95.43 98.22 100.49 102.72 NA [10,] 82.43 84.36 88.90 91.22 93.34 95.56 98.27 100.81 102.43 NA [11,] 82.42 84.36 88.78 90.99 93.11 95.37 97.98 100.48 102.35 NA [12,] 82.48 85.08 89.25 91.48 93.63 96.00 98.53 101.01 102.69 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.46 0.72 0.67 0.66 0.54 0.40 0.57 0.65 0.50 NA [2,] 0.13 0.18 0.60 0.20 0.10 0.50 0.09 0.11 0.33 NA [3,] 0.57 0.47 0.18 0.63 0.50 0.63 0.94 0.63 -0.11 NA [4,] -0.04 0.08 0.31 -0.21 0.14 -0.30 0.03 0.14 0.05 NA [5,] 0.52 0.36 0.80 0.34 -0.08 0.42 0.51 0.15 0.54 NA [6,] 1.36 1.50 1.71 1.72 1.94 1.93 1.63 1.96 0.49 NA [7,] 0.11 -0.10 0.21 -0.05 -0.30 -0.27 0.00 0.09 -0.24 NA [8,] -0.92 -1.36 -1.19 -0.74 -0.62 -1.17 -1.15 -1.22 0.54 NA [9,] -0.20 0.00 0.66 -0.13 0.14 0.13 0.05 0.32 -0.29 NA [10,] -0.01 0.00 -0.12 -0.23 -0.23 -0.19 -0.29 -0.33 -0.08 NA [11,] 0.06 0.72 0.47 0.49 0.52 0.63 0.55 0.53 0.34 NA [12,] 0.03 -0.13 -0.45 -0.50 -0.34 -0.40 -0.55 -0.39 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/19dwr1444916342.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/2o5af1444916342.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/3a6qw1444916342.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/40cyn1444916342.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,] 80.44 80.90 81.03 81.60 81.56 82.08 83.44 83.55 82.63 82.43 [2,] 84.95 85.62 86.22 86.40 86.71 87.51 89.22 89.43 88.24 88.90 [3,] 90.98 91.52 91.62 92.12 92.26 92.18 94.12 93.82 93.20 93.34 [4,] 95.60 96.17 96.26 97.20 97.23 97.74 99.37 99.37 98.22 98.27 [5,] 100.62 101.12 101.45 101.34 101.39 101.93 102.42 102.18 102.72 102.43 [,11] [,12] [1,] 82.42 82.48 [2,] 88.78 89.25 [3,] 93.11 93.63 [4,] 97.98 98.53 [5,] 102.35 102.69 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.371 85.96367 86.33227 86.432 86.71947 86.7922 88.77433 88.58493 [2,] 96.589 97.07633 96.90773 97.808 97.80053 97.5678 99.46567 99.05507 [,9] [,10] [,11] [,12] [1,] 87.94387 88.40513 88.26467 88.74253 [2,] 98.45613 98.27487 97.95533 98.51747 $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(80.44, 84.95, 90.98, 95.6, 100.62, 80.9, 85.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51end1444916342.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.40 0.09 0.47 -0.30 0.15 1.36 -0.30 -1.36 -0.29 -0.33 0.47 -0.550 [2,] 0.50 0.11 0.47 -0.04 0.34 1.50 -0.24 -1.19 -0.13 -0.23 0.47 -0.475 [3,] 0.57 0.18 0.57 0.05 0.42 1.71 -0.05 -1.15 0.05 -0.19 0.52 -0.395 [4,] 0.66 0.33 0.63 0.14 0.52 1.93 0.09 -0.74 0.14 -0.08 0.55 -0.235 [5,] 0.72 0.60 0.63 0.31 0.54 1.96 0.21 -0.62 0.32 0.00 0.63 0.030 $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.4857333 0.06413333 0.4857333 -0.0448 0.3252 1.483533 -0.2238 -1.387 [2,] 0.6542667 0.29586667 0.6542667 0.1448 0.5148 1.936467 0.1238 -0.913 [,9] [,10] [,11] [,12] [1,] -0.0922 -0.269 0.4778667 -0.5290674 [2,] 0.1922 -0.111 0.5621333 -0.2609326 $out [1] 0.18 0.94 -0.11 0.80 -0.08 0.49 0.54 0.66 0.06 0.72 0.34 $group [1] 3 3 3 5 5 6 8 9 11 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.399999999999991, 0.5, 0.570000000000007, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lkww1444916342.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,] 80.440 82.510 84.950 88.800 90.980 93.290 95.60 97.980 100.620 NA [2,] 81.295 83.645 86.310 89.870 91.870 94.355 96.73 99.055 101.365 NA [3,] 82.250 84.340 87.875 90.705 92.685 95.155 97.86 100.070 102.055 NA [4,] 82.555 84.720 89.060 91.415 93.485 95.780 98.40 100.910 102.425 NA [5,] 83.550 85.820 89.430 92.140 94.120 96.870 99.37 101.710 102.720 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 81.67531 83.84969 86.62071 90.00032 91.94839 94.50505 97.0983 99.22392 [2,] 82.82469 84.83031 89.12929 91.40968 93.42161 95.80495 98.6217 100.91608 [,9] [,10] [1,] 101.5715 NA [2,] 102.5385 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(80.44, 81.295, 82.25, 82.555, 83.55, 82.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7yla91444916342.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,] 90.57444 90.980 90.2750 [2,] 91.64444 91.870 91.5200 [3,] 92.59000 92.685 92.9275 [4,] 93.19278 93.485 93.7375 [5,] 93.89111 94.120 94.4000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 91.88379 91.94839 91.91608 [2,] 93.29621 93.42161 93.93892 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(90.5744444444445, 91.6444444444444, 92.59, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19dwr1444916342.ps tmp/19dwr1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/2o5af1444916342.ps tmp/2o5af1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/3a6qw1444916342.ps tmp/3a6qw1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/40cyn1444916342.ps tmp/40cyn1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/51end1444916342.ps tmp/51end1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/6lkww1444916342.ps tmp/6lkww1444916342.png",intern=TRUE)) character(0) > try(system("convert tmp/7yla91444916342.ps tmp/7yla91444916342.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.349 0.499 2.878