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(94.9,95.8,98.8,100.6,100.6,100.1,99.4,99.9,101,100.4,101.6,106.8,109.3,112.6,118.8,121.9,118.3,117.9,119.2,116.3,119.2,118.7,120.3,120.5,124.3,128.3,131.4,130.3,126.6,121.8,125.1,128.5,129.5,128.5,127.2,126.2,125.9,127.3,125.7,122.5,121.3,121.5,123.4,121.6,121.8,118.9,118.7,119.8,118.5,118.9,117.4,116,115.5,116.5,114.9,113.9,114.3,112,108,97.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,] 94.9 109.3 124.3 125.9 118.5 NA [2,] 95.8 112.6 128.3 127.3 118.9 NA [3,] 98.8 118.8 131.4 125.7 117.4 NA [4,] 100.6 121.9 130.3 122.5 116.0 NA [5,] 100.6 118.3 126.6 121.3 115.5 NA [6,] 100.1 117.9 121.8 121.5 116.5 NA [7,] 99.4 119.2 125.1 123.4 114.9 NA [8,] 99.9 116.3 128.5 121.6 113.9 NA [9,] 101.0 119.2 129.5 121.8 114.3 NA [10,] 100.4 118.7 128.5 118.9 112.0 NA [11,] 101.6 120.3 127.2 118.7 108.0 NA [12,] 106.8 120.5 126.2 119.8 97.7 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.9 3.3 4.0 1.4 0.4 NA [2,] 3.0 6.2 3.1 -1.6 -1.5 NA [3,] 1.8 3.1 -1.1 -3.2 -1.4 NA [4,] 0.0 -3.6 -3.7 -1.2 -0.5 NA [5,] -0.5 -0.4 -4.8 0.2 1.0 NA [6,] -0.7 1.3 3.3 1.9 -1.6 NA [7,] 0.5 -2.9 3.4 -1.8 -1.0 NA [8,] 1.1 2.9 1.0 0.2 0.4 NA [9,] -0.6 -0.5 -1.0 -2.9 -2.3 NA [10,] 1.2 1.6 -1.3 -0.2 -4.0 NA [11,] 5.2 0.2 -1.0 1.1 -10.3 NA [12,] 2.5 3.8 -0.3 -1.3 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/1rlvj1444999958.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/2co881444999958.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/3rete1444999958.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/4rpld1444999958.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,] 94.9 95.8 117.4 116.0 115.5 116.5 114.9 113.9 114.3 112.0 101.6 97.7 [2,] 109.3 112.6 117.4 116.0 115.5 116.5 114.9 113.9 114.3 112.0 108.0 106.8 [3,] 118.5 118.9 118.8 121.9 118.3 117.9 119.2 116.3 119.2 118.7 118.7 119.8 [4,] 124.3 127.3 125.7 122.5 121.3 121.5 123.4 121.6 121.8 118.9 120.3 120.5 [5,] 125.9 128.3 131.4 130.3 126.6 121.8 125.1 128.5 129.5 128.5 127.2 126.2 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 107.901 108.513 112.9352 117.3071 114.2017 114.367 113.1939 110.8592 [2,] 129.099 129.287 124.6648 126.4929 122.3983 121.433 125.2061 121.7408 [,9] [,10] [,11] [,12] [1,] 113.9005 113.8245 110.0089 110.1196 [2,] 124.4995 123.5755 127.3911 129.4804 $out [1] 98.8 100.6 100.6 100.1 99.4 99.9 101.0 100.4 $group [1] 3 4 5 6 7 8 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(94.9, 109.3, 118.5, 124.3, 125.9, 95.8, 112.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56x611444999958.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.4 -1.6 -3.2 -3.7 -0.5 -1.6 -2.9 0.2 -2.9 -4.0 -1.0 -1.30 [2,] 0.9 -1.5 -1.4 -3.6 -0.5 -0.7 -1.8 0.4 -2.3 -1.3 -1.0 -0.80 [3,] 1.4 3.0 -1.1 -1.2 -0.4 1.3 -1.0 1.0 -1.0 -0.2 0.2 1.10 [4,] 3.3 3.1 1.8 -0.5 0.2 1.9 0.5 1.1 -0.6 1.2 1.1 3.15 [5,] 4.0 6.2 3.1 0.0 1.0 3.3 3.4 1.1 -0.5 1.6 1.1 3.80 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.295834 -0.2503484 -3.361112 -3.3904522 -0.89461824 -0.5371535 [2,] 3.095834 6.2503484 1.161112 0.9904522 0.09461824 3.1371535 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -2.6251742 0.5053818 -2.2012157 -1.966494 -1.283855 -2.0205 [2,] 0.6251742 1.4946182 0.2012157 1.566494 1.683855 4.2205 $out [1] -4.8 2.9 5.2 -10.3 $group [1] 5 8 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.400000000000006, 0.899999999999991, 1.39999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6g3pk1444999958.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,] 98.80 116.30 121.80 118.70 108.00 NA [2,] 99.10 117.10 125.65 120.55 112.95 NA [3,] 100.25 118.75 127.75 121.70 115.20 NA [4,] 100.80 119.75 129.00 124.55 116.95 NA [5,] 101.60 121.90 131.40 127.30 118.90 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 99.47462 117.5413 126.222 119.8756 113.3756 NA [2,] 101.02538 119.9587 129.278 123.5244 117.0244 NA $out [1] 94.9 95.8 106.8 109.3 112.6 97.7 $group [1] 1 1 1 2 2 5 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(98.8, 99.1, 100.25, 100.8, 101.6, 116.3, 117.1, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7aelc1444999958.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,] 114.20 117.90 113.650 [2,] 115.36 118.40 116.125 [3,] 116.22 118.75 118.225 [4,] 116.87 119.20 119.200 [5,] 118.42 119.80 121.550 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 115.5313 118.3851 116.8225 [2,] 116.9087 119.1149 119.6275 $out [1] 121.9 116.3 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(114.2, 115.36, 116.22, 116.87, 118.42, 117.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1rlvj1444999958.ps tmp/1rlvj1444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/2co881444999958.ps tmp/2co881444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/3rete1444999958.ps tmp/3rete1444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/4rpld1444999958.ps tmp/4rpld1444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/56x611444999958.ps tmp/56x611444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/6g3pk1444999958.ps tmp/6g3pk1444999958.png",intern=TRUE)) character(0) > try(system("convert tmp/7aelc1444999958.ps tmp/7aelc1444999958.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.485 0.495 3.006