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(75.8,75.7,112.3,110.9,99.6,107.5,90,88.8,129.7,120.4,93.3,96,81.1,78,111.9,117.6,101,98.3,91,86.8,108.8,110.1,93.8,100.6,75.7,69,116,94.5,105.1,95.3,79.7,76.1,111.1,106.3,89.5,96.8,67.8,62.5,90.1,93.6,94.2,93.2,81,73.7,97.7,97.5,82.7,88.8,68.5,61.1,89.6,87.6,90.8,84.3,75,78.4,83.5,93,79.3,83.9,65,60.3,80.6,86.5,78.7,80.7,70.6,67.2,88,89.1,69,84.1) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 75.8 81.1 75.7 67.8 68.5 65.0 NA [2,] 75.7 78.0 69.0 62.5 61.1 60.3 NA [3,] 112.3 111.9 116.0 90.1 89.6 80.6 NA [4,] 110.9 117.6 94.5 93.6 87.6 86.5 NA [5,] 99.6 101.0 105.1 94.2 90.8 78.7 NA [6,] 107.5 98.3 95.3 93.2 84.3 80.7 NA [7,] 90.0 91.0 79.7 81.0 75.0 70.6 NA [8,] 88.8 86.8 76.1 73.7 78.4 67.2 NA [9,] 129.7 108.8 111.1 97.7 83.5 88.0 NA [10,] 120.4 110.1 106.3 97.5 93.0 89.1 NA [11,] 93.3 93.8 89.5 82.7 79.3 69.0 NA [12,] 96.0 100.6 96.8 88.8 83.9 84.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.1 -3.1 -6.7 -5.3 -7.4 -4.7 NA [2,] 36.6 33.9 47.0 27.6 28.5 20.3 NA [3,] -1.4 5.7 -21.5 3.5 -2.0 5.9 NA [4,] -11.3 -16.6 10.6 0.6 3.2 -7.8 NA [5,] 7.9 -2.7 -9.8 -1.0 -6.5 2.0 NA [6,] -17.5 -7.3 -15.6 -12.2 -9.3 -10.1 NA [7,] -1.2 -4.2 -3.6 -7.3 3.4 -3.4 NA [8,] 40.9 22.0 35.0 24.0 5.1 20.8 NA [9,] -9.3 1.3 -4.8 -0.2 9.5 1.1 NA [10,] -27.1 -16.3 -16.8 -14.8 -13.7 -20.1 NA [11,] 2.7 6.8 7.3 6.1 4.6 15.1 NA [12,] -14.9 -24.9 -29.0 -20.3 -18.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/1omhl1476809930.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/2gnq91476809930.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/3e3dk1476809930.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/4jo6h1476809930.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,] 65.0 60.30 80.6 86.50 78.7 80.70 70.60 67.20 83.50 89.1 69.0 83.9 [2,] 67.8 61.10 89.6 87.60 90.8 84.30 75.00 73.70 88.00 93.0 79.3 84.1 [3,] 72.1 65.75 101.0 94.05 96.9 94.25 80.35 77.25 103.25 101.9 86.1 92.4 [4,] 75.8 75.70 112.3 110.90 101.0 98.30 90.00 86.80 111.10 110.1 93.3 96.8 [5,] 81.1 78.00 116.0 117.60 105.1 107.50 91.00 88.80 129.70 120.4 93.8 100.6 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 66.93974 56.33253 86.35777 79.02075 90.32067 85.21955 70.67452 [2,] 77.26026 75.16747 115.64223 109.07925 103.47933 103.28045 90.02548 [,8] [,9] [,10] [,11] [,12] [1,] 68.80008 88.34975 90.86995 77.06955 84.20809 [2,] 85.69992 118.15025 112.93005 95.13045 100.59191 $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(65, 67.8, 72.1, 75.8, 81.1, 60.3, 61.1, 65.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56ueo1476809930.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,] -7.4 20.3 -2.00 -16.6 -9.80 -17.50 -7.3 5.1 -9.30 -27.10 2.70 -29.0 [2,] -6.7 27.6 -2.00 -11.3 -6.50 -15.60 -4.2 20.8 -4.80 -20.10 4.60 -24.9 [3,] -5.0 31.2 1.05 -3.6 -1.85 -11.15 -3.5 23.0 0.45 -16.55 6.45 -20.3 [4,] -3.1 36.6 5.70 3.2 2.00 -9.30 -1.2 35.0 1.30 -14.80 7.30 -18.9 [5,] -0.1 47.0 5.90 10.6 7.90 -7.30 -1.2 40.9 9.50 -13.70 7.30 -14.9 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -7.322116 25.39471 -3.916749 -12.952968 -7.332775 -15.213703 -5.435097 [2,] -2.677884 37.00529 6.016749 5.752968 3.632775 -7.086297 -1.564903 [,8] [,9] [,10] [,11] [,12] [1,] 13.84054 -3.484697 -19.96867 4.708413 -24.53958 [2,] 32.15946 4.384697 -13.13133 8.191587 -16.06042 $out [1] -21.5 3.4 15.1 $group [1] 3 7 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-7.4, -6.7, -5, -3.09999999999999, -0.0999999999999943, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66d6s1476809930.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] [1,] 75.7 78.00 69.0 62.50 61.1 60.30 NA [2,] 89.4 88.90 77.9 77.35 76.7 68.10 NA [3,] 97.8 99.45 94.9 89.45 83.7 79.65 NA [4,] 111.6 109.45 105.7 93.90 88.6 85.30 NA [5,] 129.7 117.60 116.0 97.70 93.0 89.10 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 87.67443 90.07701 82.22023 81.90143 78.27233 71.80496 NA [2,] 107.92557 108.82299 107.57977 96.99857 89.12767 87.49504 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(75.7, 89.4, 97.8, 111.6, 129.7, 78, 88.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7peg31476809930.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,] 67.76667 65.750 67.73750 [2,] 79.85833 78.800 80.73125 [3,] 92.45833 93.225 91.48750 [4,] 99.26667 98.950 99.21250 [5,] 103.13333 103.250 101.63750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 83.60606 84.03445 83.05808 [2,] 101.31060 102.41555 99.91692 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(67.7666666666667, 79.8583333333333, 92.4583333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1omhl1476809930.ps tmp/1omhl1476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/2gnq91476809930.ps tmp/2gnq91476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/3e3dk1476809930.ps tmp/3e3dk1476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/4jo6h1476809930.ps tmp/4jo6h1476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/56ueo1476809930.ps tmp/56ueo1476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/66d6s1476809930.ps tmp/66d6s1476809930.png",intern=TRUE)) character(0) > try(system("convert tmp/7peg31476809930.ps tmp/7peg31476809930.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.396 0.145 2.581