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(104.93,105.68,106.93,107.29,107.25,106.74,106.44,106.6,107.26,107.35,107.22,106.99,106.87,107.68,108.9,109.48,109.57,109.03,109.58,109.76,110.15,110.2,109.86,109.58,109.52,110.35,111.61,112.06,111.9,111.36,112.09,112.24,112.7,113.36,112.9,112.74,112.7,113.66,114.87,114.97,115,114.57,115.54,115.39,115.46,115.13,114.56,114.62,114.37,114.86,115.82,116.35,115.95,115.64,116.58,116.5,116.48,116.34,115.65,115.42) > 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,] 104.93 106.87 109.52 112.70 114.37 NA [2,] 105.68 107.68 110.35 113.66 114.86 NA [3,] 106.93 108.90 111.61 114.87 115.82 NA [4,] 107.29 109.48 112.06 114.97 116.35 NA [5,] 107.25 109.57 111.90 115.00 115.95 NA [6,] 106.74 109.03 111.36 114.57 115.64 NA [7,] 106.44 109.58 112.09 115.54 116.58 NA [8,] 106.60 109.76 112.24 115.39 116.50 NA [9,] 107.26 110.15 112.70 115.46 116.48 NA [10,] 107.35 110.20 113.36 115.13 116.34 NA [11,] 107.22 109.86 112.90 114.56 115.65 NA [12,] 106.99 109.58 112.74 114.62 115.42 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.75 0.81 0.83 0.96 0.49 NA [2,] 1.25 1.22 1.26 1.21 0.96 NA [3,] 0.36 0.58 0.45 0.10 0.53 NA [4,] -0.04 0.09 -0.16 0.03 -0.40 NA [5,] -0.51 -0.54 -0.54 -0.43 -0.31 NA [6,] -0.30 0.55 0.73 0.97 0.94 NA [7,] 0.16 0.18 0.15 -0.15 -0.08 NA [8,] 0.66 0.39 0.46 0.07 -0.02 NA [9,] 0.09 0.05 0.66 -0.33 -0.14 NA [10,] -0.13 -0.34 -0.46 -0.57 -0.69 NA [11,] -0.23 -0.28 -0.16 0.06 -0.23 NA [12,] -0.12 -0.06 -0.04 -0.25 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/1mp2t1444998239.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/200pn1444998239.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/3e8t21444998239.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/4adu81444998239.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,] 104.93 105.68 106.93 107.29 107.25 106.74 106.44 106.60 107.26 107.35 [2,] 106.87 107.68 108.90 109.48 109.57 109.03 109.58 109.76 110.15 110.20 [3,] 109.52 110.35 111.61 112.06 111.90 111.36 112.09 112.24 112.70 113.36 [4,] 112.70 113.66 114.87 114.97 115.00 114.57 115.54 115.39 115.46 115.13 [5,] 114.37 114.86 115.82 116.35 115.95 115.64 116.58 116.50 116.48 116.34 [,11] [,12] [1,] 107.22 106.99 [2,] 109.86 109.58 [3,] 112.90 112.74 [4,] 114.56 114.62 [5,] 115.65 115.42 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105.4005 106.1245 107.3916 108.1808 108.0632 107.4454 107.8787 108.2619 [2,] 113.6395 114.5755 115.8284 115.9392 115.7368 115.2746 116.3013 116.2181 [,9] [,10] [,11] [,12] [1,] 108.948 109.8765 109.579 109.1787 [2,] 116.452 116.8435 116.221 116.3013 $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(104.93, 106.87, 109.52, 112.7, 114.37, 105.68, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5q1dj1444998239.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.75 1.21 0.36 -0.40 -0.54 0.55 -0.15 -0.02 -0.33 -0.69 -0.28 -0.250 [2,] 0.75 1.21 0.36 -0.16 -0.54 0.55 -0.08 0.07 -0.14 -0.57 -0.23 -0.185 [3,] 0.81 1.22 0.45 -0.04 -0.51 0.73 0.15 0.39 0.05 -0.46 -0.23 -0.090 [4,] 0.83 1.25 0.53 0.03 -0.43 0.94 0.16 0.46 0.09 -0.34 -0.16 -0.050 [5,] 0.83 1.26 0.58 0.09 -0.31 0.97 0.18 0.66 0.09 -0.13 -0.16 -0.040 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7534722 1.191736 0.3298784 -0.17425352 -0.5877257 0.454427 -0.0195834 [2,] 0.8665278 1.248264 0.5701216 0.09425352 -0.4322743 1.005573 0.3195834 [,8] [,9] [,10] [,11] [,12] [1,] 0.114427 -0.1125174 -0.6225174 -0.2794618 -0.19665 [2,] 0.665573 0.2125174 -0.2974826 -0.1805382 0.01665 $out [1] 0.96 0.49 0.96 0.10 -0.30 0.66 0.06 $group [1] 1 1 2 3 6 9 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.75, 0.75, 0.810000000000002, 0.829999999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6iw3c1444998239.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,] 105.680 108.900 110.350 113.660 114.370 NA [2,] 106.520 108.965 111.485 114.565 115.530 NA [3,] 106.960 109.575 112.075 114.920 115.885 NA [4,] 107.255 109.810 112.720 115.260 116.415 NA [5,] 107.350 110.200 113.360 115.540 116.580 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 106.6248 109.1896 111.5117 114.603 115.4813 NA [2,] 107.2952 109.9604 112.6383 115.237 116.2887 NA $out [1] 104.93 106.87 107.68 109.52 112.70 $group [1] 1 2 2 3 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(105.68, 106.52, 106.96, 107.255, 107.35, 108.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7rhhd1444998239.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,] 111.468 110.350 111.8000 [2,] 111.547 111.485 111.8425 [3,] 111.982 112.075 112.2175 [4,] 112.072 112.720 112.5675 [5,] 112.476 113.360 112.8050 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 111.7425 111.5117 111.8868 [2,] 112.2215 112.6383 112.5482 $out [1] 109.678 110.446 109.520 109.785 110.670 $group [1] 1 1 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(111.468, 111.547, 111.982, 112.072, 112.476, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1mp2t1444998239.ps tmp/1mp2t1444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/200pn1444998239.ps tmp/200pn1444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/3e8t21444998239.ps tmp/3e8t21444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/4adu81444998239.ps tmp/4adu81444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/5q1dj1444998239.ps tmp/5q1dj1444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/6iw3c1444998239.ps tmp/6iw3c1444998239.png",intern=TRUE)) character(0) > try(system("convert tmp/7rhhd1444998239.ps tmp/7rhhd1444998239.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.659 0.472 3.157