R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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(831.5,831,830,828.4,828.1,827.6,828.2,828.2,828.7,830.5,831,831.9,832.2,831.9,830.6,829.7,828.8,826.7,825.8,825.4,825,825.6,824.6,824.5,822.6,822,821.2,820.4,819.4,819.7,818.2,817.7,817.5,817.7,817.5,816.9,820.3,819.7,819.4,818.6,818.2,817.6,817.3,816.7,817,817.6,817.8,817.8,820.9,820.7,820.6,820.8,820.4,820.2,819.8,819.6,819.6,819.8,819.9,820.3,822.9,821.9,820.6,818.9,817.3,815.6,813.8,812.1,810.8,809.6,808.7,807.3) > 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,] 831.5 832.2 822.6 820.3 820.9 822.9 NA [2,] 831.0 831.9 822.0 819.7 820.7 821.9 NA [3,] 830.0 830.6 821.2 819.4 820.6 820.6 NA [4,] 828.4 829.7 820.4 818.6 820.8 818.9 NA [5,] 828.1 828.8 819.4 818.2 820.4 817.3 NA [6,] 827.6 826.7 819.7 817.6 820.2 815.6 NA [7,] 828.2 825.8 818.2 817.3 819.8 813.8 NA [8,] 828.2 825.4 817.7 816.7 819.6 812.1 NA [9,] 828.7 825.0 817.5 817.0 819.6 810.8 NA [10,] 830.5 825.6 817.7 817.6 819.8 809.6 NA [11,] 831.0 824.6 817.5 817.8 819.9 808.7 NA [12,] 831.9 824.5 816.9 817.8 820.3 807.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.5 -0.3 -0.6 -0.6 -0.2 -1.0 NA [2,] -1.0 -1.3 -0.8 -0.3 -0.1 -1.3 NA [3,] -1.6 -0.9 -0.8 -0.8 0.2 -1.7 NA [4,] -0.3 -0.9 -1.0 -0.4 -0.4 -1.6 NA [5,] -0.5 -2.1 0.3 -0.6 -0.2 -1.7 NA [6,] 0.6 -0.9 -1.5 -0.3 -0.4 -1.8 NA [7,] 0.0 -0.4 -0.5 -0.6 -0.2 -1.7 NA [8,] 0.5 -0.4 -0.2 0.3 0.0 -1.3 NA [9,] 1.8 0.6 0.2 0.6 0.2 -1.2 NA [10,] 0.5 -1.0 -0.2 0.2 0.1 -0.9 NA [11,] 0.9 -0.1 -0.6 0.0 0.4 -1.4 NA [12,] 0.3 -1.9 3.4 3.1 2.6 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/1zfkz1483628771.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/2nujt1483628771.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/3ctq21483628771.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/4xq2y1483628771.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] [1,] 820.30 819.70 819.4 818.6 817.3 815.60 813.8 812.10 810.80 809.60 808.70 [2,] 820.90 820.70 820.6 818.9 818.2 817.60 817.3 816.70 817.00 817.60 817.50 [3,] 822.75 821.95 820.9 820.6 819.9 819.95 819.0 818.65 818.55 818.75 818.85 [4,] 831.50 831.00 830.0 828.4 828.1 826.70 825.8 825.40 825.00 825.60 824.60 [5,] 832.20 831.90 830.6 829.7 828.8 827.60 828.2 828.20 828.70 830.50 831.00 [,12] [1,] 807.30 [2,] 816.90 [3,] 819.05 [4,] 824.50 [5,] 831.90 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 815.9127 815.3062 814.8367 814.4722 813.5142 814.0802 813.5172 813.0382 [2,] 829.5873 828.5938 826.9633 826.7278 826.2858 825.8198 824.4828 824.2618 [,9] [,10] [,11] [,12] [1,] 813.3897 813.5897 814.2703 814.1478 [2,] 823.7103 823.9103 823.4297 823.9522 $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(820.3, 820.9, 822.75, 831.5, 832.2, 819.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5wob61483628771.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,] -1.00 -1.3 -1.70 -1.60 -2.10 -1.80 -0.60 -1.3 0.2 -1.00 -1.40 -1.9 [2,] -0.60 -1.3 -1.60 -1.00 -1.70 -1.50 -0.60 -0.4 0.2 -0.90 -0.60 0.3 [3,] -0.55 -0.9 -0.85 -0.65 -0.55 -0.65 -0.45 -0.1 0.4 -0.05 -0.05 2.6 [4,] -0.30 -0.3 -0.80 -0.40 -0.20 -0.30 -0.20 0.3 0.6 0.20 0.40 3.1 [5,] -0.20 -0.1 0.20 -0.30 0.30 0.60 0.00 0.5 0.6 0.50 0.90 3.4 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.7435097 -1.5450323 -1.3660258 -1.0370194 -1.5175484 -1.4240388 [2,] -0.3564903 -0.2549677 -0.3339742 -0.2629806 0.4175484 0.1240388 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.7080129 -0.5515226 0.1419871 -0.7595355 -0.6950323 0.6215271 [2,] -0.1919871 0.3515226 0.6580129 0.6595355 0.5950323 4.5784729 $out [1] -1.7 1.8 -1.2 $group [1] 7 9 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1, -0.600000000000023, -0.549999999999955, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6o9g11483628771.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,] 827.60 824.50 816.9 816.70 819.60 807.30 NA [2,] 828.20 825.20 817.6 817.45 819.80 810.20 NA [3,] 829.35 826.25 818.8 817.80 820.25 814.70 NA [4,] 831.00 830.15 820.8 819.00 820.65 819.75 NA [5,] 831.90 832.20 822.6 820.30 820.90 822.90 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 828.0729 823.9923 817.3405 817.093 819.8623 810.3442 NA [2,] 830.6271 828.5077 820.2595 818.507 820.6377 819.0558 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(827.6, 828.2, 829.35, 831, 831.9, 824.5, 825.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75yay1483628771.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,] 819.7667 818.550 820.2875 [2,] 819.9333 818.800 820.4750 [3,] 820.8750 819.475 821.2562 [4,] 823.2667 820.750 823.5438 [5,] 825.0667 822.750 825.3375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 819.3546 818.5856 819.8566 [2,] 822.3954 820.3644 822.6559 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(819.766666666667, 819.933333333333, 820.875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1zfkz1483628771.ps tmp/1zfkz1483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/2nujt1483628771.ps tmp/2nujt1483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/3ctq21483628771.ps tmp/3ctq21483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/4xq2y1483628771.ps tmp/4xq2y1483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/5wob61483628771.ps tmp/5wob61483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/6o9g11483628771.ps tmp/6o9g11483628771.png",intern=TRUE)) character(0) > try(system("convert tmp/75yay1483628771.ps tmp/75yay1483628771.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.568 0.192 2.825