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.8,92.9,93.06,93.28,93.41,93.49,93.49,93.5,93.56,94.12,94.3,94.36,94.36,94.5,94.85,95.16,95.73,95.76,95.76,95.81,96.09,96.48,96.71,96.69,96.69,96.66,96.73,96.84,97.87,98,97.98,98.03,98.11,98.18,98.32,98.34,98.28,98.52,98.56,99.6,100.16,100.46,100.46,100.68,100.83,100.64,100.9,100.92,100.75,100.96,101.05,101.33,101.38,101.44,101.51,101.4,101.26,100.83,100.75,100.81,100.82,100.85,100.79,100.84,101.04,101.11,101.15,101.11,101.28,101.62,102.07,102.14) > 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] 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,] 92.80 94.36 96.69 98.28 100.75 100.82 NA [2,] 92.90 94.50 96.66 98.52 100.96 100.85 NA [3,] 93.06 94.85 96.73 98.56 101.05 100.79 NA [4,] 93.28 95.16 96.84 99.60 101.33 100.84 NA [5,] 93.41 95.73 97.87 100.16 101.38 101.04 NA [6,] 93.49 95.76 98.00 100.46 101.44 101.11 NA [7,] 93.49 95.76 97.98 100.46 101.51 101.15 NA [8,] 93.50 95.81 98.03 100.68 101.40 101.11 NA [9,] 93.56 96.09 98.11 100.83 101.26 101.28 NA [10,] 94.12 96.48 98.18 100.64 100.83 101.62 NA [11,] 94.30 96.71 98.32 100.90 100.75 102.07 NA [12,] 94.36 96.69 98.34 100.92 100.81 102.14 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.10 0.14 -0.03 0.24 0.21 0.03 NA [2,] 0.16 0.35 0.07 0.04 0.09 -0.06 NA [3,] 0.22 0.31 0.11 1.04 0.28 0.05 NA [4,] 0.13 0.57 1.03 0.56 0.05 0.20 NA [5,] 0.08 0.03 0.13 0.30 0.06 0.07 NA [6,] 0.00 0.00 -0.02 0.00 0.07 0.04 NA [7,] 0.01 0.05 0.05 0.22 -0.11 -0.04 NA [8,] 0.06 0.28 0.08 0.15 -0.14 0.17 NA [9,] 0.56 0.39 0.07 -0.19 -0.43 0.34 NA [10,] 0.18 0.23 0.14 0.26 -0.08 0.45 NA [11,] 0.06 -0.02 0.02 0.02 0.06 0.07 NA [12,] 0.00 0.00 -0.06 -0.17 0.01 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/1d5t21457345956.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/2dua11457345956.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/3qdlv1457345956.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/49knm1457345956.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,] 92.800 92.90 93.060 93.28 93.410 93.49 93.49 93.500 93.56 94.12 [2,] 94.360 94.50 94.850 95.16 95.730 95.76 95.76 95.810 96.09 96.48 [3,] 97.485 97.59 97.645 98.22 99.015 99.23 99.22 99.355 99.47 99.41 [4,] 100.750 100.85 100.790 100.84 101.040 101.11 101.15 101.110 101.26 100.83 [5,] 100.820 100.96 101.050 101.33 101.380 101.44 101.51 101.400 101.28 101.62 [,11] [,12] [1,] 94.300 94.360 [2,] 96.710 96.690 [3,] 99.535 99.575 [4,] 100.900 100.920 [5,] 102.070 102.140 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 93.36324 93.49404 93.81351 94.55622 95.58988 95.77908 95.74328 [2,] 101.60676 101.68596 101.47649 101.88378 102.44012 102.68092 102.69672 [,8] [,9] [,10] [,11] [,12] [1,] 95.93633 96.13518 96.60411 96.83231 96.84651 [2,] 102.77367 102.80482 102.21589 102.23769 102.30349 $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(92.8, 94.36, 97.485, 100.75, 100.82, 92.9, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50gx91457345956.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.03 -0.06 0.05 0.05 0.030 -0.02 -0.11 0.060 -0.430 0.140 -0.02 -0.06 [2,] 0.03 0.04 0.11 0.13 0.060 0.00 -0.04 0.060 -0.190 0.140 0.02 -0.06 [3,] 0.12 0.08 0.25 0.38 0.075 0.00 0.03 0.115 0.205 0.205 0.04 0.00 [4,] 0.21 0.16 0.31 0.57 0.130 0.04 0.05 0.170 0.390 0.260 0.06 0.00 [5,] 0.24 0.16 0.31 1.03 0.130 0.07 0.05 0.280 0.560 0.260 0.07 0.01 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.003894186 0.002596124 0.1209935 0.09618579 0.02984774 -0.02580129 [2,] 0.236105814 0.157403876 0.3790065 0.66381421 0.12015226 0.02580129 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.02805291 0.04404645 -0.1691187 0.1275961 0.01419871 -0.04239585 [2,] 0.08805291 0.18595355 0.5791187 0.2824039 0.06580129 0.04239585 $out [1] 0.35 1.04 0.30 0.22 -0.14 -0.08 0.45 -0.17 $group [1] 2 3 5 7 8 10 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0300000000000011, 0.0300000000000011, 0.120000000000005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6jwft1457345956.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,] 92.80 94.360 96.660 98.280 100.750 100.790 NA [2,] 93.17 95.005 96.785 99.080 100.820 100.845 NA [3,] 93.49 95.760 97.990 100.460 101.155 101.110 NA [4,] 93.84 96.285 98.145 100.755 101.390 101.450 NA [5,] 94.36 96.710 98.340 100.920 101.510 102.140 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 93.18441 95.17618 97.36969 99.69602 100.895 100.8341 NA [2,] 93.79559 96.34382 98.61031 101.22398 101.415 101.3859 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(92.8, 93.17, 93.49, 93.84, 94.36, 94.36, 95.005, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ymkr1457345956.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.28333 97.4850 97.53750 [2,] 97.67417 97.9325 97.91563 [3,] 98.38417 99.2250 98.64000 [4,] 98.58333 99.4400 98.85875 [5,] 98.87667 99.5750 98.99750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 97.96949 98.53742 98.20983 [2,] 98.79884 99.91258 99.07017 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(97.2833333333333, 97.6741666666667, 98.3841666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d5t21457345956.ps tmp/1d5t21457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/2dua11457345956.ps tmp/2dua11457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/3qdlv1457345956.ps tmp/3qdlv1457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/49knm1457345956.ps tmp/49knm1457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/50gx91457345956.ps tmp/50gx91457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/6jwft1457345956.ps tmp/6jwft1457345956.png",intern=TRUE)) character(0) > try(system("convert tmp/7ymkr1457345956.ps tmp/7ymkr1457345956.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.452 0.426 2.899