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(0.62,0.7,1.65,1.79,2.28,2.46,2.57,2.32,2.91,3.01,2.87,3.11,3.22,3.38,3.52,3.41,3.35,3.68,3.75,3.6,3.56,3.57,3.85,3.48,3.65,3.66,3.36,3.19,2.81,2.25,2.32,2.85,2.75,2.78,2.26,2.23,1.46,1.19,1.11,1,1.18,1.59,1.51,1.01,0.9,0.63,0.81,0.97,1.14,0.97,0.89,0.62,0.36,0.27,0.34,0.02,-0.12,0.09,-0.11,-0.38) > 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,] 0.62 3.22 3.65 1.46 1.14 NA [2,] 0.70 3.38 3.66 1.19 0.97 NA [3,] 1.65 3.52 3.36 1.11 0.89 NA [4,] 1.79 3.41 3.19 1.00 0.62 NA [5,] 2.28 3.35 2.81 1.18 0.36 NA [6,] 2.46 3.68 2.25 1.59 0.27 NA [7,] 2.57 3.75 2.32 1.51 0.34 NA [8,] 2.32 3.60 2.85 1.01 0.02 NA [9,] 2.91 3.56 2.75 0.90 -0.12 NA [10,] 3.01 3.57 2.78 0.63 0.09 NA [11,] 2.87 3.85 2.26 0.81 -0.11 NA [12,] 3.11 3.48 2.23 0.97 -0.38 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.08 0.16 0.01 -0.27 -0.17 NA [2,] 0.95 0.14 -0.30 -0.08 -0.08 NA [3,] 0.14 -0.11 -0.17 -0.11 -0.27 NA [4,] 0.49 -0.06 -0.38 0.18 -0.26 NA [5,] 0.18 0.33 -0.56 0.41 -0.09 NA [6,] 0.11 0.07 0.07 -0.08 0.07 NA [7,] -0.25 -0.15 0.53 -0.50 -0.32 NA [8,] 0.59 -0.04 -0.10 -0.11 -0.14 NA [9,] 0.10 0.01 0.03 -0.27 0.21 NA [10,] -0.14 0.28 -0.52 0.18 -0.20 NA [11,] 0.24 -0.37 -0.03 0.16 -0.27 NA [12,] 0.11 0.17 -0.77 0.17 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/14zzf1444932876.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/2f11x1444932876.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/34r8i1444932876.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/477jo1444932876.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] [,11] [,12] [1,] 0.62 0.70 0.89 0.62 0.36 1.59 0.34 0.02 -0.12 0.09 -0.11 -0.38 [2,] 1.14 0.97 1.11 1.00 1.18 1.59 1.51 1.01 0.90 0.63 0.81 0.97 [3,] 1.46 1.19 1.65 1.79 2.28 2.25 2.32 2.32 2.75 2.78 2.26 2.23 [4,] 3.22 3.38 3.36 3.19 2.81 2.46 2.57 2.85 2.91 3.01 2.87 3.11 [5,] 3.65 3.66 3.52 3.41 3.35 3.68 3.75 3.60 3.56 3.57 3.85 3.48 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.00972276 -0.5128999 0.06015567 0.2425515 1.128246 1.63526 1.571007 [2,] 2.92972276 2.8928999 3.23984433 3.3374485 3.431754 2.86474 3.068993 [,8] [,9] [,10] [,11] [,12] [1,] 1.019861 1.329739 1.098298 0.8044092 0.7178814 [2,] 3.620139 4.170261 4.461702 3.7155908 3.7421186 $out [1] 0.27 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.62, 1.14, 1.46, 3.22, 3.65, 0.7, 0.97, 1.19, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f73u1444932876.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.27 -0.30 -0.17 -0.38 -0.56 0.07 -0.50 -0.14 0.01 -0.52 -0.37 -0.77 [2,] -0.17 -0.08 -0.17 -0.26 -0.09 0.07 -0.32 -0.11 0.01 -0.20 -0.27 -0.33 [3,] 0.01 -0.08 -0.11 -0.06 0.18 0.07 -0.25 -0.10 0.03 -0.14 -0.03 0.14 [4,] 0.08 0.14 -0.11 0.18 0.33 0.07 -0.15 -0.04 0.10 0.18 0.16 0.17 [5,] 0.16 0.14 -0.11 0.49 0.41 0.07 -0.15 -0.04 0.21 0.28 0.24 0.17 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1666494 -0.23545145 -0.15239585 -0.3709029 -0.1167709 0.07 -0.3701216 [2,] 0.1866494 0.07545145 -0.06760415 0.2509029 0.4767709 0.07 -0.1298784 [,8] [,9] [,10] [,11] [,12] [1,] -0.14946182 -0.03359377 -0.408507 -0.3338369 -0.255 [2,] -0.05053818 0.09359377 0.128507 0.2738369 0.535 $out [1] 0.95 0.14 -0.27 0.11 -0.08 0.53 0.59 -0.27 $group [1] 2 3 3 6 6 7 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.27, -0.17, 0.0100000000000002, 0.08, 0.16, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qivt1444932876.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,] 0.62 3.220 2.230 0.630 -0.380 NA [2,] 1.72 3.395 2.290 0.935 -0.045 NA [3,] 2.39 3.540 2.795 1.060 0.305 NA [4,] 2.89 3.640 3.275 1.325 0.755 NA [5,] 3.11 3.850 3.660 1.590 1.140 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.856355 3.428254 2.345735 0.8821184 -0.05988537 NA [2,] 2.923645 3.651746 3.244265 1.2378816 0.66988537 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(0.62, 1.72, 2.39, 2.89, 3.11, 3.22, 3.395, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7dhtp1444932876.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,] 1.882 1.190 1.8200 [2,] 1.970 1.720 1.9175 [3,] 2.001 2.255 2.0325 [4,] 2.034 2.320 2.1350 [5,] 2.106 2.780 2.2350 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.971809 1.981336 1.933297 [2,] 2.030191 2.528664 2.131703 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.882, 1.97, 2.001, 2.034, 2.106, 1.19, 1.72, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14zzf1444932876.ps tmp/14zzf1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/2f11x1444932876.ps tmp/2f11x1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/34r8i1444932876.ps tmp/34r8i1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/477jo1444932876.ps tmp/477jo1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/5f73u1444932876.ps tmp/5f73u1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/6qivt1444932876.ps tmp/6qivt1444932876.png",intern=TRUE)) character(0) > try(system("convert tmp/7dhtp1444932876.ps tmp/7dhtp1444932876.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.565 0.418 3.013