R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" 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(7175,7048.75,6922.5,6670,9225,9098.75,7175,5897.5,6023.75,6023.75,6150,6416.25,5645,4872.5,4240,4240,6670,6922.5,4998.75,2822.5,3973.75,3973.75,4872.5,5391.25,5265,3973.75,4620,4366.25,6542.5,6023.75,3973.75,2442.5,3847.5,4240,4620,5125,4100,3215,3595,3721.25,7048.75,7048.75,5125,4872.5,5645,5265,6290,7567.5,7821.25,6023.75,5517.5,4998.75,8466.25,8720,8073.75,8720,8592.5,7567.5,8720,9997.5,10516.25,8972.5,7947.5,8720,12047.5,13072.5,12820,13325,13198.75,11921.25,14097.5,14616.25,15375,13072.5,12173.75,13198.75,15641.25,17817.5,17298.75,17298.75,17552.5,16666.25,18970,18970,18577.5,16400,16792.5,17046.25,18716.25,20892.5,19348.75,20121.25,19475,19096.25,22045,21398.75,20500,19222.5,20500,21146.25,21917.5,22942.5,21917.5,22550,21778.75,21652.5,24853.75,25120,24095,22297.5,23828.75,24473.75,25246.25,26397.5,25246.25,26145,25752.5,24347.5,27296.25,27296.25) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7175.00 5645.00 5265.00 4100.00 7821.25 10516.25 15375.00 18577.50 [2,] 7048.75 4872.50 3973.75 3215.00 6023.75 8972.50 13072.50 16400.00 [3,] 6922.50 4240.00 4620.00 3595.00 5517.50 7947.50 12173.75 16792.50 [4,] 6670.00 4240.00 4366.25 3721.25 4998.75 8720.00 13198.75 17046.25 [5,] 9225.00 6670.00 6542.50 7048.75 8466.25 12047.50 15641.25 18716.25 [6,] 9098.75 6922.50 6023.75 7048.75 8720.00 13072.50 17817.50 20892.50 [7,] 7175.00 4998.75 3973.75 5125.00 8073.75 12820.00 17298.75 19348.75 [8,] 5897.50 2822.50 2442.50 4872.50 8720.00 13325.00 17298.75 20121.25 [9,] 6023.75 3973.75 3847.50 5645.00 8592.50 13198.75 17552.50 19475.00 [10,] 6023.75 3973.75 4240.00 5265.00 7567.50 11921.25 16666.25 19096.25 [11,] 6150.00 4872.50 4620.00 6290.00 8720.00 14097.50 18970.00 22045.00 [12,] 6416.25 5391.25 5125.00 7567.50 9997.50 14616.25 18970.00 21398.75 [,9] [,10] [,11] [1,] 20500.00 24095.00 NA [2,] 19222.50 22297.50 NA [3,] 20500.00 23828.75 NA [4,] 21146.25 24473.75 NA [5,] 21917.50 25246.25 NA [6,] 22942.50 26397.50 NA [7,] 21917.50 25246.25 NA [8,] 22550.00 26145.00 NA [9,] 21778.75 25752.50 NA [10,] 21652.50 24347.50 NA [11,] 24853.75 27296.25 NA [12,] 25120.00 27296.25 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -126.25 -772.50 -1291.25 -885.00 -1797.50 -1543.75 -2302.50 -2177.50 [2,] -126.25 -632.50 646.25 380.00 -506.25 -1025.00 -898.75 392.50 [3,] -252.50 0.00 -253.75 126.25 -518.75 772.50 1025.00 253.75 [4,] 2555.00 2430.00 2176.25 3327.50 3467.50 3327.50 2442.50 1670.00 [5,] -126.25 252.50 -518.75 0.00 253.75 1025.00 2176.25 2176.25 [6,] -1923.75 -1923.75 -2050.00 -1923.75 -646.25 -252.50 -518.75 -1543.75 [7,] -1277.50 -2176.25 -1531.25 -252.50 646.25 505.00 0.00 772.50 [8,] 126.25 1151.25 1405.00 772.50 -127.50 -126.25 253.75 -646.25 [9,] 0.00 0.00 392.50 -380.00 -1025.00 -1277.50 -886.25 -378.75 [10,] 126.25 898.75 380.00 1025.00 1152.50 2176.25 2303.75 2948.75 [11,] 266.25 518.75 505.00 1277.50 1277.50 518.75 0.00 -646.25 [12,] -771.25 -126.25 -1025.00 253.75 518.75 758.75 -392.50 -898.75 [,9] [,10] [,11] [1,] -1277.50 -1797.50 NA [2,] 1277.50 1531.25 NA [3,] 646.25 645.00 NA [4,] 771.25 772.50 NA [5,] 1025.00 1151.25 NA [6,] -1025.00 -1151.25 NA [7,] 632.50 898.75 NA [8,] -771.25 -392.50 NA [9,] -126.25 -1405.00 NA [10,] 3201.25 2948.75 NA [11,] 266.25 0.00 NA [12,] -1025.00 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/1d3pg1470668270.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/2270i1470668270.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/3ewmj1470668270.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/4ww901470668270.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] [1,] 4100.00 3215.000 3595.00 3721.25 6542.50 6023.75 3973.75 2442.50 [2,] 5645.00 4872.500 4620.00 4366.25 7048.75 7048.75 5125.00 4872.50 [3,] 9168.75 8010.625 7435.00 7695.00 10636.25 11085.62 10446.88 11022.50 [4,] 18577.50 16400.000 16792.50 17046.25 18716.25 20892.50 19348.75 20121.25 [5,] 24095.00 22297.500 23828.75 24473.75 25246.25 26397.50 25246.25 26145.00 [,9] [,10] [,11] [,12] [1,] 3847.50 3973.750 4620.00 5125.00 [2,] 5645.00 5265.000 6150.00 6416.25 [3,] 10895.62 9744.375 11408.75 12306.88 [4,] 19475.00 19096.250 22045.00 21398.75 [5,] 25752.50 24347.500 27296.25 27296.25 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 2707.157 2251.026 1353.134 1359.566 4806.702 4168.736 3340.122 [2,] 15630.343 13770.224 13516.866 14030.434 16465.798 18002.514 17553.628 [,8] [,9] [,10] [,11] [,12] [1,] 3403.617 3985.606 2833.731 3466.974 4821.021 [2,] 18641.383 17805.644 16655.019 19350.526 19792.729 $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(4100, 5645, 9168.75, 18577.5, 24095, 3215, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/567ym1470668270.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] [1,] -2302.50 -1025.000 -518.75 771.25 -518.750 -2050.00 -2176.25 -771.25 [2,] -1797.50 -632.500 -252.50 1670.00 0.000 -1923.75 -1277.50 -392.50 [3,] -1417.50 126.875 190.00 2436.25 639.375 -1347.50 252.50 0.00 [4,] -885.00 646.250 646.25 3327.50 1151.250 -646.25 646.25 772.50 [5,] -126.25 1531.250 1025.00 3467.50 2176.250 -252.50 898.75 1405.00 [,9] [,10] [,11] [,12] [1,] -1405.000 126.250 -646.250 -1025.00 [2,] -1025.000 898.750 0.000 -898.75 [3,] -379.375 1664.375 385.625 -392.50 [4,] 0.000 2948.750 518.750 253.75 [5,] 392.500 3201.250 1277.500 758.75 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1873.4214 -512.0395 -259.0513 1608.097 64.1646 -1985.7899 -708.6822 [2,] -961.5786 765.7895 639.0513 3264.403 1214.5854 -709.2101 1213.6822 [,8] [,9] [,10] [,11] [,12] [1,] -582.0804 -891.5059 640.1133 126.4368 -999.4833 [2,] 582.0804 132.7559 2688.6367 644.8132 214.4833 $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(-2302.5, -1797.5, -1417.5, -885, -126.25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6mree1470668270.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,] 5897.500 2822.500 2442.500 3215.000 4998.750 7947.500 12173.75 16400.00 [2,] 6086.875 4106.875 3973.750 3910.625 6795.625 9744.375 14286.88 17811.88 [3,] 6796.250 4872.500 4493.125 5195.000 8270.000 12433.750 16982.50 19222.50 [4,] 7175.000 5518.125 5195.000 6669.375 8720.000 13261.875 17685.00 20506.88 [5,] 7175.000 6922.500 6542.500 7567.500 9997.500 14616.250 18970.00 22045.00 [,9] [,10] [,11] [1,] 19222.50 22297.50 NA [2,] 20823.12 24221.25 NA [3,] 21848.12 25246.25 NA [4,] 22746.25 26271.25 NA [5,] 25120.00 27296.25 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6299.949 4228.819 3936.105 3936.716 7392.28 10829.39 15432.59 17993.29 [2,] 7292.551 5516.181 5050.145 6453.284 9147.72 14038.11 18532.41 20451.71 [,9] [,10] [,11] [1,] 20970.97 24311.23 NA [2,] 22725.28 26181.27 NA $out [1] 9225.00 9098.75 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(5897.5, 6086.875, 6796.25, 7175, 7175, 2822.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lok41470668270.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,] 10509.88 7435.000 10241.09 [2,] 11382.56 8589.688 11133.20 [3,] 12501.75 10541.562 12254.53 [4,] 13471.81 11054.062 13202.97 [5,] 14189.88 12306.875 13795.16 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 11548.83 9417.545 11310.50 [2,] 13454.67 11665.580 13198.57 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10509.875, 11382.5625, 12501.75, 13471.8125, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1d3pg1470668270.ps tmp/1d3pg1470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/2270i1470668270.ps tmp/2270i1470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/3ewmj1470668270.ps tmp/3ewmj1470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/4ww901470668270.ps tmp/4ww901470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/567ym1470668270.ps tmp/567ym1470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/6mree1470668270.ps tmp/6mree1470668270.png",intern=TRUE)) character(0) > try(system("convert tmp/7lok41470668270.ps tmp/7lok41470668270.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.496 0.249 2.787