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(71.59,71.65,71.47,71.82,71.76,71.88,73.31,73.22,72.74,72.95,73.71,74.45,76.54,77.41,76.87,76.51,75.66,75.09,75.16,75,75.05,74.78,75.43,75.61,77.12,83.09,86.09,87.64,88.29,89.3,89.99,90.43,91.03,91.4,92.19,92.45,92.42,90.2,88.23,84.91,82.92,81.8,81.7,83.22,82.7,82.83,83.66,84.28,84.37,86.49,87.62,88.59,89.74,89.73,89.14,88.37,88.65,89.16,89.56,89.37,89.67,93.04,94.4,95.5,101.66,102.86,102.48,102.02,101.83,101.3,101.29,100.53,100.45,101.88,101.95,102.18,100.95,100.52,100.39,99.61,99.43,99.34,100.73,102.14,102.22,101.14,100.91,101.62,100,99.92,100.07,98.48,98.3,98.86,98.96,99.52,99.06,100.47,100.24,86.43,85.14,85.41,86.13,86.19,86.29,87.55,87.87,88.37) > 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,] 71.59 76.54 77.12 92.42 84.37 89.67 100.45 102.22 99.06 NA [2,] 71.65 77.41 83.09 90.20 86.49 93.04 101.88 101.14 100.47 NA [3,] 71.47 76.87 86.09 88.23 87.62 94.40 101.95 100.91 100.24 NA [4,] 71.82 76.51 87.64 84.91 88.59 95.50 102.18 101.62 86.43 NA [5,] 71.76 75.66 88.29 82.92 89.74 101.66 100.95 100.00 85.14 NA [6,] 71.88 75.09 89.30 81.80 89.73 102.86 100.52 99.92 85.41 NA [7,] 73.31 75.16 89.99 81.70 89.14 102.48 100.39 100.07 86.13 NA [8,] 73.22 75.00 90.43 83.22 88.37 102.02 99.61 98.48 86.19 NA [9,] 72.74 75.05 91.03 82.70 88.65 101.83 99.43 98.30 86.29 NA [10,] 72.95 74.78 91.40 82.83 89.16 101.30 99.34 98.86 87.55 NA [11,] 73.71 75.43 92.19 83.66 89.56 101.29 100.73 98.96 87.87 NA [12,] 74.45 75.61 92.45 84.28 89.37 100.53 102.14 99.52 88.37 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.06 0.87 5.97 -2.22 2.12 3.37 1.43 -1.08 1.41 NA [2,] -0.18 -0.54 3.00 -1.97 1.13 1.36 0.07 -0.23 -0.23 NA [3,] 0.35 -0.36 1.55 -3.32 0.97 1.10 0.23 0.71 -13.81 NA [4,] -0.06 -0.85 0.65 -1.99 1.15 6.16 -1.23 -1.62 -1.29 NA [5,] 0.12 -0.57 1.01 -1.12 -0.01 1.20 -0.43 -0.08 0.27 NA [6,] 1.43 0.07 0.69 -0.10 -0.59 -0.38 -0.13 0.15 0.72 NA [7,] -0.09 -0.16 0.44 1.52 -0.77 -0.46 -0.78 -1.59 0.06 NA [8,] -0.48 0.05 0.60 -0.52 0.28 -0.19 -0.18 -0.18 0.10 NA [9,] 0.21 -0.27 0.37 0.13 0.51 -0.53 -0.09 0.56 1.26 NA [10,] 0.76 0.65 0.79 0.83 0.40 -0.01 1.39 0.10 0.32 NA [11,] 0.74 0.18 0.26 0.62 -0.19 -0.76 1.41 0.56 0.50 NA [12,] 2.09 1.51 -0.03 0.09 0.30 -0.08 0.08 -0.46 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/1gae91444924203.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/2st5z1444924203.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/3znsm1444924203.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/4hsve1444924203.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,] 71.59 71.65 71.47 71.82 71.76 71.88 73.31 73.22 72.74 72.95 [2,] 77.12 83.09 86.09 84.91 82.92 81.80 81.70 83.22 82.70 82.83 [3,] 89.67 90.20 88.23 87.64 88.29 89.30 89.14 88.37 88.65 89.16 [4,] 99.06 100.47 100.24 95.50 100.00 99.92 100.07 98.48 98.30 98.86 [5,] 102.22 101.88 101.95 102.18 101.66 102.86 102.48 102.02 101.83 101.30 [,11] [,12] [1,] 73.71 74.45 [2,] 83.66 84.28 [3,] 89.56 89.37 [4,] 98.96 99.52 [5,] 101.29 102.14 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 78.11493 81.04653 80.77767 82.0626 79.29453 79.7568 79.46513 80.33307 [2,] 101.22507 99.35347 95.68233 93.2174 97.28547 98.8432 98.81487 96.40693 [,9] [,10] [,11] [,12] [1,] 80.434 80.71753 81.502 81.3436 [2,] 96.866 97.60247 97.618 97.3964 $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(71.59, 77.12, 89.67, 99.06, 102.22, 71.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sra11444924203.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,] -2.22 -1.97 -0.36 -1.99 -1.12 -0.59 -1.59 -0.52 -0.53 -0.01 -0.19 -0.460 [2,] 0.06 -0.23 -0.36 -1.29 -0.43 -0.13 -0.77 -0.19 -0.09 0.32 0.18 -0.055 [3,] 1.41 -0.18 0.35 -0.85 -0.01 0.07 -0.16 -0.18 0.21 0.65 0.50 0.085 [4,] 2.12 1.13 0.97 0.65 0.27 0.69 0.06 0.10 0.51 0.79 0.62 0.905 [5,] 3.37 3.00 1.55 1.15 1.20 1.43 0.44 0.28 1.26 1.39 0.74 2.090 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.3250667 -0.8962667 -0.3504667 -1.8717333 -0.3786667 -0.3618667 [2,] 2.4949333 0.5362667 1.0504667 0.1717333 0.3586667 0.5018667 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.5971333 -0.33273333 -0.106 0.4024667 0.2682667 -0.4512698 [2,] 0.2771333 -0.02726667 0.526 0.8975333 0.7317333 0.6212698 $out [1] 5.97 -3.32 -13.81 6.16 1.52 0.60 -0.76 1.41 $group [1] 1 3 3 4 7 8 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2.22, 0.0600000000000023, 1.41, 2.11999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qrl71444924203.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,] 71.470 74.780 83.090 81.700 86.490 89.670 99.340 98.300 85.140 NA [2,] 71.705 75.070 86.865 82.765 87.995 94.950 100.000 98.910 86.160 NA [3,] 72.310 75.520 89.645 83.440 88.895 101.295 100.625 99.960 86.990 NA [4,] 73.265 76.525 91.215 86.570 89.465 101.925 101.915 101.025 93.715 NA [5,] 74.450 77.410 92.450 90.200 89.740 102.860 102.180 102.220 100.470 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 71.59847 74.85636 87.66094 81.70451 88.22452 98.11366 99.75156 98.99533 [2,] 73.02153 76.18364 91.62906 85.17549 89.56548 104.47634 101.49844 100.92467 [,9] [,10] [1,] 83.54411 NA [2,] 90.43589 NA $out [1] 77.12 92.42 84.37 $group [1] 3 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(71.47, 71.705, 72.31, 73.265, 74.45, 74.78, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7gu0q1444924203.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,] 88.16000 87.640 90.2050 [2,] 88.45222 88.330 90.6725 [3,] 88.59500 89.150 90.8725 [4,] 89.37611 89.465 91.6200 [5,] 89.75333 90.200 91.9000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 88.17361 88.63232 90.44034 [2,] 89.01639 89.66768 91.30466 $out [1] 88.090 93.165 $group [1] 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(88.16, 88.4522222222222, 88.595, 89.3761111111111, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1gae91444924203.ps tmp/1gae91444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/2st5z1444924203.ps tmp/2st5z1444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/3znsm1444924203.ps tmp/3znsm1444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/4hsve1444924203.ps tmp/4hsve1444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/5sra11444924203.ps tmp/5sra11444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/6qrl71444924203.ps tmp/6qrl71444924203.png",intern=TRUE)) character(0) > try(system("convert tmp/7gu0q1444924203.ps tmp/7gu0q1444924203.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.655 0.475 3.161