R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(99.6,96.1,109,99.5,104.6,99.9,94.1,105.3,110.4,110.5,110,108.5,101.5,99,106.2,97.6,103.7,103.4,99.9,105,103.4,117.8,110.6,102,105.1,98.5,104.4,103.9,105.8,100.3,106.3,101.4,104.3,114.6,105,103.4,102.9,96.4,102.6,104.7,100.8,102.1,101.1,98.1,109.2,114.4,104,107.2,101.3,98.1,109.6,105.9,99.5,109.9,105.3,102.5,111.9,118,112.1,113.8) > 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,] 99.6 101.5 105.1 102.9 101.3 NA [2,] 96.1 99.0 98.5 96.4 98.1 NA [3,] 109.0 106.2 104.4 102.6 109.6 NA [4,] 99.5 97.6 103.9 104.7 105.9 NA [5,] 104.6 103.7 105.8 100.8 99.5 NA [6,] 99.9 103.4 100.3 102.1 109.9 NA [7,] 94.1 99.9 106.3 101.1 105.3 NA [8,] 105.3 105.0 101.4 98.1 102.5 NA [9,] 110.4 103.4 104.3 109.2 111.9 NA [10,] 110.5 117.8 114.6 114.4 118.0 NA [11,] 110.0 110.6 105.0 104.0 112.1 NA [12,] 108.5 102.0 103.4 107.2 113.8 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -3.5 -2.5 -6.6 -6.5 -3.2 NA [2,] 12.9 7.2 5.9 6.2 11.5 NA [3,] -9.5 -8.6 -0.5 2.1 -3.7 NA [4,] 5.1 6.1 1.9 -3.9 -6.4 NA [5,] -4.7 -0.3 -5.5 1.3 10.4 NA [6,] -5.8 -3.5 6.0 -1.0 -4.6 NA [7,] 11.2 5.1 -4.9 -3.0 -2.8 NA [8,] 5.1 -1.6 2.9 11.1 9.4 NA [9,] 0.1 14.4 10.3 5.2 6.1 NA [10,] -0.5 -7.2 -9.6 -10.4 -5.9 NA [11,] -1.5 -8.6 -1.6 3.2 1.7 NA [12,] -7.0 3.1 -0.5 -5.9 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/1bw4p1476369888.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/2nyur1476369888.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/3j0271476369888.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/4wx2k1476369888.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,] 99.6 96.1 102.6 97.6 99.5 99.9 94.1 98.1 103.4 110.5 104.0 102.0 [2,] 101.3 96.4 104.4 99.5 100.8 100.3 99.9 101.4 104.3 114.4 105.0 103.4 [3,] 101.5 98.1 106.2 103.9 103.7 102.1 101.1 102.5 109.2 114.6 110.0 107.2 [4,] 102.9 98.5 109.0 104.7 104.6 103.4 105.3 105.0 110.4 117.8 110.6 108.5 [5,] 105.1 99.0 109.6 105.9 105.8 103.4 106.3 105.3 111.9 118.0 112.1 113.8 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 100.3694 96.61615 102.9497 100.2257 101.0149 99.90955 97.28437 99.95625 [2,] 102.6306 99.58385 109.4503 107.5743 106.3851 104.29045 104.91563 105.04375 [,9] [,10] [,11] [,12] [1,] 104.8898 112.1976 106.0431 103.5964 [2,] 113.5102 117.0024 113.9569 110.8036 $out [1] 109.9 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(99.6, 101.3, 101.5, 102.9, 105.1, 96.1, 96.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5e0301476369888.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,] -6.6 5.9 -9.5 -6.4 -5.5 -5.8 -4.9 -1.6 0.1 -10.4 -1.6 -7.00 [2,] -6.5 6.2 -8.6 -3.9 -4.7 -4.6 -3.0 2.9 5.2 -9.6 -1.6 -6.45 [3,] -3.5 7.2 -3.7 1.9 -0.3 -3.5 -2.8 5.1 6.1 -7.2 -1.5 -3.20 [4,] -3.2 11.5 -0.5 5.1 1.3 -1.0 5.1 9.4 10.3 -5.9 1.7 1.30 [5,] -2.5 12.9 2.1 6.1 1.3 -1.0 11.2 11.1 14.4 -0.5 3.2 3.10 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -5.831772 3.455033 -9.42344 -4.459377 -4.539585 -6.0437509 -8.52344 [2,] -1.168228 10.944967 2.02344 8.259377 3.939585 -0.9562491 2.92344 [,8] [,9] [,10] [,11] [,12] [1,] 0.5071164 2.496353 -9.814411 -3.8317717 -9.3225 [2,] 9.6928836 9.703647 -4.585589 0.8317717 2.9225 $out [1] 10.4 6.0 -8.6 $group [1] 5 6 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-6.59999999999999, -6.5, -3.5, -3.2, -2.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64cbe1476369888.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,] 94.10 97.6 98.50 96.40 98.10 NA [2,] 99.55 100.7 102.40 100.95 101.90 NA [3,] 104.95 103.4 104.35 102.75 107.75 NA [4,] 109.50 105.6 105.45 105.95 112.00 NA [5,] 110.50 110.6 106.30 109.20 118.00 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 100.4117 101.1651 102.9589 100.4695 103.1433 NA [2,] 109.4883 105.6349 105.7411 105.0305 112.3567 NA $out [1] 117.8 114.6 114.4 $group [1] 2 3 4 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(94.1, 99.55, 104.95, 109.5, 110.5, 97.6, 100.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d0od1476369888.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,] 97.62 98.1 97.450 [2,] 102.20 101.8 102.100 [3,] 103.00 103.8 102.950 [4,] 107.41 108.2 107.025 [5,] 115.06 114.6 107.800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.6237 100.8809 100.7037 [2,] 105.3763 106.7191 105.1963 $out [1] 116.1 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.62, 102.2, 103, 107.41, 115.06, 98.1, 101.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1bw4p1476369888.ps tmp/1bw4p1476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/2nyur1476369888.ps tmp/2nyur1476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/3j0271476369888.ps tmp/3j0271476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/4wx2k1476369888.ps tmp/4wx2k1476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/5e0301476369888.ps tmp/5e0301476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/64cbe1476369888.ps tmp/64cbe1476369888.png",intern=TRUE)) character(0) > try(system("convert tmp/7d0od1476369888.ps tmp/7d0od1476369888.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.525 0.182 2.753