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(85.13,85.54,85.47,85.78,86.07,86.05,86.32,86.43,86.41,86.38,86.59,86.68,86.87,87.32,87.13,87.42,87.22,87.17,87.52,87.49,87.53,87.93,88.54,88.96,89.3,90.01,90.52,90.64,91.25,91.59,92.09,91.81,92.03,92.15,91.98,92.11,92.28,92.53,91.97,92.05,91.87,91.49,91.48,91.63,91.46,91.61,91.7,91.87,92.21,92.65,92.83,93.02,93.33,93.35,93.45,93.51,93.8,93.94,94.02,94.26,94.71,95.26,95.54,95.69,96.03,96.4,96.55,96.45,96.65,96.84,97.21,97.31,97.91,98.51,98.54,98.52,98.66,98.53,98.71,98.92,98.96,99.25,99.32,99.41,99.36,99.58,99.77,99.77,100.03,100.2,100.24,100.1,100.03,100.18,100.29,100.41,100.6,100.75,100.79,100.44,100.29,100.34,100.46,100.12,100.06,100.28,100.28,100.4) > 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,] 85.13 86.87 89.30 92.28 92.21 94.71 97.91 99.36 100.60 NA [2,] 85.54 87.32 90.01 92.53 92.65 95.26 98.51 99.58 100.75 NA [3,] 85.47 87.13 90.52 91.97 92.83 95.54 98.54 99.77 100.79 NA [4,] 85.78 87.42 90.64 92.05 93.02 95.69 98.52 99.77 100.44 NA [5,] 86.07 87.22 91.25 91.87 93.33 96.03 98.66 100.03 100.29 NA [6,] 86.05 87.17 91.59 91.49 93.35 96.40 98.53 100.20 100.34 NA [7,] 86.32 87.52 92.09 91.48 93.45 96.55 98.71 100.24 100.46 NA [8,] 86.43 87.49 91.81 91.63 93.51 96.45 98.92 100.10 100.12 NA [9,] 86.41 87.53 92.03 91.46 93.80 96.65 98.96 100.03 100.06 NA [10,] 86.38 87.93 92.15 91.61 93.94 96.84 99.25 100.18 100.28 NA [11,] 86.59 88.54 91.98 91.70 94.02 97.21 99.32 100.29 100.28 NA [12,] 86.68 88.96 92.11 91.87 94.26 97.31 99.41 100.41 100.40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.41 0.45 0.71 0.25 0.44 0.55 0.60 0.22 0.15 NA [2,] -0.07 -0.19 0.51 -0.56 0.18 0.28 0.03 0.19 0.04 NA [3,] 0.31 0.29 0.12 0.08 0.19 0.15 -0.02 0.00 -0.35 NA [4,] 0.29 -0.20 0.61 -0.18 0.31 0.34 0.14 0.26 -0.15 NA [5,] -0.02 -0.05 0.34 -0.38 0.02 0.37 -0.13 0.17 0.05 NA [6,] 0.27 0.35 0.50 -0.01 0.10 0.15 0.18 0.04 0.12 NA [7,] 0.11 -0.03 -0.28 0.15 0.06 -0.10 0.21 -0.14 -0.34 NA [8,] -0.02 0.04 0.22 -0.17 0.29 0.20 0.04 -0.07 -0.06 NA [9,] -0.03 0.40 0.12 0.15 0.14 0.19 0.29 0.15 0.22 NA [10,] 0.21 0.61 -0.17 0.09 0.08 0.37 0.07 0.11 0.00 NA [11,] 0.09 0.42 0.13 0.17 0.24 0.10 0.09 0.12 0.12 NA [12,] 0.19 0.34 0.17 0.34 0.45 0.60 -0.05 0.19 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/1t7e91445012004.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/2eec51445012004.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/37g0x1445012004.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/4b78d1445012004.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,] 85.13 85.54 85.47 85.78 86.07 86.05 86.32 86.43 86.41 86.38 [2,] 89.30 90.01 90.52 90.64 91.25 91.49 91.48 91.63 91.46 91.61 [3,] 92.28 92.65 92.83 93.02 93.33 93.35 93.45 93.51 93.80 93.94 [4,] 97.91 98.51 98.54 98.52 98.66 98.53 98.71 98.92 98.96 99.25 [5,] 100.60 100.75 100.79 100.44 100.29 100.34 100.46 100.12 100.06 100.28 [,11] [,12] [1,] 86.59 86.68 [2,] 91.70 91.87 [3,] 94.02 94.26 [4,] 99.32 99.41 [5,] 100.29 100.41 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 87.7454 88.17333 88.60613 88.86987 89.4274 89.64227 89.6422 89.6706 89.85 [2,] 96.8146 97.12667 97.05387 97.17013 97.2326 97.05773 97.2578 97.3494 97.75 [,10] [,11] [,12] [1,] 89.91627 90.0068 90.28893 [2,] 97.96373 98.0332 98.23107 $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(85.13, 89.3, 92.28, 97.91, 100.6, 85.54, 90.01, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/533771445012004.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.15 -0.19 -0.02 -0.20 -0.13 -0.01 -0.34 -0.17 0.12 0.00 0.09 -0.050 [2,] 0.25 -0.07 0.00 -0.15 -0.05 0.10 -0.14 -0.06 0.14 0.07 0.10 0.180 [3,] 0.44 0.04 0.12 0.26 0.02 0.15 -0.03 0.04 0.15 0.09 0.12 0.265 [4,] 0.55 0.19 0.19 0.31 0.17 0.27 0.11 0.20 0.22 0.21 0.17 0.395 [5,] 0.71 0.51 0.31 0.61 0.37 0.50 0.21 0.29 0.29 0.37 0.24 0.600 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.282 -0.09693333 0.01993333 0.01773333 -0.09586667 0.06046667 -0.1616667 [2,] 0.598 0.17693333 0.22006667 0.50226667 0.13586667 0.23953333 0.1016667 [,8] [,9] [,10] [,11] [,12] [1,] -0.09693333 0.1078667 0.01626667 0.08313333 0.1448979 [2,] 0.17693333 0.1921333 0.16373333 0.15686667 0.3851021 $out [1] -0.56 -0.35 -0.38 -0.03 0.40 0.61 -0.17 0.42 $group [1] 2 3 5 9 9 10 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.150000000000006, 0.25, 0.440000000000012, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6vte41445012004.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,] 85.130 86.870 89.30 91.460 92.210 94.710 97.910 99.360 100.06 NA [2,] 85.660 87.195 90.58 91.550 92.925 95.615 98.525 99.770 100.28 NA [3,] 86.195 87.455 91.70 91.785 93.400 96.425 98.685 100.065 100.37 NA [4,] 86.420 87.730 92.06 92.010 93.870 96.745 99.105 100.220 100.53 NA [5,] 86.680 87.930 92.15 92.530 94.260 97.310 99.410 100.410 100.79 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 85.84836 87.21098 91.02496 91.57519 92.96898 95.9096 98.42046 99.85975 [2,] 86.54164 87.69902 92.37504 91.99481 93.83102 96.9404 98.94954 100.27025 [,9] [,10] [1,] 100.256 NA [2,] 100.484 NA $out [1] 88.54 88.96 $group [1] 2 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(85.13, 85.66, 86.195, 86.42, 86.68, 86.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7g3341445012004.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.15222 92.280 93.6050 [2,] 93.66056 92.925 94.5550 [3,] 93.97667 93.400 95.0525 [4,] 94.19389 93.870 95.3525 [5,] 94.60111 94.260 95.6400 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 93.73341 92.96898 94.68875 [2,] 94.21992 93.83102 95.41625 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(93.1522222222222, 93.6605555555556, 93.9766666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1t7e91445012004.ps tmp/1t7e91445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/2eec51445012004.ps tmp/2eec51445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/37g0x1445012004.ps tmp/37g0x1445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/4b78d1445012004.ps tmp/4b78d1445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/533771445012004.ps tmp/533771445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/6vte41445012004.ps tmp/6vte41445012004.png",intern=TRUE)) character(0) > try(system("convert tmp/7g3341445012004.ps tmp/7g3341445012004.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.525 0.472 3.026