R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 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(7.7,8,8,7.7,7.3,7.4,8.1,8.3,8.1,7.9,7.9,8.3,8.6,8.7,8.5,8.3,8,8,8.8,8.7,8.5,8.1,7.8,7.7,7.5,7.2,6.9,6.6,6.5,6.6,7.7,8,7.7,7.3,7,7,7.3,7.3,7.1,7.1,7,7,7.5,7.8,7.9,8.1,8.3,8.4,8.6,8.5,8.4,8.3,8,8,8.7,8.7,8.6,8.5,8.5,8.6,8.8,8.7,8.6,8.4,8.1,8.1,8.7,8.7,8.6,8.6,8.5,8.6,8.8,8.8,8.7,8.6,8.3,8.2,8.4,8.2,8,8,7.9,7.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] 84 > (np <- floor(n / par1)) [1] 7 > 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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.7 8.6 7.5 7.3 8.6 8.8 8.8 NA [2,] 8.0 8.7 7.2 7.3 8.5 8.7 8.8 NA [3,] 8.0 8.5 6.9 7.1 8.4 8.6 8.7 NA [4,] 7.7 8.3 6.6 7.1 8.3 8.4 8.6 NA [5,] 7.3 8.0 6.5 7.0 8.0 8.1 8.3 NA [6,] 7.4 8.0 6.6 7.0 8.0 8.1 8.2 NA [7,] 8.1 8.8 7.7 7.5 8.7 8.7 8.4 NA [8,] 8.3 8.7 8.0 7.8 8.7 8.7 8.2 NA [9,] 8.1 8.5 7.7 7.9 8.6 8.6 8.0 NA [10,] 7.9 8.1 7.3 8.1 8.5 8.6 8.0 NA [11,] 7.9 7.8 7.0 8.3 8.5 8.5 7.9 NA [12,] 8.3 7.7 7.0 8.4 8.6 8.6 7.8 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.3 0.1 -0.3 0.0 -0.1 -0.1 0.0 NA [2,] 0.0 -0.2 -0.3 -0.2 -0.1 -0.1 -0.1 NA [3,] -0.3 -0.2 -0.3 0.0 -0.1 -0.2 -0.1 NA [4,] -0.4 -0.3 -0.1 -0.1 -0.3 -0.3 -0.3 NA [5,] 0.1 0.0 0.1 0.0 0.0 0.0 -0.1 NA [6,] 0.7 0.8 1.1 0.5 0.7 0.6 0.2 NA [7,] 0.2 -0.1 0.3 0.3 0.0 0.0 -0.2 NA [8,] -0.2 -0.2 -0.3 0.1 -0.1 -0.1 -0.2 NA [9,] -0.2 -0.4 -0.4 0.2 -0.1 0.0 0.0 NA [10,] 0.0 -0.3 -0.3 0.2 0.0 -0.1 -0.1 NA [11,] 0.4 -0.1 0.0 0.1 0.1 0.1 -0.1 NA [12,] 0.3 -0.2 0.3 0.2 0.2 0.2 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/1e83z1489790310.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/2b0ts1489790310.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/3jitm1489790310.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/4vqum1489790310.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,] 7.3 7.20 6.90 6.60 6.50 6.60 7.5 7.8 7.70 7.90 7.80 7.00 [2,] 7.6 7.65 7.55 7.40 7.15 7.20 7.9 8.1 7.95 7.95 7.85 7.75 [3,] 8.6 8.50 8.40 8.30 8.00 8.00 8.4 8.3 8.10 8.10 7.90 8.30 [4,] 8.7 8.70 8.55 8.35 8.05 8.05 8.7 8.7 8.55 8.30 8.40 8.50 [5,] 8.8 8.80 8.70 8.60 8.30 8.20 8.8 8.7 8.60 8.60 8.50 8.60 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.943098 7.872957 7.802816 7.732675 7.462535 7.492394 7.922253 7.94169 [2,] 9.256902 9.127043 8.997184 8.867325 8.537465 8.507606 8.877747 8.65831 [,9] [,10] [,11] [,12] [1,] 7.74169 7.890986 7.571549 7.852112 [2,] 8.45831 8.309014 8.228451 8.747888 $out [1] 7.3 7.0 $group [1] 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(7.3, 7.6, 8.6, 8.7, 8.8, 7.2, 7.65, 8.5, 8.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ftn61489790310.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.30 -0.3 -0.30 -0.4 0.00 0.50 -0.20 -0.3 -0.4 -0.3 -0.10 0.2 [2,] -0.10 -0.2 -0.25 -0.3 0.00 0.55 -0.05 -0.2 -0.3 -0.2 -0.05 0.2 [3,] 0.00 -0.1 -0.20 -0.3 0.00 0.70 0.00 -0.2 -0.1 -0.1 0.10 0.2 [4,] 0.05 -0.1 -0.10 -0.2 0.05 0.75 0.25 -0.1 0.0 0.0 0.10 0.3 [5,] 0.10 0.0 0.00 -0.1 0.10 0.80 0.30 -0.1 0.2 0.2 0.10 0.3 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.08957758 -0.15971839 -0.2895776 -0.3597184 -0.02985919 0.5805632 [2,] 0.08957758 -0.04028161 -0.1104224 -0.2402816 0.02985919 0.8194368 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1791552 -0.2597184 -0.27915516 -0.21943677 0.01042242 0.1354968 [2,] 0.1791552 -0.1402816 0.07915516 0.01943677 0.18957758 0.2645032 $out [1] 0.3 -0.1 1.1 0.2 0.1 0.4 -0.2 $group [1] 1 5 6 6 8 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.3, -0.100000000000001, 0, 0.0499999999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6e8nc1489790310.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] [,7] [,8] [1,] 7.30 7.70 6.50 7.0 8.00 8.10 7.80 NA [2,] 7.70 8.00 6.75 7.1 8.35 8.45 8.00 NA [3,] 7.95 8.40 7.10 7.4 8.50 8.60 8.25 NA [4,] 8.10 8.65 7.60 8.0 8.60 8.70 8.65 NA [5,] 8.30 8.80 8.00 8.4 8.70 8.80 8.80 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.767557 8.103531 6.712309 6.989504 8.385973 8.485973 7.953531 NA [2,] 8.132443 8.696469 7.487691 7.810496 8.614027 8.714027 8.546469 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(7.3, 7.7, 7.95, 8.1, 8.3, 7.7, 8, 8.4, 8.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7y7yk1489790310.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,] 7.600000 7.90 7.6000 [2,] 7.921429 8.05 7.9625 [3,] 8.064286 8.30 8.1250 [4,] 8.192857 8.40 8.2125 [5,] 8.342857 8.60 8.4000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.940485 8.140363 8.010973 [2,] 8.188086 8.459637 8.239027 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7.6, 7.92142857142857, 8.06428571428571, 8.19285714285714, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1e83z1489790310.ps tmp/1e83z1489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/2b0ts1489790310.ps tmp/2b0ts1489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/3jitm1489790310.ps tmp/3jitm1489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/4vqum1489790310.ps tmp/4vqum1489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/5ftn61489790310.ps tmp/5ftn61489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/6e8nc1489790310.ps tmp/6e8nc1489790310.png",intern=TRUE)) character(0) > try(system("convert tmp/7y7yk1489790310.ps tmp/7y7yk1489790310.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.882 0.199 3.129