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.94,95.11,95.53,95.89,95.99,95.42,95.42,95.45,95.99,95.99,95.97,95.97,95.97,96.22,95.8,96.02,96.04,96.15,96.15,95.99,96.08,96.29,96.3,96.44,96.44,96.83,96.7,97.06,97.64,97.61,97.61,97.61,97.55,97.58,97.79,97.79,97.79,97.79,98,98.37,98.68,98.89,98.89,98.89,98.88,98.97,99.05,99.05,99,99.03,99.2,100.3,100.79,100.75,100.75,100.17,99.98,99.93,100.04,100.04,100.49,100.71,100.7,101.27,101.07,101.17,100.71,100.59,100.52,100.65,100.62,100.62) > 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] 72 > (np <- floor(n / par1)) [1] 6 > 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] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 94.94 95.97 96.44 97.79 99.00 100.49 NA [2,] 95.11 96.22 96.83 97.79 99.03 100.71 NA [3,] 95.53 95.80 96.70 98.00 99.20 100.70 NA [4,] 95.89 96.02 97.06 98.37 100.30 101.27 NA [5,] 95.99 96.04 97.64 98.68 100.79 101.07 NA [6,] 95.42 96.15 97.61 98.89 100.75 101.17 NA [7,] 95.42 96.15 97.61 98.89 100.75 100.71 NA [8,] 95.45 95.99 97.61 98.89 100.17 100.59 NA [9,] 95.99 96.08 97.55 98.88 99.98 100.52 NA [10,] 95.99 96.29 97.58 98.97 99.93 100.65 NA [11,] 95.97 96.30 97.79 99.05 100.04 100.62 NA [12,] 95.97 96.44 97.79 99.05 100.04 100.62 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.17 0.25 0.39 0.00 0.03 0.22 NA [2,] 0.42 -0.42 -0.13 0.21 0.17 -0.01 NA [3,] 0.36 0.22 0.36 0.37 1.10 0.57 NA [4,] 0.10 0.02 0.58 0.31 0.49 -0.20 NA [5,] -0.57 0.11 -0.03 0.21 -0.04 0.10 NA [6,] 0.00 0.00 0.00 0.00 0.00 -0.46 NA [7,] 0.03 -0.16 0.00 0.00 -0.58 -0.12 NA [8,] 0.54 0.09 -0.06 -0.01 -0.19 -0.07 NA [9,] 0.00 0.21 0.03 0.09 -0.05 0.13 NA [10,] -0.02 0.01 0.21 0.08 0.11 -0.03 NA [11,] 0.00 0.14 0.00 0.00 0.00 0.00 NA [12,] 0.00 0.00 0.00 -0.05 0.45 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/1po7r1445064248.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/2i8d11445064248.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/3mbl71445064248.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/4vqa21445064248.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,] 94.940 95.11 95.53 95.890 95.99 95.42 95.42 95.45 95.990 95.990 [2,] 95.970 96.22 95.80 96.020 96.04 96.15 96.15 95.99 96.080 96.290 [3,] 97.115 97.31 97.35 97.715 98.16 98.25 98.25 98.25 98.215 98.275 [4,] 99.000 99.03 99.20 100.300 100.79 100.75 100.71 100.17 99.980 99.930 [5,] 100.490 100.71 100.70 101.270 101.07 101.17 100.75 100.59 100.520 100.650 [,11] [,12] [1,] 95.97 95.97 [2,] 96.30 96.44 [3,] 98.42 98.42 [4,] 100.04 100.04 [5,] 100.62 100.62 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.16055 95.49746 95.15689 94.95426 95.0961 95.28285 95.30865 [2,] 99.06945 99.12254 99.54311 100.47574 101.2239 101.21715 101.19135 [,8] [,9] [,10] [,11] [,12] [1,] 95.55376 95.69937 95.92708 96.00758 96.09788 [2,] 100.94624 100.73063 100.62292 100.83242 100.74212 $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(94.94, 95.97, 97.115, 99, 100.49, 95.11, 96.22, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5h85y1445064248.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.000 -0.42 0.220 -0.200 -0.040 0 -0.16 -0.190 -0.05 -0.030 0 0 [2,] 0.030 -0.13 0.360 0.020 -0.040 0 -0.16 -0.070 0.00 -0.020 0 0 [3,] 0.195 0.08 0.365 0.205 0.035 0 -0.06 -0.035 0.06 0.045 0 0 [4,] 0.250 0.21 0.570 0.490 0.110 0 0.00 0.090 0.13 0.110 0 0 [5,] 0.390 0.42 0.570 0.580 0.210 0 0.03 0.090 0.21 0.210 0 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.05309289 -0.139311 0.2295432 -0.09816518 -0.06175484 0 -0.16320517 [2,] 0.33690711 0.299311 0.5004568 0.50816518 0.13175484 0 0.04320517 [,8] [,9] [,10] [,11] [,12] [1,] -0.13820517 -0.0238542 -0.0388542 0 0 [2,] 0.06820517 0.1438542 0.1288542 0 0 $out [1] 1.10 -0.57 -0.46 -0.58 0.54 0.14 -0.05 0.45 $group [1] 3 5 6 7 8 11 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0.0300000000000011, 0.195, 0.25, 0.390000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6uqwg1445064248.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] [1,] 94.94 95.800 96.440 97.790 99.000 100.490 NA [2,] 95.42 96.005 96.945 98.185 99.565 100.605 NA [3,] 95.71 96.115 97.595 98.885 100.040 100.675 NA [4,] 95.98 96.255 97.625 98.930 100.525 100.890 NA [5,] 95.99 96.440 97.790 99.050 100.790 101.270 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.45458 96.00097 97.28485 98.5452 99.60214 100.545 NA [2,] 95.96542 96.22903 97.90515 99.2248 100.47786 100.805 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(94.94, 95.42, 95.71, 95.98, 95.99, 95.8, 96.005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7d3nd1445064248.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,] 97.43833 97.1150 97.39250 [2,] 97.88583 97.5325 97.79750 [3,] 98.20083 98.2325 98.13688 [4,] 98.30667 98.2625 98.31812 [5,] 98.36833 98.4200 98.40000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.00889 97.89954 97.89941 [2,] 98.39278 98.56546 98.37434 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.4383333333333, 97.8858333333333, 98.2008333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1po7r1445064248.ps tmp/1po7r1445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/2i8d11445064248.ps tmp/2i8d11445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/3mbl71445064248.ps tmp/3mbl71445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/4vqa21445064248.ps tmp/4vqa21445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/5h85y1445064248.ps tmp/5h85y1445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/6uqwg1445064248.ps tmp/6uqwg1445064248.png",intern=TRUE)) character(0) > try(system("convert tmp/7d3nd1445064248.ps tmp/7d3nd1445064248.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.438 0.422 2.897