R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(97.96,98.36,98.36,98.51,98.77,98.78,98.89,98.87,99.05,99.09,99.1,99.12,99.37,99.46,99.6,99.87,99.88,100.01,100.02,100.19,100.2,100.35,100.47,100.57,101.41,101.67,101.82,101.86,101.98,102.06,102.17,102.2,102.35,102.47,102.55,102.62,102.81,102.88,102.94,102.95,102.94,103.05,103.09,103.1,103.14,103.19,103.36,103.43,103.62,103.79,103.9,103.92,103.94,103.98,104.04,104.09,104.16,104.22,104.28,104.32) > 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,] 97.96 99.37 101.41 102.81 103.62 NA [2,] 98.36 99.46 101.67 102.88 103.79 NA [3,] 98.36 99.60 101.82 102.94 103.90 NA [4,] 98.51 99.87 101.86 102.95 103.92 NA [5,] 98.77 99.88 101.98 102.94 103.94 NA [6,] 98.78 100.01 102.06 103.05 103.98 NA [7,] 98.89 100.02 102.17 103.09 104.04 NA [8,] 98.87 100.19 102.20 103.10 104.09 NA [9,] 99.05 100.20 102.35 103.14 104.16 NA [10,] 99.09 100.35 102.47 103.19 104.22 NA [11,] 99.10 100.47 102.55 103.36 104.28 NA [12,] 99.12 100.57 102.62 103.43 104.32 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.40 0.09 0.26 0.07 0.17 NA [2,] 0.00 0.14 0.15 0.06 0.11 NA [3,] 0.15 0.27 0.04 0.01 0.02 NA [4,] 0.26 0.01 0.12 -0.01 0.02 NA [5,] 0.01 0.13 0.08 0.11 0.04 NA [6,] 0.11 0.01 0.11 0.04 0.06 NA [7,] -0.02 0.17 0.03 0.01 0.05 NA [8,] 0.18 0.01 0.15 0.04 0.07 NA [9,] 0.04 0.15 0.12 0.05 0.06 NA [10,] 0.01 0.12 0.08 0.17 0.06 NA [11,] 0.02 0.10 0.07 0.07 0.04 NA [12,] 0.25 0.84 0.19 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/1rm9v1489526046.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/2ltam1489526046.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/3j8g51489526046.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/4shoc1489526046.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,] 97.96 98.36 98.36 98.51 98.77 98.78 98.89 98.87 99.05 99.09 [2,] 99.37 99.46 99.60 99.87 99.88 100.01 100.02 100.19 100.20 100.35 [3,] 101.41 101.67 101.82 101.86 101.98 102.06 102.17 102.20 102.35 102.47 [4,] 102.81 102.88 102.94 102.95 102.94 103.05 103.09 103.10 103.14 103.19 [5,] 103.62 103.79 103.90 103.92 103.94 103.98 104.04 104.09 104.16 104.22 [,11] [,12] [1,] 99.10 99.12 [2,] 100.47 100.57 [3,] 102.55 102.62 [4,] 103.36 103.43 [5,] 104.28 104.32 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.9793 99.25344 99.45996 99.68368 99.81781 99.91194 100.0007 [2,] 103.8407 104.08656 104.18004 104.03632 104.14219 104.20806 104.3393 [,8] [,9] [,10] [,11] [,12] [1,] 100.1438 100.2726 100.4633 100.5079 100.5991 [2,] 104.2562 104.4274 104.4767 104.5921 104.6409 $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(97.96, 99.37, 101.41, 102.81, 103.62, 98.36, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vt321489526046.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.07 0.00 0.01 -0.01 0.01 0.01 -0.02 0.01 0.04 0.01 0.02 0.190 [2,] 0.09 0.06 0.02 0.01 0.04 0.04 0.01 0.04 0.05 0.06 0.04 0.190 [3,] 0.17 0.11 0.04 0.02 0.08 0.06 0.03 0.07 0.06 0.08 0.07 0.220 [4,] 0.26 0.14 0.15 0.12 0.11 0.11 0.05 0.15 0.12 0.12 0.07 0.545 [5,] 0.40 0.15 0.27 0.26 0.13 0.11 0.05 0.18 0.15 0.17 0.10 0.840 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.04987843 0.0534722 -0.05185767 -0.05772572 0.03053818 0.01053818 [2,] 0.29012157 0.1665278 0.13185767 0.09772572 0.12946182 0.10946182 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.001736101 -0.007725723 0.01053818 0.03760415 0.04880208 -0.06045 [2,] 0.058263899 0.147725723 0.10946182 0.12239585 0.09119792 0.50045 $out [1] 0.17 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.0699999999999932, 0.0899999999999892, 0.170000000000002, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/662mv1489526046.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,] 97.960 99.370 101.410 102.810 103.62 NA [2,] 98.435 99.735 101.840 102.940 103.91 NA [3,] 98.825 100.015 102.115 103.070 104.01 NA [4,] 99.070 100.275 102.410 103.165 104.19 NA [5,] 99.120 100.570 102.620 103.430 104.32 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 98.53537 99.7687 101.855 102.9674 103.8823 NA [2,] 99.11463 100.2613 102.375 103.1726 104.1377 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.96, 98.435, 98.825, 99.07, 99.12, 99.37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/702ff1489526046.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,] 101.034 101.410 101.0900 [2,] 101.373 101.840 101.3400 [3,] 101.609 102.115 101.5425 [4,] 101.822 102.410 101.7200 [5,] 102.012 102.620 102.0000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 101.4042 101.855 101.3692 [2,] 101.8138 102.375 101.7158 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1rm9v1489526046.ps tmp/1rm9v1489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/2ltam1489526046.ps tmp/2ltam1489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/3j8g51489526046.ps tmp/3j8g51489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/4shoc1489526046.ps tmp/4shoc1489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/5vt321489526046.ps tmp/5vt321489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/662mv1489526046.ps tmp/662mv1489526046.png",intern=TRUE)) character(0) > try(system("convert tmp/702ff1489526046.ps tmp/702ff1489526046.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.076 0.215 3.396