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(26.133,25.979,25.541,25.308,25.663,25.78,25.328,24.806,24.651,24.531,24.633,25.174,24.449,24.277,24.393,24.301,24.381,24.286,24.335,24.273,24.556,24.841,25.464,25.514,25.531,25.042,24.676,24.809,25.313,25.64,25.447,25.021,24.752,24.939,25.365,25.214,25.563,25.475,25.659,25.841,25.888,25.759,25.944,25.818,25.789,25.662,26.927,27.521,27.485,27.444,27.395,27.45,27.437,27.45,27.458,27.816,27.599,27.588,27.667,27.64) > 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] 60 > (np <- floor(n / par1)) [1] 5 > 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] 5 5 5 5 5 5 5 5 5 5 5 5 > arr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 26.133 24.449 25.531 25.563 27.485 NA [2,] 25.979 24.277 25.042 25.475 27.444 NA [3,] 25.541 24.393 24.676 25.659 27.395 NA [4,] 25.308 24.301 24.809 25.841 27.450 NA [5,] 25.663 24.381 25.313 25.888 27.437 NA [6,] 25.780 24.286 25.640 25.759 27.450 NA [7,] 25.328 24.335 25.447 25.944 27.458 NA [8,] 24.806 24.273 25.021 25.818 27.816 NA [9,] 24.651 24.556 24.752 25.789 27.599 NA [10,] 24.531 24.841 24.939 25.662 27.588 NA [11,] 24.633 25.464 25.365 26.927 27.667 NA [12,] 25.174 25.514 25.214 27.521 27.640 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.154 -0.172 -0.489 -0.088 -0.041 NA [2,] -0.438 0.116 -0.366 0.184 -0.049 NA [3,] -0.233 -0.092 0.133 0.182 0.055 NA [4,] 0.355 0.080 0.504 0.047 -0.013 NA [5,] 0.117 -0.095 0.327 -0.129 0.013 NA [6,] -0.452 0.049 -0.193 0.185 0.008 NA [7,] -0.522 -0.062 -0.426 -0.126 0.358 NA [8,] -0.155 0.283 -0.269 -0.029 -0.217 NA [9,] -0.120 0.285 0.187 -0.127 -0.011 NA [10,] 0.102 0.623 0.426 1.265 0.079 NA [11,] 0.541 0.050 -0.151 0.594 -0.027 NA [12,] -0.725 0.017 0.349 -0.036 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/13uds1445596764.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/2l1ah1445596764.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/35lye1445596764.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/4gud71445596764.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,] 25.531 24.277 24.393 24.301 25.313 25.640 25.328 24.273 24.556 24.531 [2,] 25.531 25.042 24.676 24.809 25.313 25.640 25.328 24.806 24.651 24.841 [3,] 25.563 25.475 25.541 25.308 25.663 25.759 25.447 25.021 24.752 24.939 [4,] 26.133 25.979 25.659 25.841 25.888 25.780 25.944 25.818 25.789 25.662 [5,] 26.133 25.979 25.659 25.841 25.888 25.780 25.944 25.818 25.789 25.662 [,11] [,12] [1,] 24.633 25.174 [2,] 25.365 25.214 [3,] 25.464 25.514 [4,] 26.927 27.521 [5,] 27.667 27.640 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 25.13763 24.81292 24.84641 24.57879 25.25671 25.66008 25.01174 24.30592 [2,] 25.98837 26.13708 26.23559 26.03721 26.06929 25.85792 25.88226 25.73608 [,9] [,10] [,11] [,12] [1,] 23.94789 24.35888 24.36029 23.88388 [2,] 25.55611 25.51912 26.56771 27.14412 $out [1] 24.449 27.485 27.444 27.395 27.450 24.381 27.437 24.286 27.450 24.335 [11] 27.458 27.816 27.599 27.588 $group [1] 1 1 2 3 4 5 5 6 6 7 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(25.531, 25.531, 25.563, 26.133, 26.133, 24.277, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50hvl1445596764.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,] -0.172 -0.438 -0.233 -0.013 -0.129 -0.452 -0.522 -0.269 -0.127 0.079 [2,] -0.172 -0.366 -0.092 0.047 -0.095 -0.193 -0.426 -0.217 -0.120 0.102 [3,] -0.154 -0.049 0.055 0.080 0.013 0.008 -0.126 -0.155 -0.011 0.426 [4,] -0.088 0.116 0.133 0.355 0.117 0.049 -0.062 -0.029 0.187 0.623 [5,] -0.041 0.184 0.182 0.504 0.327 0.185 0.358 -0.029 0.285 1.265 [,11] [,12] [1,] -0.151 -0.7250 [2,] -0.027 -0.3805 [3,] 0.050 -0.0095 [4,] 0.541 0.1830 [5,] 0.594 0.3490 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.21335419 -0.38958 -0.1039844 -0.137632 -0.1367987 -0.1629966 -0.3832015 [2,] -0.09464581 0.29158 0.2139844 0.297632 0.1627987 0.1789966 0.1312015 [,8] [,9] [,10] [,11] [,12] [1,] -0.28784033 -0.2279254 0.05786271 -0.3513474 -0.454665 [2,] -0.02215967 0.2059254 0.79413729 0.4513474 0.435665 $out [1] -0.489 0.283 $group [1] 1 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.172000000000001, -0.172000000000001, -0.154, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jfi71445596764.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] [1,] 24.5310 24.2730 24.676 25.4750 27.3950 NA [2,] 24.7285 24.2935 24.874 25.6605 27.4470 NA [3,] 25.3180 24.3870 25.128 25.8035 27.4715 NA [4,] 25.7215 24.6985 25.406 25.9160 27.6195 NA [5,] 26.1330 24.8410 25.640 25.9440 27.8160 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 24.86509 24.20228 24.88535 25.68696 27.39282 NA [2,] 25.77091 24.57172 25.37065 25.92004 27.55018 NA $out [1] 25.464 25.514 26.927 27.521 $group [1] 2 2 4 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(24.531, 24.7285, 25.318, 25.7215, 26.133, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/757y11445596764.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,] 25.4694 24.7520 25.16750 [2,] 25.5373 25.1645 25.28175 [3,] 25.6729 25.4695 25.55550 [4,] 25.8076 25.5520 25.77100 [5,] 26.2126 25.7590 26.36750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 25.54961 25.29276 25.33235 [2,] 25.79619 25.64624 25.77865 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(25.4694, 25.5373, 25.6729, 25.8076, 26.2126, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13uds1445596764.ps tmp/13uds1445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/2l1ah1445596764.ps tmp/2l1ah1445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/35lye1445596764.ps tmp/35lye1445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/4gud71445596764.ps tmp/4gud71445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/50hvl1445596764.ps tmp/50hvl1445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/6jfi71445596764.ps tmp/6jfi71445596764.png",intern=TRUE)) character(0) > try(system("convert tmp/757y11445596764.ps tmp/757y11445596764.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.432 0.398 2.862