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(88,90,82,75,79,70,71,75,89,92,94,90,102,98,100,98,100,91,93,92,106,109,108,108,118,119,124,118,119,113,114,115,125,125,118,122,132,133,136,128,126,114,108,107,117,119,113,114,124,125,124,118,111,99,94,93,107,107,103,97) > 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,] 88 102 118 132 124 NA [2,] 90 98 119 133 125 NA [3,] 82 100 124 136 124 NA [4,] 75 98 118 128 118 NA [5,] 79 100 119 126 111 NA [6,] 70 91 113 114 99 NA [7,] 71 93 114 108 94 NA [8,] 75 92 115 107 93 NA [9,] 89 106 125 117 107 NA [10,] 92 109 125 119 107 NA [11,] 94 108 118 113 103 NA [12,] 90 108 122 114 97 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2 -4 1 1 1 NA [2,] -8 2 5 3 -1 NA [3,] -7 -2 -6 -8 -6 NA [4,] 4 2 1 -2 -7 NA [5,] -9 -9 -6 -12 -12 NA [6,] 1 2 1 -6 -5 NA [7,] 4 -1 1 -1 -1 NA [8,] 14 14 10 10 14 NA [9,] 3 3 0 2 0 NA [10,] 2 -1 -7 -6 -4 NA [11,] -4 0 4 1 -6 NA [12,] 12 10 10 10 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/1s6fr1476793567.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/2pura1476793567.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/35uhx1476793567.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/45owi1476793567.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,] 88 90 82 75 79 70 71 75 106 92 94 90 [2,] 102 98 100 98 100 91 93 92 106 107 103 97 [3,] 118 119 124 118 111 99 94 93 107 109 108 108 [4,] 124 125 124 118 119 113 108 107 117 119 113 114 [5,] 132 133 136 128 126 114 114 115 125 125 118 122 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.4549 99.92187 107.0417 103.8681 97.57465 83.45486 83.40104 [2,] 133.5451 138.07813 140.9583 132.1319 124.42535 114.54514 104.59896 [,8] [,9] [,10] [,11] [,12] [1,] 82.40104 99.22743 100.5208 100.934 95.98784 [2,] 103.59896 114.77257 117.4792 115.066 120.01216 $out [1] 89 $group [1] 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(88, 102, 118, 124, 132, 90, 98, 119, 125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5g2wy1476793567.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,] 1 -1 -8 -7 -12 -6 -1 10 0 -7 -6 10 [2,] 1 -1 -7 -2 -12 -5 -1 10 0 -6 -4 10 [3,] 1 2 -6 1 -9 1 -1 14 2 -4 0 10 [4,] 1 3 -6 2 -9 1 1 14 3 -1 1 11 [5,] 1 5 -6 4 -6 2 4 14 3 2 4 12 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 -0.8263899 -6.706597 -1.82639 -11.119792 -3.239585 -2.413195 11.17361 [2,] 1 4.8263899 -5.293403 3.82639 -6.880208 5.239585 0.413195 16.82639 [,9] [,10] [,11] [,12] [1,] -0.1197924 -7.5329874 -3.532987 9.21 [2,] 4.1197924 -0.4670126 3.532987 10.79 $out [1] 2 -4 -8 -2 $group [1] 1 1 2 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1, 1, 1, 1, 1, -1, -1, 2, 3, 5, -8, -7, -6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64ruh1476793567.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,] 70 91.0 113.0 107.0 93 NA [2,] 75 95.5 116.5 113.5 98 NA [3,] 85 100.0 118.5 118.0 107 NA [4,] 90 107.0 123.0 130.0 121 NA [5,] 94 109.0 125.0 136.0 125 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 78.1584 94.75477 115.5353 110.4742 96.50955 NA [2,] 91.8416 105.24523 121.4647 125.5258 117.49045 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(70, 75, 85, 90, 94, 91, 95.5, 100, 107, 109, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7oaau1476793567.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,] 96.0 93.0 99.50 [2,] 101.8 103.0 103.75 [3,] 107.3 108.5 108.75 [4,] 111.6 118.0 111.75 [5,] 113.2 124.0 113.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 102.8302 101.6584 105.1011 [2,] 111.7698 115.3416 112.3989 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(96, 101.8, 107.3, 111.6, 113.2, 93, 103, 108.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1s6fr1476793567.ps tmp/1s6fr1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/2pura1476793567.ps tmp/2pura1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/35uhx1476793567.ps tmp/35uhx1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/45owi1476793567.ps tmp/45owi1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/5g2wy1476793567.ps tmp/5g2wy1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/64ruh1476793567.ps tmp/64ruh1476793567.png",intern=TRUE)) character(0) > try(system("convert tmp/7oaau1476793567.ps tmp/7oaau1476793567.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.382 0.145 2.577