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(90.4,89.5,88.9,88.4,87.6,87.1,86.5,85.7,85.3,84.9,84.5,84.4,84.3,84.2,84.1,83.8,83.5,83.2,82.8,82.2,81.5,80.8,80.3,79.8,79.2,78.8,78.1,77.8,77.3,76.7,76.2,76.1,76.3,76.2,76.2,76.6,75.5,75.4,75.5,75.5,75.2,74.9,74.6,74.4,74,73.3,72.7,72,71.2,70.9,70.4,70,69.7,69.2,68.7,68.6,68.4,67.9,67.4,66.5,65.6,64.6,63.8,63,62.1,61.7,61.4,61.1,61.1,61,60.5,60.2,59.9,59.4,59.6,59.5,59.3,59.3,59.1,58.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] 80 > (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] 7 7 7 7 7 7 7 7 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 90.4 84.3 79.2 75.5 71.2 65.6 59.9 [2,] 89.5 84.2 78.8 75.4 70.9 64.6 59.4 [3,] 88.9 84.1 78.1 75.5 70.4 63.8 59.6 [4,] 88.4 83.8 77.8 75.5 70.0 63.0 59.5 [5,] 87.6 83.5 77.3 75.2 69.7 62.1 59.3 [6,] 87.1 83.2 76.7 74.9 69.2 61.7 59.3 [7,] 86.5 82.8 76.2 74.6 68.7 61.4 59.1 [8,] 85.7 82.2 76.1 74.4 68.6 61.1 58.8 [9,] 85.3 81.5 76.3 74.0 68.4 61.1 NA [10,] 84.9 80.8 76.2 73.3 67.9 61.0 NA [11,] 84.5 80.3 76.2 72.7 67.4 60.5 NA [12,] 84.4 79.8 76.6 72.0 66.5 60.2 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.9 -0.1 -0.4 -0.1 -0.3 -1.0 -0.5 [2,] -0.6 -0.1 -0.7 0.1 -0.5 -0.8 0.2 [3,] -0.5 -0.3 -0.3 0.0 -0.4 -0.8 -0.1 [4,] -0.8 -0.3 -0.5 -0.3 -0.3 -0.9 -0.2 [5,] -0.5 -0.3 -0.6 -0.3 -0.5 -0.4 0.0 [6,] -0.6 -0.4 -0.5 -0.3 -0.5 -0.3 -0.2 [7,] -0.8 -0.6 -0.1 -0.2 -0.1 -0.3 -0.3 [8,] -0.4 -0.7 0.2 -0.4 -0.2 0.0 NA [9,] -0.4 -0.7 -0.1 -0.7 -0.5 -0.1 NA [10,] -0.4 -0.5 0.0 -0.6 -0.5 -0.5 NA [11,] -0.1 -0.5 0.4 -0.7 -0.9 -0.3 NA [12,] -0.1 -0.6 -1.1 -0.8 -0.9 -0.3 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/1502k1457463469.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/2s0wg1457463469.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/3mxr91457463469.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/48uqz1457463469.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,] 59.90 59.40 59.6 59.5 59.3 59.30 59.10 58.80 61.10 61.00 60.50 60.2 [2,] 68.40 67.75 67.1 66.5 65.9 65.45 65.05 64.85 68.40 67.90 67.40 66.5 [3,] 75.50 75.40 75.5 75.5 75.2 74.90 74.60 74.40 75.15 74.75 74.45 74.3 [4,] 81.75 81.50 81.1 80.8 80.4 79.95 79.50 79.15 81.50 80.80 80.30 79.8 [5,] 90.40 89.50 88.9 88.4 87.6 87.10 86.50 85.70 85.30 84.90 84.50 84.4 $n [1] 7 7 7 7 7 7 7 7 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 67.5276 67.18872 67.13943 66.96027 66.54083 66.24083 65.97069 65.86027 [2,] 83.4724 83.61128 83.86057 84.03973 83.85917 83.55917 83.22931 82.93973 [,9] [,10] [,11] [,12] [1,] 66.70008 66.42908 66.12908 65.72107 [2,] 83.59992 83.07092 82.77092 82.87893 $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(59.9, 68.4, 75.5, 81.75, 90.4, 59.4, 67.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51wgj1457463469.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] [1,] -1.0 -8.000000e-01 -0.80 -0.90 -0.6 -0.6 -0.80 -0.7 -0.70 -0.6 -0.9 [2,] -0.7 -6.500000e-01 -0.45 -0.65 -0.5 -0.5 -0.45 -0.4 -0.70 -0.5 -0.7 [3,] -0.4 -5.000000e-01 -0.30 -0.30 -0.4 -0.4 -0.30 -0.3 -0.45 -0.5 -0.4 [4,] -0.2 -7.105427e-15 -0.20 -0.30 -0.3 -0.3 -0.15 0.0 -0.10 -0.4 -0.1 [5,] -0.1 2.000000e-01 0.00 -0.20 0.0 -0.2 -0.10 0.2 -0.10 -0.4 0.4 [,12] [1,] -1.1 [2,] -0.9 [3,] -0.7 [4,] -0.3 [5,] -0.1 $n [1] 7 7 7 7 7 7 7 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.6985919 -0.8881695 -0.449296 -0.50901435 -0.5194368 -0.5194368 [2,] -0.1014081 -0.1118305 -0.150704 -0.09098565 -0.2805632 -0.2805632 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.4791552 -0.55801292 -0.83701938 -0.5645032 -0.78701938 -1.0870194 [2,] -0.1208448 -0.04198708 -0.06298062 -0.4354968 -0.01298062 -0.3129806 $out [1] 0 $group [1] 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1, -0.700000000000003, -0.400000000000006, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6w3331457463469.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,] 84.40 79.80 76.10 72.00 66.50 60.20 58.80 [2,] 85.10 81.15 76.20 73.65 68.15 61.05 59.20 [3,] 86.80 83.00 76.65 74.75 68.95 61.55 59.35 [4,] 88.65 83.95 77.95 75.45 70.20 63.40 59.55 [5,] 90.40 84.30 79.20 75.50 71.20 65.60 59.90 $n [1] 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 85.18082 81.7229 75.85181 73.92901 68.01498 60.47815 59.15448 [2,] 88.41918 84.2771 77.44819 75.57099 69.88502 62.62185 59.54552 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(84.4, 85.1, 86.8, 88.65, 90.4, 79.8, 81.15, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7m8io1457463469.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,] 72.41429 74.300 72.0000 [2,] 73.20357 74.525 72.9250 [3,] 73.80000 75.025 73.8250 [4,] 74.38810 75.450 74.5375 [5,] 75.15714 75.500 75.0750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 73.25973 74.6031 73.08953 [2,] 74.34027 75.4469 74.56047 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(72.4142857142857, 73.2035714285714, 73.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1502k1457463469.ps tmp/1502k1457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/2s0wg1457463469.ps tmp/2s0wg1457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/3mxr91457463469.ps tmp/3mxr91457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/48uqz1457463469.ps tmp/48uqz1457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/51wgj1457463469.ps tmp/51wgj1457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/6w3331457463469.ps tmp/6w3331457463469.png",intern=TRUE)) character(0) > try(system("convert tmp/7m8io1457463469.ps tmp/7m8io1457463469.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.745 0.462 3.235