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(78.25,77.24,76.68,76.29,76.1,75.77,75.6,75.57,75.89,76.04,76.89,77,79.09,80.84,81.82,82.12,81.01,82.22,81.97,82.42,82.77,82.46,83.35,84.27,87.34,91.03,93.52,94.24,94.92,95.49,96.55,98.07,102.87,104.12,103.49,103.31,103.92,103.69,103.41,102.83,103,103.42,102.57,102.72,102.22,102.32,102.48,101.56,101.02,101.41,100.74,99.76,99.76,99.17,99.11,99.69,99.4,99.79,99.72,98.74,98.26,97.31,96.73,96.18,95.92,96.13,95.64,94.52,94.31,96.05,96.17,95.14,95.37,96.5,96.79,96.23,96,95.21,94.77,96.84,99.06,100.36,100.09,100.03,100.49,101,102.11,101.59,100.81,100.86,99.57,100.21,99.68,98.38,97.93,97.37,99.08,99.15,99.44,99.48,99.62,98.95,99.42,99.84,99.27,99.16,99.04,99.62) > 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,] 78.25 79.09 87.34 103.92 101.02 98.26 95.37 100.49 99.08 NA [2,] 77.24 80.84 91.03 103.69 101.41 97.31 96.50 101.00 99.15 NA [3,] 76.68 81.82 93.52 103.41 100.74 96.73 96.79 102.11 99.44 NA [4,] 76.29 82.12 94.24 102.83 99.76 96.18 96.23 101.59 99.48 NA [5,] 76.10 81.01 94.92 103.00 99.76 95.92 96.00 100.81 99.62 NA [6,] 75.77 82.22 95.49 103.42 99.17 96.13 95.21 100.86 98.95 NA [7,] 75.60 81.97 96.55 102.57 99.11 95.64 94.77 99.57 99.42 NA [8,] 75.57 82.42 98.07 102.72 99.69 94.52 96.84 100.21 99.84 NA [9,] 75.89 82.77 102.87 102.22 99.40 94.31 99.06 99.68 99.27 NA [10,] 76.04 82.46 104.12 102.32 99.79 96.05 100.36 98.38 99.16 NA [11,] 76.89 83.35 103.49 102.48 99.72 96.17 100.09 97.93 99.04 NA [12,] 77.00 84.27 103.31 101.56 98.74 95.14 100.03 97.37 99.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -1.01 1.75 3.69 -0.23 0.39 -0.95 1.13 0.51 0.07 NA [2,] -0.56 0.98 2.49 -0.28 -0.67 -0.58 0.29 1.11 0.29 NA [3,] -0.39 0.30 0.72 -0.58 -0.98 -0.55 -0.56 -0.52 0.04 NA [4,] -0.19 -1.11 0.68 0.17 0.00 -0.26 -0.23 -0.78 0.14 NA [5,] -0.33 1.21 0.57 0.42 -0.59 0.21 -0.79 0.05 -0.67 NA [6,] -0.17 -0.25 1.06 -0.85 -0.06 -0.49 -0.44 -1.29 0.47 NA [7,] -0.03 0.45 1.52 0.15 0.58 -1.12 2.07 0.64 0.42 NA [8,] 0.32 0.35 4.80 -0.50 -0.29 -0.21 2.22 -0.53 -0.57 NA [9,] 0.15 -0.31 1.25 0.10 0.39 1.74 1.30 -1.30 -0.11 NA [10,] 0.85 0.89 -0.63 0.16 -0.07 0.12 -0.27 -0.45 -0.12 NA [11,] 0.11 0.92 -0.18 -0.92 -0.98 -1.03 -0.06 -0.56 0.58 NA [12,] 2.09 3.07 0.61 -0.54 -0.48 0.23 0.46 1.71 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/1zymc1448651328.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/23w9c1448651328.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/34ei11448651328.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/4f4dq1448651328.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,] 78.25 77.24 93.52 94.24 94.92 95.21 94.77 94.52 94.31 96.05 [2,] 87.34 91.03 93.52 94.24 94.92 95.21 94.77 94.52 94.31 96.05 [3,] 98.26 97.31 96.79 96.23 96.00 96.13 96.55 98.07 99.27 99.16 [4,] 100.49 101.00 100.74 99.76 99.76 99.17 99.42 99.84 99.68 100.36 [5,] 103.92 103.69 103.41 102.83 103.00 103.42 102.57 102.72 102.87 104.12 [,11] [,12] [1,] 96.17 95.14 [2,] 96.17 95.14 [3,] 99.04 98.74 [4,] 100.09 100.03 [5,] 103.49 103.31 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 91.33433 92.05913 92.98747 93.3228 93.45093 94.0444 94.101 95.26813 [2,] 105.18567 102.56087 100.59253 99.1372 98.54907 98.2156 98.999 100.87187 [,9] [,10] [,11] [,12] [1,] 96.4418 96.89007 96.97547 96.1646 [2,] 102.0982 101.42993 101.10453 101.3154 $out [1] 76.68 81.82 76.29 82.12 76.10 81.01 75.77 82.22 75.60 81.97 75.57 82.42 [13] 75.89 82.77 76.04 82.46 76.89 83.35 77.00 84.27 $group [1] 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.25, 87.34, 98.26, 100.49, 103.92, 77.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5viam1448651328.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,] -1.01 -0.67 -0.98 -0.78 -0.79 -0.85 -0.03 -0.57 -1.30 -0.63 -1.03 -0.540 [2,] -0.23 -0.56 -0.56 -0.26 -0.59 -0.49 0.15 -0.50 -0.11 -0.27 -0.92 -0.125 [3,] 0.39 0.29 -0.52 -0.19 0.05 -0.25 0.45 -0.21 0.15 -0.07 -0.18 0.535 [4,] 1.13 0.98 0.04 0.14 0.42 -0.06 0.64 0.35 1.25 0.16 0.11 1.900 [5,] 1.75 2.49 0.72 0.68 1.21 0.47 0.64 0.35 1.74 0.16 0.92 3.070 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.3262667 -0.5210667 -0.836 -0.40066667 -0.4819333 -0.47646667 0.1919333 [2,] 1.1062667 1.1010667 -0.204 0.02066667 0.5819333 -0.02353333 0.7080667 [,8] [,9] [,10] [,11] [,12] [1,] -0.6576667 -0.5662667 -0.2964667 -0.7224667 -0.5961941 [2,] 0.2376667 0.8662667 0.1564667 0.3624667 1.6661941 $out [1] 3.69 -1.11 1.06 -1.29 1.52 -1.12 2.07 4.80 2.22 0.85 0.89 $group [1] 1 4 6 6 7 7 7 8 8 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.01000000000001, -0.230000000000004, 0.390000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6nw371448651328.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,] 75.570 80.840 87.34 101.560 98.740 94.310 94.770 97.370 98.950 NA [2,] 75.830 81.415 93.88 102.400 99.285 95.390 95.685 98.975 99.115 NA [3,] 76.195 82.170 96.02 102.775 99.740 96.090 96.645 100.350 99.345 NA [4,] 76.945 82.615 103.09 103.415 100.265 96.455 99.545 100.930 99.550 NA [5,] 78.250 84.270 104.12 103.920 101.410 97.310 100.360 102.110 99.840 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 75.68644 81.62267 91.81926 102.3121 99.29302 95.60425 94.88443 99.45831 [2,] 76.70356 82.71733 100.22074 103.2379 100.18698 96.57575 98.40557 101.24169 [,9] [,10] [1,] 99.14659 NA [2,] 99.54341 NA $out [1] 79.09 98.26 $group [1] 2 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(75.57, 75.83, 76.195, 76.945, 78.25, 80.84, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7b1v31448651328.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,] 93.64667 96.00 96.9950 [2,] 94.13111 96.39 96.9975 [3,] 94.36667 97.69 97.1550 [4,] 95.13944 98.89 97.4625 [5,] 95.46222 99.27 98.1300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.90676 96.54973 96.94291 [2,] 94.82657 98.83027 97.36709 $out [1] 93.915 96.015 98.205 $group [1] 3 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.6466666666667, 94.1311111111111, 94.3666666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zymc1448651328.ps tmp/1zymc1448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/23w9c1448651328.ps tmp/23w9c1448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/34ei11448651328.ps tmp/34ei11448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/4f4dq1448651328.ps tmp/4f4dq1448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/5viam1448651328.ps tmp/5viam1448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/6nw371448651328.ps tmp/6nw371448651328.png",intern=TRUE)) character(0) > try(system("convert tmp/7b1v31448651328.ps tmp/7b1v31448651328.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.368 0.495 2.886