R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(98.4,98.1,97.5,97.7,98.2,98.9,99.9,100.9,101.8,102.1,103.1,103.4,105.5,106.7,106.9,107.2,107.7,107.3,107.2,107.1,106.6,106.6,106.5,106.7,106.3,108.9,109.9,110.8,110.5,111.2,111.4,112.2,113.2,114,114.2,114.6,115.9,116.1,116.4,116.7,117.9,118.1,118.3,118.8,118.4,118,117.9,117.9,117.9,117.3,117.8,117.8,117.8,117.6,117.3,116.3,114.3,113.8,113.5,114.7) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (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,] 98.4 105.5 106.3 115.9 117.9 NA [2,] 98.1 106.7 108.9 116.1 117.3 NA [3,] 97.5 106.9 109.9 116.4 117.8 NA [4,] 97.7 107.2 110.8 116.7 117.8 NA [5,] 98.2 107.7 110.5 117.9 117.8 NA [6,] 98.9 107.3 111.2 118.1 117.6 NA [7,] 99.9 107.2 111.4 118.3 117.3 NA [8,] 100.9 107.1 112.2 118.8 116.3 NA [9,] 101.8 106.6 113.2 118.4 114.3 NA [10,] 102.1 106.6 114.0 118.0 113.8 NA [11,] 103.1 106.5 114.2 117.9 113.5 NA [12,] 103.4 106.7 114.6 117.9 114.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.3 1.2 2.6 0.2 -0.6 NA [2,] -0.6 0.2 1.0 0.3 0.5 NA [3,] 0.2 0.3 0.9 0.3 0.0 NA [4,] 0.5 0.5 -0.3 1.2 0.0 NA [5,] 0.7 -0.4 0.7 0.2 -0.2 NA [6,] 1.0 -0.1 0.2 0.2 -0.3 NA [7,] 1.0 -0.1 0.8 0.5 -1.0 NA [8,] 0.9 -0.5 1.0 -0.4 -2.0 NA [9,] 0.3 0.0 0.8 -0.4 -0.5 NA [10,] 1.0 -0.1 0.2 -0.1 -0.3 NA [11,] 0.3 0.2 0.4 0.0 1.2 NA [12,] 2.1 -0.4 1.3 0.0 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/18l061444980693.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/2yttp1444980693.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/336qi1444980693.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/4ud0a1444980693.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.4 98.1 97.5 97.7 98.2 98.9 99.9 100.9 101.8 102.1 103.1 103.4 [2,] 105.5 106.7 106.9 107.2 107.7 107.3 107.2 107.1 106.6 106.6 106.5 106.7 [3,] 106.3 108.9 109.9 110.8 110.5 111.2 111.4 112.2 113.2 113.8 113.5 114.6 [4,] 115.9 116.1 116.4 116.7 117.8 117.6 117.3 116.3 114.3 114.0 114.2 114.7 [5,] 117.9 117.3 117.8 117.8 117.9 118.1 118.3 118.8 118.4 118.0 117.9 117.9 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 98.95139 102.258 103.1873 104.0873 103.3634 103.922 104.2634 105.6993 [2,] 113.64861 115.542 116.6127 117.5127 117.6366 118.478 118.5366 118.7007 [,9] [,10] [,11] [,12] [1,] 107.7592 108.5712 108.0592 108.9472 [2,] 118.6408 119.0288 118.9408 120.2528 $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(98.4, 105.5, 106.3, 115.9, 117.9, 98.1, 106.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5k8hq1444980693.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.6 0.2 0.2 -0.3 -0.4 -0.3 -1.0 -2.0 -0.5 -0.3 0.0 -0.40 [2,] -0.3 0.2 0.2 0.0 -0.2 -0.1 -0.1 -0.5 -0.4 -0.1 0.2 -0.20 [3,] 0.2 0.3 0.3 0.5 0.2 0.2 0.5 -0.4 0.0 -0.1 0.3 0.65 [4,] 1.2 0.5 0.3 0.5 0.7 0.2 0.8 0.9 0.3 0.2 0.4 1.70 [5,] 2.6 0.5 0.3 1.2 0.7 0.2 1.0 1.0 0.8 0.2 0.4 2.10 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.8598962 0.08802076 0.2293403 0.1467013 -0.4359377 -0.01197924 [2,] 1.2598962 0.51197924 0.3706597 0.8532987 0.8359377 0.41197924 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1359377 -1.3892365 -0.4946182 -0.3119792 0.1586805 -0.851 [2,] 1.1359377 0.5892365 0.4946182 0.1119792 0.4413195 2.151 $out [1] -0.6 1.0 0.9 0.0 1.0 1.0 1.2 $group [1] 2 2 3 3 6 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.600000000000009, -0.300000000000011, 0.199999999999989, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6aj5a1444980693.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,] 97.50 106.5 106.3 115.90 113.5 NA [2,] 98.15 106.6 110.2 116.55 114.5 NA [3,] 99.40 106.8 111.3 117.90 117.3 NA [4,] 101.95 107.2 113.6 118.20 117.8 NA [5,] 103.40 107.7 114.6 118.80 117.9 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 97.66679 106.5263 109.7492 117.1474 115.7948 NA [2,] 101.13321 107.0737 112.8508 118.6526 118.8052 NA $out [1] 105.5 $group [1] 2 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(97.5, 98.15, 99.4, 101.95, 103.4, 106.5, 106.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/717yi1444980693.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,] 108.80 106.30 110.300 [2,] 109.87 110.20 110.575 [3,] 110.72 111.30 111.525 [4,] 110.97 113.35 112.100 [5,] 111.46 114.60 112.750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 110.2183 109.8633 110.8294 [2,] 111.2217 112.7367 112.2206 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(108.8, 109.87, 110.72, 110.97, 111.46, 106.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/18l061444980693.ps tmp/18l061444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/2yttp1444980693.ps tmp/2yttp1444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/336qi1444980693.ps tmp/336qi1444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/4ud0a1444980693.ps tmp/4ud0a1444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/5k8hq1444980693.ps tmp/5k8hq1444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/6aj5a1444980693.ps tmp/6aj5a1444980693.png",intern=TRUE)) character(0) > try(system("convert tmp/717yi1444980693.ps tmp/717yi1444980693.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.525 0.395 2.946