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 = '4' > par1 <- '4' > #'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] 15 > 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] 15 15 15 15 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 45564.6 47452.8 49030.7 50524.9 52505.2 54236.4 56963.5 59449.3 62679.4 [2,] 47295.5 49415.4 50820.8 52095.0 54318.3 56586.4 59152.8 61704.7 65526.5 [3,] 46465.5 48165.3 49729.5 51290.3 53039.6 55614.0 57804.6 60399.0 64274.8 [4,] 50679.5 51814.0 53501.6 55064.0 57607.6 60085.9 62541.5 65724.7 68769.1 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 63542.8 66087.2 68485.3 71204.7 72714.4 73944.5 NA [2,] 66198.0 69005.8 71457.0 73783.9 75258.0 76401.2 NA [3,] 64544.9 66897.0 69774.6 71651.0 73168.1 73948.1 NA [4,] 71041.8 73702.0 76479.7 78541.6 79701.6 80583.3 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1730.9 1962.6 1790.1 1570.1 1813.1 2350.0 2189.3 2255.4 2847.1 [2,] -830.0 -1250.1 -1091.3 -804.7 -1278.7 -972.4 -1348.2 -1305.7 -1251.7 [3,] 4214.0 3648.7 3772.1 3773.7 4568.0 4471.9 4736.9 5325.7 4494.3 [4,] -3226.7 -2783.3 -2976.7 -2558.8 -3371.2 -3122.4 -3092.2 -3045.3 -5226.3 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 2655.2 2918.6 2971.7 2579.2 2543.6 2456.7 NA [2,] -1653.1 -2108.8 -1682.4 -2132.9 -2089.9 -2453.1 NA [3,] 6496.9 6805.0 6705.1 6890.6 6533.5 6635.2 NA [4,] -4954.6 -5216.7 -5275.0 -5827.2 -5757.1 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/1wz2u1457264197.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/2go441457264197.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/3unlx1457264197.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/4znjl1457264197.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] [1,] 45564.60 47295.50 46465.50 50679.50 [2,] 51515.05 53206.65 52164.95 56335.80 [3,] 59449.30 61704.70 60399.00 65724.70 [4,] 67286.25 70231.40 68335.80 75090.85 [5,] 73944.50 76401.20 73948.10 80583.30 $n [1] 15 15 15 15 $conf [,1] [,2] [,3] [,4] [1,] 53015.37 54759.38 53802.03 58073.5 [2,] 65883.23 68650.02 66995.97 73375.9 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5iui21457264197.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] [1,] 1570.10 -2453.10 3648.70 -5827.20 [2,] 1887.85 -1886.15 4342.95 -5226.30 [3,] 2350.00 -1305.70 4736.90 -3298.95 [4,] 2617.20 -1170.70 6584.35 -3045.30 [5,] 2971.70 -804.70 6890.60 -2558.80 $n [1] 15 15 15 14 $conf [,1] [,2] [,3] [,4] [1,] 2052.459 -1597.571 3822.511 -4219.927 [2,] 2647.541 -1013.829 5651.289 -2377.973 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(1570.1, 1887.85, 2350, 2617.2, 2971.7, -2453.09999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/660e81457264197.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] [,8] [1,] 45564.60 47452.80 49030.70 50524.90 52505.20 54236.40 56963.50 59449.30 [2,] 46015.05 47809.05 49380.10 50907.60 52772.40 54925.20 57384.05 59924.15 [3,] 46880.50 48790.35 50275.15 51692.65 53678.95 56100.20 58478.70 61051.85 [4,] 48987.50 50614.70 52161.20 53579.50 55962.95 58336.15 60847.15 63714.70 [5,] 50679.50 51814.00 53501.60 55064.00 57607.60 60085.90 62541.50 65724.70 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 62679.40 63542.80 66087.2 68485.30 71204.70 72714.40 73944.50 NA [2,] 63477.10 64043.85 66492.1 69129.95 71427.85 72941.25 73946.30 NA [3,] 64900.65 65371.45 67951.4 70615.80 72717.45 74213.05 75174.65 NA [4,] 67147.80 68619.90 71353.9 73968.35 76162.75 77479.80 78492.25 NA [5,] 68769.10 71041.80 73702.0 76479.70 78541.60 79701.60 80583.30 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 44532.26 46573.89 48078.08 49581.85 51158.42 53405.55 55742.85 58057.32 [2,] 49228.74 51006.81 52472.22 53803.45 56199.48 58794.85 61214.55 64046.38 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 62000.8 61756.37 64110.58 66793.46 68976.88 70627.6 71583.35 NA [2,] 67800.5 68986.53 71792.22 74438.14 76458.02 77798.5 78765.95 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] NA Warning message: In bxp(list(stats = c(45564.6, 46015.05, 46880.5, 48987.5, 50679.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7pwp01457264197.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,] 59625.71 59449.30 59400.65 [2,] 60038.40 59924.15 59825.51 [3,] 61192.85 61051.85 60984.70 [4,] 63828.57 63714.70 63716.18 [5,] 65722.53 65724.70 65713.33 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 58198.62 58057.32 57911.08 [2,] 64187.09 64046.38 64058.32 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(59625.7133333333, 60038.4, 61192.8533333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1wz2u1457264197.ps tmp/1wz2u1457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/2go441457264197.ps tmp/2go441457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/3unlx1457264197.ps tmp/3unlx1457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/4znjl1457264197.ps tmp/4znjl1457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/5iui21457264197.ps tmp/5iui21457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/660e81457264197.ps tmp/660e81457264197.png",intern=TRUE)) character(0) > try(system("convert tmp/7pwp01457264197.ps tmp/7pwp01457264197.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.392 0.375 2.799