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(103,108,104,107,104,99,93,93,104,93,106,95,114,102,94,119,96,92,98,87,92,94,102,102,104,87,89,101,101,95,96,78,82,91,90,95,115,106,104,107,94,84,79,69,67,75,78,78,111,107,118,117,98,89,91,84,91,86,94,103,113,108,100,96,91,85,87,77,75,80,91,91,98,110,109,104,102,99,97,92,85,94,96,98,107,105,109,116,109,110,99,89,87,83,89,97,106,101,98,104,88,87,91,75,81,78,89,94,103,106,98,113,102,95,91,87,91,99,100,94) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 103 114 104 115 111 113 98 107 106 103 NA [2,] 108 102 87 106 107 108 110 105 101 106 NA [3,] 104 94 89 104 118 100 109 109 98 98 NA [4,] 107 119 101 107 117 96 104 116 104 113 NA [5,] 104 96 101 94 98 91 102 109 88 102 NA [6,] 99 92 95 84 89 85 99 110 87 95 NA [7,] 93 98 96 79 91 87 97 99 91 91 NA [8,] 93 87 78 69 84 77 92 89 75 87 NA [9,] 104 92 82 67 91 75 85 87 81 91 NA [10,] 93 94 91 75 86 80 94 83 78 99 NA [11,] 106 102 90 78 94 91 96 89 89 100 NA [12,] 95 102 95 78 103 91 98 97 94 94 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 5 -12 -17 -9 -4 -5 12 -2 -5 3 NA [2,] -4 -8 2 -2 11 -8 -1 4 -3 -8 NA [3,] 3 25 12 3 -1 -4 -5 7 6 15 NA [4,] -3 -23 0 -13 -19 -5 -2 -7 -16 -11 NA [5,] -5 -4 -6 -10 -9 -6 -3 1 -1 -7 NA [6,] -6 6 1 -5 2 2 -2 -11 4 -4 NA [7,] 0 -11 -18 -10 -7 -10 -5 -10 -16 -4 NA [8,] 11 5 4 -2 7 -2 -7 -2 6 4 NA [9,] -11 2 9 8 -5 5 9 -4 -3 8 NA [10,] 13 8 -1 3 8 11 2 6 11 1 NA [11,] -11 0 5 0 9 0 2 8 5 -6 NA [12,] 19 2 20 33 10 7 9 9 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/1jy491456919766.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/28bom1456919766.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/3jklx1456919766.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/49ys91456919766.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,] 98.0 101 89 96 88.0 84.0 87 69.0 67 75.0 78.0 91 [2,] 103.0 102 98 104 94.0 87.0 91 77.0 81 80.0 89.0 94 [3,] 106.5 106 102 107 99.5 93.5 92 85.5 86 88.5 92.5 95 [4,] 113.0 108 109 116 102.0 99.0 97 89.0 91 94.0 100.0 98 [5,] 115.0 110 118 119 109.0 110.0 99 93.0 104 99.0 106.0 103 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.5036 103.0022 96.50396 101.0043 95.50288 87.50432 89.00216 79.50432 [2,] 111.4964 108.9978 107.49604 112.9957 103.49712 99.49568 94.99784 91.49568 [,9] [,10] [,11] [,12] [1,] 81.0036 81.50504 87.00396 93.00144 [2,] 90.9964 95.49496 97.99604 96.99856 $out [1] 87 79 78 $group [1] 2 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98, 103, 106.5, 113, 115, 101, 102, 106, 108, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5zham1456919766.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,] -17.0 -8.0 -5.0 -23 -10.0 -11.0 -18 -7 -11.0 -1 -6 2 [2,] -9.0 -8.0 -1.0 -16 -7.0 -5.0 -11 -2 -4.0 2 0 9 [3,] -4.5 -2.5 4.5 -9 -5.5 -0.5 -10 4 3.5 7 1 9 [4,] 3.0 2.0 12.0 -3 -3.0 2.0 -5 6 8.0 11 5 19 [5,] 12.0 11.0 25.0 0 1.0 6.0 0 11 9.0 13 9 33 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -10.495678 -7.496399 -1.995318 -15.495318 -7.498559 -3.997479 -12.997839 [2,] 1.495678 2.496399 10.995318 -2.504682 -3.501441 2.997479 -7.002161 [,8] [,9] [,10] [,11] [,12] [1,] 0.002881038 -2.495678 2.503241 -1.498199 3.733333 [2,] 7.997118962 9.495678 11.496759 3.498199 14.266667 $out [1] -11 $group [1] 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-17, -9, -4.5, 3, 12, -8, -8, -2.5, 2, 11, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mdhp1456919766.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] [,9] [,10] [,11] [1,] 93.0 87 78.0 67.0 84 75.0 85 83 75.0 87.0 NA [2,] 94.0 93 88.0 76.5 90 82.5 95 89 84.0 92.5 NA [3,] 103.5 97 93.0 81.5 96 91.0 98 102 90.0 98.5 NA [4,] 105.0 102 98.5 105.0 109 98.0 103 109 99.5 102.5 NA [5,] 108.0 114 104.0 115.0 118 113.0 110 116 106.0 113.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.48283 92.89504 88.21088 68.50096 87.33397 83.93035 94.35115 [2,] 108.51717 101.10496 97.78912 94.49904 104.66603 98.06965 101.64885 [,8] [,9] [,10] [,11] [1,] 92.87787 82.93035 93.93893 NA [2,] 111.12213 97.06965 103.06107 NA $out [1] 119 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(93, 94, 103.5, 105, 108, 87, 93, 97, 102, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7o02e1456919766.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,] 83.10 85.50 82.8750 [2,] 89.75 90.25 90.0000 [3,] 94.10 94.25 95.0000 [4,] 103.15 104.00 104.0625 [5,] 108.40 107.00 109.6250 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 87.98817 87.97853 88.586 [2,] 100.21183 100.52147 101.414 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(83.1, 89.75, 94.1, 103.15, 108.4, 85.5, 90.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jy491456919766.ps tmp/1jy491456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/28bom1456919766.ps tmp/28bom1456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/3jklx1456919766.ps tmp/3jklx1456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/49ys91456919766.ps tmp/49ys91456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/5zham1456919766.ps tmp/5zham1456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/6mdhp1456919766.ps tmp/6mdhp1456919766.png",intern=TRUE)) character(0) > try(system("convert tmp/7o02e1456919766.ps tmp/7o02e1456919766.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.485 2.996