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(109843,106365,102304,97968,92462,92286,120092,126656,124144,114045,108120,105698,111203,110030,104009,99772,96301,97680,121563,134210,133111,124527,117589,115699,117830,115874,111267,107985,102185,102101,128932,135782,136971,126292,119260,117359,119818,116059,110046,104100,97981,97527,123700,129678,130790,120961,114232,110518,110959,108443,103977,97126,90860,91959,113735,119713,121905,112442,106728,104906,105308,102909,97849,93181,87470,86998,106716,115028,116828,108413,102628,99126) > 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,] 109843 111203 117830 119818 110959 105308 NA [2,] 106365 110030 115874 116059 108443 102909 NA [3,] 102304 104009 111267 110046 103977 97849 NA [4,] 97968 99772 107985 104100 97126 93181 NA [5,] 92462 96301 102185 97981 90860 87470 NA [6,] 92286 97680 102101 97527 91959 86998 NA [7,] 120092 121563 128932 123700 113735 106716 NA [8,] 126656 134210 135782 129678 119713 115028 NA [9,] 124144 133111 136971 130790 121905 116828 NA [10,] 114045 124527 126292 120961 112442 108413 NA [11,] 108120 117589 119260 114232 106728 102628 NA [12,] 105698 115699 117359 110518 104906 99126 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3478 -1173 -1956 -3759 -2516 -2399 NA [2,] -4061 -6021 -4607 -6013 -4466 -5060 NA [3,] -4336 -4237 -3282 -5946 -6851 -4668 NA [4,] -5506 -3471 -5800 -6119 -6266 -5711 NA [5,] -176 1379 -84 -454 1099 -472 NA [6,] 27806 23883 26831 26173 21776 19718 NA [7,] 6564 12647 6850 5978 5978 8312 NA [8,] -2512 -1099 1189 1112 2192 1800 NA [9,] -10099 -8584 -10679 -9829 -9463 -8415 NA [10,] -5925 -6938 -7032 -6729 -5714 -5785 NA [11,] -2422 -1890 -1901 -3714 -1822 -3502 NA [12,] 5505 2131 2459 441 402 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/1arse1489482663.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/2fzaw1489482663.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/3u1fm1489482663.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/45y441489482663.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,] 105308 102909.0 97849 93181 87470.0 86998.0 106716.0 115028 116828 [2,] 109843 106365.0 102304 97126 90860.0 91959.0 113735.0 119713 121905 [3,] 111081 109236.5 103993 98870 94381.5 94906.5 120827.5 128167 127467 [4,] 117830 115874.0 110046 104100 97981.0 97680.0 123700.0 134210 133111 [5,] 119818 116059.0 111267 107985 102185.0 102101.0 128932.0 135782 136971 [,10] [,11] [,12] [1,] 108413 102628 99126 [2,] 112442 106728 104906 [3,] 117503 111176 108108 [4,] 124527 117589 115699 [5,] 126292 119260 117359 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 105929.1 103102.9 98999.16 94371.54 89788.22 91216.27 114399.8 118816 [2,] 116232.9 115370.1 108986.84 103368.46 98974.78 98596.73 127255.2 137518 [,9] [,10] [,11] [,12] [1,] 120238.8 109707.8 104170.3 101146.2 [2,] 134695.2 125298.2 118181.7 115069.8 $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(105308, 109843, 111081, 117830, 119818, 102909, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59i881489482663.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] [1,] -3759.0 -6021.0 -6851 -6266.0 -472 19718 5978 -2512.0 -10679 -7032 -3714.0 [2,] -3478.0 -6013.0 -5946 -6119.0 -454 21776 5978 -1099.0 -10099 -6938 -3502.0 [3,] -2457.5 -4833.5 -4502 -5755.5 -130 25028 6707 1150.5 -9646 -6327 -2161.5 [4,] -1956.0 -4466.0 -4237 -5506.0 1099 26831 8312 1800.0 -8584 -5785 -1890.0 [5,] -1173.0 -4061.0 -3282 -5506.0 1379 27806 8312 2192.0 -8415 -5714 -1822.0 [,12] [1,] 402 [2,] 441 [3,] 2131 [4,] 2459 [5,] 2459 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3439.239 -5831.365 -5604.36 -6150.905 -1131.7352 21767.36 5201.495 [2,] -1475.761 -3835.635 -3399.64 -5360.095 871.7352 28288.64 8212.505 [,8] [,9] [,10] [,11] [,12] [1,] -719.4486 -10623.224 -7070.722 -3201.292 705.0863 [2,] 3020.4486 -8668.776 -5583.278 -1121.708 3556.9137 $out [1] -3471 12647 5505 $group [1] 4 7 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-3759, -3478, -2457.5, -1956, -1173, -6021, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lvrl1489482663.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,] 92286.0 96301.0 102101.0 97527.0 90860.0 86998.0 NA [2,] 100136.0 101890.5 109626.0 107073.0 100551.5 95515.0 NA [3,] 107242.5 113451.0 117594.5 115145.5 107585.5 102768.5 NA [4,] 117068.5 123045.0 127612.0 122330.5 113088.5 107564.5 NA [5,] 126656.0 134210.0 136971.0 130790.0 121905.0 116828.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 99519.47 103802.3 109391 108186.5 101867.3 97272.64 NA [2,] 114965.53 123099.7 125798 122104.5 113303.7 108264.36 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(92286, 100136, 107242.5, 117068.5, 126656, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fy4s1489482663.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,] 94543.17 94381.5 94410.75 [2,] 102465.33 101431.5 102903.38 [3,] 110686.42 110158.8 111280.81 [4,] 118451.50 119165.2 118742.06 [5,] 127291.50 128167.0 127497.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103395.0 102070.3 104056.7 [2,] 117977.8 118247.2 118504.9 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > try(system("convert tmp/1arse1489482663.ps tmp/1arse1489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/2fzaw1489482663.ps tmp/2fzaw1489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/3u1fm1489482663.ps tmp/3u1fm1489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/45y441489482663.ps tmp/45y441489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/59i881489482663.ps tmp/59i881489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/6lvrl1489482663.ps tmp/6lvrl1489482663.png",intern=TRUE)) character(0) > try(system("convert tmp/7fy4s1489482663.ps tmp/7fy4s1489482663.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.112 0.229 3.469