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(103.4,103.49,103.51,103.27,103.35,103.34,103.07,103.08,103.1,103.13,103.13,103.18,103.2,103.21,103,102.46,102.52,102.55,102.78,102.81,102.81,102.68,102.72,102.73,102.87,102.93,103.2,102.62,102.18,101.19,100.91,100.72,100.86,100.89,100.47,100.45,100.64,100.63,100.66,100.38,99.68,99.71,99.63,99.63,99.71,99.77,99.76,99.79,98.13,98.13,97.87,97.72,97.72,97.6,97.31,97.31,97.44,96.94,96.94,96.94) > 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,] 103.40 103.20 102.87 100.64 98.13 NA [2,] 103.49 103.21 102.93 100.63 98.13 NA [3,] 103.51 103.00 103.20 100.66 97.87 NA [4,] 103.27 102.46 102.62 100.38 97.72 NA [5,] 103.35 102.52 102.18 99.68 97.72 NA [6,] 103.34 102.55 101.19 99.71 97.60 NA [7,] 103.07 102.78 100.91 99.63 97.31 NA [8,] 103.08 102.81 100.72 99.63 97.31 NA [9,] 103.10 102.81 100.86 99.71 97.44 NA [10,] 103.13 102.68 100.89 99.77 96.94 NA [11,] 103.13 102.72 100.47 99.76 96.94 NA [12,] 103.18 102.73 100.45 99.79 96.94 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.09 0.01 0.06 -0.01 0.00 NA [2,] 0.02 -0.21 0.27 0.03 -0.26 NA [3,] -0.24 -0.54 -0.58 -0.28 -0.15 NA [4,] 0.08 0.06 -0.44 -0.70 0.00 NA [5,] -0.01 0.03 -0.99 0.03 -0.12 NA [6,] -0.27 0.23 -0.28 -0.08 -0.29 NA [7,] 0.01 0.03 -0.19 0.00 0.00 NA [8,] 0.02 0.00 0.14 0.08 0.13 NA [9,] 0.03 -0.13 0.03 0.06 -0.50 NA [10,] 0.00 0.04 -0.42 -0.01 0.00 NA [11,] 0.05 0.01 -0.02 0.03 0.00 NA [12,] 0.02 0.14 0.19 -1.66 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/1i5191445073981.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/2mfjc1445073981.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/3uxhu1445073981.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/4viia1445073981.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] [1,] 98.13 98.13 97.87 97.72 97.72 97.60 97.31 97.31 97.44 96.94 [2,] 100.64 100.63 100.66 100.38 99.68 99.71 99.63 99.63 99.71 99.77 [3,] 102.87 102.93 103.00 102.46 102.18 101.19 100.91 100.72 100.86 100.89 [4,] 103.20 103.21 103.20 102.62 102.52 102.55 102.78 102.81 102.81 102.68 [5,] 103.40 103.49 103.51 103.27 103.35 103.34 103.07 103.08 103.10 103.13 [,11] [,12] [1,] 96.94 96.94 [2,] 99.76 99.79 [3,] 100.47 100.45 [4,] 102.72 102.73 [5,] 103.13 103.18 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 101.0611 101.107 101.2052 100.8772 100.1733 99.18326 98.68422 98.47302 [2,] 104.6789 104.753 104.7948 104.0428 104.1867 103.19674 103.13578 102.96698 [,9] [,10] [,11] [,12] [1,] 98.66955 98.8338 98.37847 98.3726 [2,] 103.05045 102.9462 102.56153 102.5274 $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.13, 100.64, 102.87, 103.2, 103.4, 98.13, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rycz1445073981.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.01 -0.26 -0.58 -0.70 -0.12 -0.29 0.00 0.00 -0.13 -0.01 -0.02 -1.660 [2,] 0.00 -0.21 -0.54 -0.44 -0.12 -0.28 0.00 0.02 -0.13 -0.01 0.00 -0.820 [3,] 0.01 0.02 -0.28 0.00 -0.01 -0.27 0.00 0.08 0.03 0.00 0.01 0.080 [4,] 0.06 0.03 -0.24 0.06 0.03 -0.08 0.01 0.13 0.03 0.00 0.03 0.165 [5,] 0.09 0.27 -0.15 0.08 0.03 -0.08 0.01 0.14 0.06 0.00 0.05 0.190 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.03239585 -0.1495834 -0.49197924 -0.3532987 -0.11598962 -0.4113195 [2,] 0.05239585 0.1895834 -0.06802076 0.3532987 0.09598962 -0.1286805 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.007065975 0.002274277 -0.0830556 -0.007065975 -0.01119792 -0.69815 [2,] 0.007065975 0.157725723 0.1430556 0.007065975 0.03119792 0.85815 $out [1] -0.99 0.23 0.03 -0.19 -0.50 0.04 -0.42 $group [1] 5 6 7 7 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0100000000000051, 0, 0.00999999999999091, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6r1an1445073981.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,] 103.070 102.460 100.450 99.630 96.940 NA [2,] 103.115 102.615 100.790 99.695 97.125 NA [3,] 103.225 102.755 101.050 99.765 97.520 NA [4,] 103.375 102.905 102.745 100.505 97.795 NA [5,] 103.510 103.210 103.200 100.660 98.130 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 103.1064 102.6227 100.1583 99.39555 97.21441 NA [2,] 103.3436 102.8873 101.9417 100.13445 97.82559 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(103.07, 103.115, 103.225, 103.375, 103.51, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ak881445073981.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,] 100.604 100.450 101.1000 [2,] 100.696 100.790 101.2125 [3,] 100.831 101.050 101.2500 [4,] 101.469 102.665 101.7100 [5,] 101.678 103.000 101.9300 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 100.4784 100.1948 101.0231 [2,] 101.1836 101.9052 101.4769 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(100.604, 100.696, 100.831, 101.469, 101.678, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1i5191445073981.ps tmp/1i5191445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/2mfjc1445073981.ps tmp/2mfjc1445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/3uxhu1445073981.ps tmp/3uxhu1445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/4viia1445073981.ps tmp/4viia1445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/5rycz1445073981.ps tmp/5rycz1445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/6r1an1445073981.ps tmp/6r1an1445073981.png",intern=TRUE)) character(0) > try(system("convert tmp/7ak881445073981.ps tmp/7ak881445073981.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.412 0.385 2.830