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(98.91,98.15,98.59,98.6,98.7,98.33,98.33,98.6,98.52,99.17,99.49,98.83,98.83,97.39,99.28,98.78,98.75,98.47,98.47,97.82,97.79,97.96,98.21,98.34,98.34,98.49,98.14,98.05,97.77,97.59,97.59,97.67,97.67,97.36,97.31,97.24,97.24,96.89,96.48,96.47,97.13,97.21,97.43,97.98,97.97,98.2,98.67,98.75,98.77,98.72,99.23,99.67,99.76,99.57,99.57,100.21,100.62,101.05,101.42,101.42,101.52,101.87,101.53,101.77,101.76,102.04,102.05,101.9,102.17,102.14,102.09,102.27) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.91 98.83 98.34 97.24 98.77 101.52 NA [2,] 98.15 97.39 98.49 96.89 98.72 101.87 NA [3,] 98.59 99.28 98.14 96.48 99.23 101.53 NA [4,] 98.60 98.78 98.05 96.47 99.67 101.77 NA [5,] 98.70 98.75 97.77 97.13 99.76 101.76 NA [6,] 98.33 98.47 97.59 97.21 99.57 102.04 NA [7,] 98.33 98.47 97.59 97.43 99.57 102.05 NA [8,] 98.60 97.82 97.67 97.98 100.21 101.90 NA [9,] 98.52 97.79 97.67 97.97 100.62 102.17 NA [10,] 99.17 97.96 97.36 98.20 101.05 102.14 NA [11,] 99.49 98.21 97.31 98.67 101.42 102.09 NA [12,] 98.83 98.34 97.24 98.75 101.42 102.27 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.76 -1.44 0.15 -0.35 -0.05 0.35 NA [2,] 0.44 1.89 -0.35 -0.41 0.51 -0.34 NA [3,] 0.01 -0.50 -0.09 -0.01 0.44 0.24 NA [4,] 0.10 -0.03 -0.28 0.66 0.09 -0.01 NA [5,] -0.37 -0.28 -0.18 0.08 -0.19 0.28 NA [6,] 0.00 0.00 0.00 0.22 0.00 0.01 NA [7,] 0.27 -0.65 0.08 0.55 0.64 -0.15 NA [8,] -0.08 -0.03 0.00 -0.01 0.41 0.27 NA [9,] 0.65 0.17 -0.31 0.23 0.43 -0.03 NA [10,] 0.32 0.25 -0.05 0.47 0.37 -0.05 NA [11,] -0.66 0.13 -0.07 0.08 0.00 0.18 NA [12,] 0.00 0.00 0.00 0.02 0.10 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/1nl4t1444925526.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/29y8i1444925526.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/3br2n1444925526.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/4isff1444925526.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,] 98.34 96.89 96.48 96.47 97.130 97.21 97.43 97.67 97.670 97.360 [2,] 98.34 97.39 98.14 98.05 97.770 97.59 97.59 97.82 97.790 97.960 [3,] 98.80 98.32 98.91 98.69 98.725 98.40 98.40 98.29 98.245 98.685 [4,] 98.91 98.72 99.28 99.67 99.760 99.57 99.57 100.21 100.620 101.050 [5,] 98.91 98.72 99.28 101.77 101.760 102.04 102.05 101.90 102.170 102.140 [,11] [,12] [1,] 97.31 97.24 [2,] 98.21 98.34 [3,] 99.08 98.79 [4,] 101.42 101.42 [5,] 102.09 102.27 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.43233 97.46211 98.17466 97.64505 97.44139 97.12284 97.12284 96.74837 [2,] 99.16767 99.17789 99.64534 99.73495 100.00861 99.67716 99.67716 99.83163 [,9] [,10] [,11] [,12] [1,] 96.41956 96.69185 97.00945 96.8033 [2,] 100.07044 100.67815 101.15055 100.7767 $out [1] 97.24 101.52 101.87 101.53 $group [1] 1 1 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.34, 98.34, 98.8, 98.91, 98.91, 96.89, 97.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k6ip1444925526.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] [1,] -1.44 -0.41 -5.000000e-01 -0.03 -0.370 0.00 -0.650 -0.080 -0.31 -0.050 [2,] -0.76 -0.35 -9.000000e-02 -0.03 -0.280 0.00 -0.150 -0.030 -0.03 -0.050 [3,] -0.20 0.05 -7.105427e-15 0.04 -0.185 0.00 0.175 -0.005 0.20 0.285 [4,] 0.15 0.51 2.400000e-01 0.10 0.080 0.01 0.550 0.270 0.43 0.370 [5,] 0.35 0.51 4.400000e-01 0.10 0.280 0.01 0.640 0.410 0.65 0.470 [,11] [,12] [1,] -0.07 0.00 [2,] -0.07 0.00 [3,] 0.04 0.00 [4,] 0.13 0.02 [5,] 0.18 0.02 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.7869794 -0.5047278 -0.2128607 -0.0438542 -0.41721163 -0.006450323 [2,] 0.3869794 0.6047278 0.2128607 0.1238542 0.04721163 0.006450323 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.2765226 -0.1985097 -0.09671486 0.01408643 -0.08900646 -0.01413195 [2,] 0.6265226 0.1885097 0.49671486 0.55591357 0.16900646 0.01413195 $out [1] 1.89 -0.28 0.66 0.22 -0.66 0.10 $group [1] 2 4 4 6 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.44, -0.759999999999991, -0.199999999999996, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qp971444925526.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] [1,] 98.150 97.390 97.240 96.470 98.720 101.520 NA [2,] 98.425 97.890 97.475 97.010 99.400 101.765 NA [3,] 98.600 98.405 97.670 97.335 99.715 101.970 NA [4,] 98.870 98.765 98.095 98.090 100.835 102.115 NA [5,] 99.490 99.280 98.490 98.750 101.420 102.270 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.39703 98.00591 97.38721 96.8424 99.06049 101.8104 NA [2,] 98.80297 98.80409 97.95279 97.8276 100.36951 102.1296 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(98.15, 98.425, 98.6, 98.87, 99.49, 97.39, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7uwbc1444925526.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,] 98.58500 98.2450 98.12125 [2,] 98.88250 98.3600 98.60187 [3,] 98.95667 98.6875 98.78875 [4,] 99.21833 98.7950 99.13250 [5,] 99.53167 99.0800 99.63125 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.80349 98.48909 98.54673 [2,] 99.10984 98.88591 99.03077 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.585, 98.8825, 98.9566666666667, 99.2183333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nl4t1444925526.ps tmp/1nl4t1444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/29y8i1444925526.ps tmp/29y8i1444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/3br2n1444925526.ps tmp/3br2n1444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/4isff1444925526.ps tmp/4isff1444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/5k6ip1444925526.ps tmp/5k6ip1444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/6qp971444925526.ps tmp/6qp971444925526.png",intern=TRUE)) character(0) > try(system("convert tmp/7uwbc1444925526.ps tmp/7uwbc1444925526.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.522 0.468 3.010