R version 3.2.2 (2015-08-14) -- "Fire Safety" 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(64076,63136,60198,59057,57388,56708,70019,72263,74152,67057,61941,58331,59252,56568,53031,51840,48290,45817,59421,61621,60976,57497,53037,53088,53119,51644,47866,47691,42401,43069,55797,57170,58335,55439,54399,56316,58381,58468,59025,58298,54255,55670,67816,70485,71361,66953,64505,66770,66418,65277,62008,59096,55106,54954,67943,69411,69951,63966,60410,59440,59445,57614,55396,53030,50090,48764,61658,63943,64878,60634,57905,57224,60953,60621,57258,54903,53278,53042,63753,69210,71446,68408,65427,64630,66086,65058,62689,60841,57346,56222,68202,70745,73690,68992,65925,65546,67221,65315,62038,58774,55320,53900,65544,67906,70911,66544,63657,61720) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) 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) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 64076 59252 53119 58381 66418 59445 60953 66086 67221 NA [2,] 63136 56568 51644 58468 65277 57614 60621 65058 65315 NA [3,] 60198 53031 47866 59025 62008 55396 57258 62689 62038 NA [4,] 59057 51840 47691 58298 59096 53030 54903 60841 58774 NA [5,] 57388 48290 42401 54255 55106 50090 53278 57346 55320 NA [6,] 56708 45817 43069 55670 54954 48764 53042 56222 53900 NA [7,] 70019 59421 55797 67816 67943 61658 63753 68202 65544 NA [8,] 72263 61621 57170 70485 69411 63943 69210 70745 67906 NA [9,] 74152 60976 58335 71361 69951 64878 71446 73690 70911 NA [10,] 67057 57497 55439 66953 63966 60634 68408 68992 66544 NA [11,] 61941 53037 54399 64505 60410 57905 65427 65925 63657 NA [12,] 58331 53088 56316 66770 59440 57224 64630 65546 61720 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -940 -2684 -1475 87 -1141 -1831 -332 -1028 -1906 NA [2,] -2938 -3537 -3778 557 -3269 -2218 -3363 -2369 -3277 NA [3,] -1141 -1191 -175 -727 -2912 -2366 -2355 -1848 -3264 NA [4,] -1669 -3550 -5290 -4043 -3990 -2940 -1625 -3495 -3454 NA [5,] -680 -2473 668 1415 -152 -1326 -236 -1124 -1420 NA [6,] 13311 13604 12728 12146 12989 12894 10711 11980 11644 NA [7,] 2244 2200 1373 2669 1468 2285 5457 2543 2362 NA [8,] 1889 -645 1165 876 540 935 2236 2945 3005 NA [9,] -7095 -3479 -2896 -4408 -5985 -4244 -3038 -4698 -4367 NA [10,] -5116 -4460 -1040 -2448 -3556 -2729 -2981 -3067 -2887 NA [11,] -3610 51 1917 2265 -970 -681 -797 -379 -1937 NA [12,] 921 31 2065 -352 5 3729 1456 1675 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/19nd21445005504.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/23qfr1445005504.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/3d9gq1445005504.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/4ssa71445005504.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] [,12] [1,] 53119 51644 47866 47691 42401 43069 55797 57170 58335 55439 53037 53088 [2,] 59252 57614 55396 53030 50090 48764 61658 63943 64878 60634 57905 57224 [3,] 60953 60621 59025 58298 54255 53900 65544 69210 70911 66544 61941 59440 [4,] 66086 65058 62008 59057 55320 55670 67943 70485 71446 67057 64505 64630 [5,] 67221 65315 62689 60841 57388 56708 70019 72263 74152 68992 65925 66770 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 57353.76 56700.49 55542.68 55123.78 51500.53 50262.84 62233.9 65764.55 [2,] 64552.24 64541.51 62507.32 61472.22 57009.47 57537.16 68854.1 72655.45 [,9] [,10] [,11] [,12] [1,] 67451.85 63161.22 58465 55539.51 [2,] 74370.15 69926.78 65417 63340.49 $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(53119, 59252, 60953, 66086, 67221, 51644, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5j60s1445005504.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,] -2684 -3778 -3264 -5290 -2473 10711 2200 -645 -5985 -4460 -1937 -352.0 [2,] -1831 -3363 -2366 -3990 -1326 11980 2200 876 -4698 -3556 -970 18.0 [3,] -1141 -3269 -1848 -3495 -680 12728 2285 1165 -4367 -2981 -681 1188.5 [4,] -940 -2369 -1141 -2940 -152 12989 2543 2236 -3479 -2729 51 1870.0 [5,] 87 -2218 -175 -1625 1415 13604 2669 3005 -2896 -2448 51 3729.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -1610.26 -3792.507 -2493.167 -4048 -1298.30667 12196.59 2104.353 448.7333 [2,] -671.74 -2745.493 -1202.833 -2942 -61.69333 13259.41 2465.647 1881.2667 [,9] [,10] [,11] [,12] [1,] -5009.007 -3416.553 -1218.7267 153.9462 [2,] -3724.993 -2545.447 -143.2733 2223.0538 $out [1] 557 1373 1468 5457 -7095 -5116 -1040 -3610 1917 2265 $group [1] 2 7 7 7 9 10 10 11 11 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2684, -1831, -1141, -940, 87, -3778, -3363, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qwcz1445005504.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] [,9] [1,] 56708.0 45817.0 42401.0 54255.0 54954.0 48764.0 53042.0 56222.0 53900.0 [2,] 58694.0 52435.5 47778.5 58339.5 59268.0 54213.0 56080.5 61765.0 60247.0 [3,] 62538.5 54828.0 53759.0 61765.0 62987.0 57759.5 62353.0 65735.5 64486.0 [4,] 68538.0 59336.5 56056.5 67384.5 67180.5 61146.0 66917.5 68597.0 66882.5 [5,] 74152.0 61621.0 58335.0 71361.0 69951.0 64878.0 71446.0 73690.0 70911.0 [,10] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58048.59 51680.41 49983.35 57639.51 59378.06 54597.31 57410.17 62619.38 [2,] 67028.41 57975.59 57534.65 65890.49 66595.94 60921.69 67295.83 68851.62 [,9] [,10] [1,] 61459.5 NA [2,] 67512.5 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(56708, 58694, 62538.5, 68538, 74152, 45817, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jm6g1445005504.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,] 52016.22 53900.0 52217.00 [2,] 56835.50 58661.5 57372.75 [3,] 60605.94 60787.0 61270.50 [4,] 64202.39 66044.0 64323.00 [5,] 68411.11 70911.0 68162.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 57245.86 57419.79 58100.44 [2,] 63966.03 64154.21 64440.56 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(52016.2222222222, 56835.5, 60605.9444444444, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/19nd21445005504.ps tmp/19nd21445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/23qfr1445005504.ps tmp/23qfr1445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/3d9gq1445005504.ps tmp/3d9gq1445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/4ssa71445005504.ps tmp/4ssa71445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/5j60s1445005504.ps tmp/5j60s1445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/6qwcz1445005504.ps tmp/6qwcz1445005504.png",intern=TRUE)) character(0) > try(system("convert tmp/7jm6g1445005504.ps tmp/7jm6g1445005504.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.515 0.448 2.989