R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" 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(92.86,94.06,95.51,96.05,96.71,97.91,97.74,97.64,98.55,98.46,99.19,99.18,99.95,100.66,101.12,101.14,100.73,99.92,100.06,100.64,100.89,100.87,100.72,100.72,100.98,100.15,100.13,100.39,99.87,99.93,99.96,99.61,99.57,99.71,99.78,99.92,100.3,100.83,100.84,97.87,97.99,98.03,97.58,97.45,97.47,98.31,98.29,98.13,98.44,98.05,98.32,97.55,97.74,98.01,97.93,99.23,101.03,100.81,100.57,100.1) > 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,] 92.86 99.95 100.98 100.30 98.44 NA [2,] 94.06 100.66 100.15 100.83 98.05 NA [3,] 95.51 101.12 100.13 100.84 98.32 NA [4,] 96.05 101.14 100.39 97.87 97.55 NA [5,] 96.71 100.73 99.87 97.99 97.74 NA [6,] 97.91 99.92 99.93 98.03 98.01 NA [7,] 97.74 100.06 99.96 97.58 97.93 NA [8,] 97.64 100.64 99.61 97.45 99.23 NA [9,] 98.55 100.89 99.57 97.47 101.03 NA [10,] 98.46 100.87 99.71 98.31 100.81 NA [11,] 99.19 100.72 99.78 98.29 100.57 NA [12,] 99.18 100.72 99.92 98.13 100.10 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.20 0.71 -0.83 0.53 -0.39 NA [2,] 1.45 0.46 -0.02 0.01 0.27 NA [3,] 0.54 0.02 0.26 -2.97 -0.77 NA [4,] 0.66 -0.41 -0.52 0.12 0.19 NA [5,] 1.20 -0.81 0.06 0.04 0.27 NA [6,] -0.17 0.14 0.03 -0.45 -0.08 NA [7,] -0.10 0.58 -0.35 -0.13 1.30 NA [8,] 0.91 0.25 -0.04 0.02 1.80 NA [9,] -0.09 -0.02 0.14 0.84 -0.22 NA [10,] 0.73 -0.15 0.07 -0.02 -0.24 NA [11,] -0.01 0.00 0.14 -0.16 -0.47 NA [12,] 0.77 0.26 0.38 0.31 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/1ajqn1457468677.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/2w3b71457468677.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/3rqou1457468677.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/4ik7t1457468677.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.44 98.05 95.51 96.05 96.71 97.91 97.58 97.45 97.47 98.31 [2,] 98.44 98.05 98.32 97.55 97.74 98.01 97.74 97.64 98.55 98.46 [3,] 99.95 100.15 100.13 97.87 97.99 98.03 97.93 99.23 99.57 99.71 [4,] 100.30 100.66 100.84 100.39 99.87 99.92 99.96 99.61 100.89 100.81 [5,] 100.98 100.83 101.12 101.14 100.73 99.93 100.06 100.64 101.03 100.87 [,11] [,12] [1,] 98.29 98.13 [2,] 99.19 99.18 [3,] 99.78 99.92 [4,] 100.57 100.10 [5,] 100.72 100.72 $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.63573 98.30578 98.34937 95.86326 96.48495 96.6804 96.36135 97.838 [2,] 101.26427 101.99422 101.91063 99.87674 99.49505 99.3796 99.49865 100.622 [,9] [,10] [,11] [,12] [1,] 97.91656 98.0495 98.8049 99.26993 [2,] 101.22344 101.3705 100.7551 100.57007 $out [1] 92.86 94.06 $group [1] 1 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(98.44, 98.44, 99.95, 100.3, 100.98, 98.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5z5b51457468677.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.83 -0.02 -0.77 -0.52 0.04 -0.45 -0.35 -0.04 -0.22 -0.24 -0.16 0.260 [2,] -0.39 0.01 -0.77 -0.41 0.04 -0.17 -0.13 0.02 -0.09 -0.15 -0.16 0.285 [3,] 0.53 0.27 0.02 0.12 0.06 -0.08 -0.10 0.25 -0.02 -0.02 -0.01 0.345 [4,] 0.71 0.46 0.26 0.19 0.27 0.03 0.58 0.91 0.14 0.07 0.00 0.575 [5,] 1.20 0.46 0.54 0.66 0.27 0.14 1.30 1.80 0.14 0.07 0.14 0.770 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.2472572 -0.04796887 -0.7077954 -0.3039585 -0.1025174 -0.2213195 [2,] 1.3072572 0.58796887 0.7477954 0.5439585 0.2225174 0.0613195 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.6016842 -0.3788718 -0.1825174 -0.1754514 -0.1230556 0.1159 [2,] 0.4016842 0.8788718 0.1425174 0.1354514 0.1030556 0.5741 $out [1] 1.45 -2.97 1.20 -0.81 0.84 0.73 -0.47 $group [1] 2 3 5 5 9 10 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.829999999999998, -0.390000000000001, 0.530000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mu0c1457468677.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,] 92.860 99.92 99.570 97.450 97.550 NA [2,] 95.780 100.35 99.745 97.725 97.970 NA [3,] 97.690 100.72 99.925 98.080 98.380 NA [4,] 98.505 100.88 100.140 99.305 100.335 NA [5,] 99.190 101.14 100.390 100.840 101.030 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 96.44711 100.4783 99.74484 97.35935 97.30131 NA [2,] 98.93289 100.9617 100.10516 98.80065 99.45869 NA $out [1] 100.98 $group [1] 3 $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(92.86, 95.78, 97.69, 98.505, 99.19, 99.92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lfgi1457468677.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,] 98.506 97.870 98.6250 [2,] 98.631 98.010 98.9075 [3,] 98.837 99.640 99.3625 [4,] 99.556 99.935 99.6375 [5,] 99.710 100.150 99.8800 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 98.4151 98.76199 99.02954 [2,] 99.2589 100.51801 99.69546 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(98.506, 98.631, 98.837, 99.556, 99.71, 97.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ajqn1457468677.ps tmp/1ajqn1457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/2w3b71457468677.ps tmp/2w3b71457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/3rqou1457468677.ps tmp/3rqou1457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/4ik7t1457468677.ps tmp/4ik7t1457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/5z5b51457468677.ps tmp/5z5b51457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/6mu0c1457468677.ps tmp/6mu0c1457468677.png",intern=TRUE)) character(0) > try(system("convert tmp/7lfgi1457468677.ps tmp/7lfgi1457468677.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.245 0.472 2.751