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(45564.6,47295.5,46465.5,50679.5,47452.8,49415.4,48165.3,51814,49030.7,50820.8,49729.5,53501.6,50524.9,52095,51290.3,55064,52505.2,54318.3,53039.6,57607.6,54236.4,56586.4,55614,60085.9,56963.5,59152.8,57804.6,62541.5,59449.3,61704.7,60399,65724.7,62679.4,65526.5,64274.8,68769.1,63542.8,66198,64544.9,71041.8,66087.2,69005.8,66897,73702,68485.3,71457,69774.6,76479.7,71204.7,73783.9,71651,78541.6,72714.4,75258,73168.1,79701.6,73944.5,76401.2,73948.1,80583.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] 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,] 45564.6 50524.9 56963.5 63542.8 71204.7 NA [2,] 47295.5 52095.0 59152.8 66198.0 73783.9 NA [3,] 46465.5 51290.3 57804.6 64544.9 71651.0 NA [4,] 50679.5 55064.0 62541.5 71041.8 78541.6 NA [5,] 47452.8 52505.2 59449.3 66087.2 72714.4 NA [6,] 49415.4 54318.3 61704.7 69005.8 75258.0 NA [7,] 48165.3 53039.6 60399.0 66897.0 73168.1 NA [8,] 51814.0 57607.6 65724.7 73702.0 79701.6 NA [9,] 49030.7 54236.4 62679.4 68485.3 73944.5 NA [10,] 50820.8 56586.4 65526.5 71457.0 76401.2 NA [11,] 49729.5 55614.0 64274.8 69774.6 73948.1 NA [12,] 53501.6 60085.9 68769.1 76479.7 80583.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1730.9 1570.1 2189.3 2655.2 2579.2 NA [2,] -830.0 -804.7 -1348.2 -1653.1 -2132.9 NA [3,] 4214.0 3773.7 4736.9 6496.9 6890.6 NA [4,] -3226.7 -2558.8 -3092.2 -4954.6 -5827.2 NA [5,] 1962.6 1813.1 2255.4 2918.6 2543.6 NA [6,] -1250.1 -1278.7 -1305.7 -2108.8 -2089.9 NA [7,] 3648.7 4568.0 5325.7 6805.0 6533.5 NA [8,] -2783.3 -3371.2 -3045.3 -5216.7 -5757.1 NA [9,] 1790.1 2350.0 2847.1 2971.7 2456.7 NA [10,] -1091.3 -972.4 -1251.7 -1682.4 -2453.1 NA [11,] 3772.1 4471.9 4494.3 6705.1 6635.2 NA [12,] -2976.7 -3122.4 -5226.3 -5275.0 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/10evp1457982436.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/2zxf61457982436.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/3lleh1457982436.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/4atou1457982436.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] [1,] 45564.6 47295.5 46465.5 50679.5 47452.8 49415.4 48165.3 51814.0 49030.7 [2,] 50524.9 52095.0 51290.3 55064.0 52505.2 54318.3 53039.6 57607.6 54236.4 [3,] 56963.5 59152.8 57804.6 62541.5 59449.3 61704.7 60399.0 65724.7 62679.4 [4,] 63542.8 66198.0 64544.9 71041.8 66087.2 69005.8 66897.0 73702.0 68485.3 [5,] 71204.7 73783.9 71651.0 78541.6 72714.4 75258.0 73168.1 79701.6 73944.5 [,10] [,11] [,12] [1,] 50820.8 49729.5 53501.6 [2,] 56586.4 55614.0 60085.9 [3,] 65526.5 64274.8 68769.1 [4,] 71457.0 69774.6 76479.7 [5,] 76401.2 73948.1 80583.3 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 47765.08 49187.66 48438.93 51251.63 49852.29 51326.55 50607.4 54352.44 [2,] 66161.92 69117.94 67170.27 73831.37 69046.31 72082.85 70190.6 77096.96 [,9] [,10] [,11] [,12] [1,] 52611.16 55018.97 54268.96 57185.28 [2,] 72747.64 76034.03 74280.64 80352.92 $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(45564.6, 50524.9, 56963.5, 63542.8, 71204.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5d9wq1457982436.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] [1,] 1570.1 -2132.9 3773.7 -5827.2 1813.1 -2108.8 3648.7 -5757.1 1790.1 -2453.1 [2,] 1730.9 -1653.1 4214.0 -4954.6 1962.6 -2089.9 4568.0 -5216.7 2350.0 -1682.4 [3,] 2189.3 -1348.2 4736.9 -3226.7 2255.4 -1305.7 5325.7 -3371.2 2456.7 -1251.7 [4,] 2579.2 -830.0 6496.9 -3092.2 2543.6 -1278.7 6533.5 -3045.3 2847.1 -1091.3 [5,] 2655.2 -804.7 6890.6 -2558.8 2918.6 -1250.1 6805.0 -2783.3 2971.7 -972.4 [,11] [,12] [1,] 3772.1 -5275.00 [2,] 4471.9 -5250.65 [3,] 4494.3 -4174.35 [4,] 6635.2 -3049.55 [5,] 6705.1 -2976.70 $n [1] 5 5 5 5 5 5 5 5 5 5 5 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1589.893 -1929.8004 3123.809 -4542.667 1844.867 -1878.8919 3936.883 [2,] 2788.707 -766.5996 6349.991 -1910.733 2665.933 -732.5081 6714.517 [,8] [,9] [,10] [,11] [,12] [1,] -4905.506 2105.45 -1669.3698 2965.718 -5913.219 [2,] -1836.894 2807.95 -834.0302 6022.882 -2435.481 $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(1570.1, 1730.9, 2189.3, 2579.2, 2655.2, -2132.89999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zl5g1457982436.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,] 45564.60 50524.90 56963.50 63542.80 71204.70 NA [2,] 47374.15 52300.10 59301.05 66142.60 72941.25 NA [3,] 49223.05 54277.35 62123.10 68745.55 73946.30 NA [4,] 50750.15 56100.20 64900.65 71249.40 77471.40 NA [5,] 53501.60 60085.90 68769.10 76479.70 80583.30 NA $n [1] 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] 47683.23 52544.1 59569.08 66416.3 71880.07 NA [2,] 50762.87 56010.6 64677.12 71074.8 76012.53 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" NA Warning message: In bxp(list(stats = c(45564.6, 47374.15, 49223.05, 50750.15, 53501.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/72zt01457982436.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,] 57560.10 56963.50 57033.85 [2,] 59673.41 59301.05 59221.35 [3,] 61807.85 62123.10 61511.45 [4,] 63866.03 64900.65 63537.30 [5,] 67883.92 68769.10 68282.80 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 59895.57 59569.08 59542.92 [2,] 63720.13 64677.12 63479.98 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/10evp1457982436.ps tmp/10evp1457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/2zxf61457982436.ps tmp/2zxf61457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/3lleh1457982436.ps tmp/3lleh1457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/4atou1457982436.ps tmp/4atou1457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/5d9wq1457982436.ps tmp/5d9wq1457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/6zl5g1457982436.ps tmp/6zl5g1457982436.png",intern=TRUE)) character(0) > try(system("convert tmp/72zt01457982436.ps tmp/72zt01457982436.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.788 0.515 3.329