R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(93.91,94.27,94.55,94.66,94.78,94.91,95.2,95.48,95.56,95.75,95.91,96.16,96.32,96.58,97.08,97.22,97.49,97.62,97.83,98.12,98.29,98.47,98.64,98.67,98.82,99.17,99.38,99.53,99.54,99.76,100.02,100.22,100.55,100.94,100.99,101.07,101.19,101.94,102.25,102.49,102.58,102.74,103.01,103.19,103.44,103.62,103.74,103.82,103.96,104.7,105.13,105.26,105.44,105.73,105.83,105.97,106.13,106.49,106.74,106.82) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Mon, 30 Nov 2015 07:01:18 +0000) > #Author: root > #To cite this work: Wessa P., (2015), Mean Plot (v1.0.5) 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) > x <- na.omit(x) > (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,] 93.91 96.32 98.82 101.19 103.96 NA [2,] 94.27 96.58 99.17 101.94 104.70 NA [3,] 94.55 97.08 99.38 102.25 105.13 NA [4,] 94.66 97.22 99.53 102.49 105.26 NA [5,] 94.78 97.49 99.54 102.58 105.44 NA [6,] 94.91 97.62 99.76 102.74 105.73 NA [7,] 95.20 97.83 100.02 103.01 105.83 NA [8,] 95.48 98.12 100.22 103.19 105.97 NA [9,] 95.56 98.29 100.55 103.44 106.13 NA [10,] 95.75 98.47 100.94 103.62 106.49 NA [11,] 95.91 98.64 100.99 103.74 106.74 NA [12,] 96.16 98.67 101.07 103.82 106.82 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.36 0.26 0.35 0.75 0.74 NA [2,] 0.28 0.50 0.21 0.31 0.43 NA [3,] 0.11 0.14 0.15 0.24 0.13 NA [4,] 0.12 0.27 0.01 0.09 0.18 NA [5,] 0.13 0.13 0.22 0.16 0.29 NA [6,] 0.29 0.21 0.26 0.27 0.10 NA [7,] 0.28 0.29 0.20 0.18 0.14 NA [8,] 0.08 0.17 0.33 0.25 0.16 NA [9,] 0.19 0.18 0.39 0.18 0.36 NA [10,] 0.16 0.17 0.05 0.12 0.25 NA [11,] 0.25 0.03 0.08 0.08 0.08 NA [12,] 0.16 0.15 0.12 0.14 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/1w7hp1457192653.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/2ss751457192653.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/3y2da1457192653.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/4p8ww1457192653.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,] 93.91 94.27 94.55 94.66 94.78 94.91 95.20 95.48 95.56 95.75 [2,] 96.32 96.58 97.08 97.22 97.49 97.62 97.83 98.12 98.29 98.47 [3,] 98.82 99.17 99.38 99.53 99.54 99.76 100.02 100.22 100.55 100.94 [4,] 101.19 101.94 102.25 102.49 102.58 102.74 103.01 103.19 103.44 103.62 [5,] 103.96 104.70 105.13 105.26 105.44 105.73 105.83 105.97 106.13 106.49 [,11] [,12] [1,] 95.91 96.16 [2,] 98.64 98.67 [3,] 100.99 101.07 [4,] 103.74 103.82 [5,] 106.74 106.82 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.37887 95.38264 95.72689 95.80623 95.94342 96.14222 96.35983 [2,] 102.26113 102.95736 103.03311 103.25377 103.13658 103.37778 103.68017 [,8] [,9] [,10] [,11] [,12] [1,] 96.63755 96.91102 97.30102 97.38635 97.43102 [2,] 103.80245 104.18898 104.57898 104.59365 104.70898 $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(93.91, 96.32, 98.82, 101.19, 103.96, 94.27, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vf4j1457192653.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.26 0.21 0.11 0.01 0.13 0.21 0.14 0.08 0.18 0.05 0.08 0.120 [2,] 0.35 0.28 0.13 0.09 0.13 0.21 0.18 0.16 0.18 0.12 0.08 0.130 [3,] 0.36 0.31 0.14 0.12 0.16 0.26 0.20 0.17 0.19 0.16 0.08 0.145 [4,] 0.74 0.43 0.15 0.18 0.22 0.27 0.28 0.25 0.36 0.17 0.08 0.155 [5,] 0.75 0.50 0.15 0.27 0.29 0.29 0.29 0.33 0.39 0.17 0.08 0.160 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.08442698 0.2040104 0.1258681 0.05640623 0.09640623 0.2176042 0.1293403 [2,] 0.63557302 0.4159896 0.1541319 0.18359377 0.22359377 0.3023958 0.2706597 [,8] [,9] [,10] [,11] [,12] [1,] 0.1064062 0.06281245 0.1246701 0.08 0.12525 [2,] 0.2335938 0.31718755 0.1953299 0.08 0.16475 $out [1] 0.24 0.10 0.25 0.25 0.03 $group [1] 3 6 10 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.260000000000005, 0.350000000000009, 0.359999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6d3iq1457192653.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,] 93.910 96.320 98.820 101.190 103.960 NA [2,] 94.605 97.150 99.455 102.370 105.195 NA [3,] 95.055 97.725 99.890 102.875 105.780 NA [4,] 95.655 98.380 100.745 103.530 106.310 NA [5,] 96.160 98.670 101.070 103.820 106.820 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 94.57609 97.16399 99.30162 102.3459 105.2714 NA [2,] 95.53391 98.28601 100.47838 103.4041 106.2886 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(93.91, 94.605, 95.055, 95.655, 96.16, 96.32, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/71d6w1457192653.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.840 98.820 98.755 [2,] 99.755 99.455 99.760 [3,] 100.265 99.890 100.300 [4,] 100.924 100.745 100.955 [5,] 101.308 101.070 101.245 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 99.73181 99.30162 99.75495 [2,] 100.79819 100.47838 100.84505 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.84, 99.755, 100.265, 100.924, 101.308, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1w7hp1457192653.ps tmp/1w7hp1457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/2ss751457192653.ps tmp/2ss751457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/3y2da1457192653.ps tmp/3y2da1457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/4p8ww1457192653.ps tmp/4p8ww1457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/5vf4j1457192653.ps tmp/5vf4j1457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/6d3iq1457192653.ps tmp/6d3iq1457192653.png",intern=TRUE)) character(0) > try(system("convert tmp/71d6w1457192653.ps tmp/71d6w1457192653.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.466 0.449 2.937