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(790,766,1040,949,758,1023,921,775,907,835,871,836,789,811,996,778,603,990,735,800,706,766,870,647,726,784,884,696,893,674,703,799,793,799,1022,758,1021,944,915,864,1022,891,1087,822,890,1092,967,833,1104,1063,1103,1039,1185,1047,1155,878,879,1133,920,943,938,900,781,1040,792,653,866,679,799,760,699,762) > 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] 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,] 790 789 726 1021 1104 938 NA [2,] 766 811 784 944 1063 900 NA [3,] 1040 996 884 915 1103 781 NA [4,] 949 778 696 864 1039 1040 NA [5,] 758 603 893 1022 1185 792 NA [6,] 1023 990 674 891 1047 653 NA [7,] 921 735 703 1087 1155 866 NA [8,] 775 800 799 822 878 679 NA [9,] 907 706 793 890 879 799 NA [10,] 835 766 799 1092 1133 760 NA [11,] 871 870 1022 967 920 699 NA [12,] 836 647 758 833 943 762 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -24 22 58 -77 -41 -38 NA [2,] 274 185 100 -29 40 -119 NA [3,] -91 -218 -188 -51 -64 259 NA [4,] -191 -175 197 158 146 -248 NA [5,] 265 387 -219 -131 -138 -139 NA [6,] -102 -255 29 196 108 213 NA [7,] -146 65 96 -265 -277 -187 NA [8,] 132 -94 -6 68 1 120 NA [9,] -72 60 6 202 254 -39 NA [10,] 36 104 223 -125 -213 -61 NA [11,] -35 -223 -264 -134 23 63 NA [12,] -47 79 263 271 -5 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/16uly1445103512.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/22fbe1445103512.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/389p61445103512.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/4s9rh1445103512.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] [1,] 726 766.0 781.0 696.0 603.0 653.0 703.0 775.0 706 760 870.0 [2,] 789 784.0 884.0 778.0 758.0 674.0 735.0 775.0 793 766 870.0 [3,] 864 855.5 955.5 906.5 842.5 940.5 893.5 799.5 839 817 895.5 [4,] 1021 944.0 1040.0 1039.0 1022.0 1023.0 1087.0 822.0 890 1092 967.0 [5,] 1104 1063.0 1103.0 1040.0 1185.0 1047.0 1155.0 878.0 907 1133 1022.0 [,12] [1,] 647.0 [2,] 758.0 [3,] 797.5 [4,] 836.0 [5,] 943.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 714.3525 752.2948 854.875 738.1466 672.2115 715.3837 666.4486 [2,] 1013.6475 958.7052 1056.125 1074.8534 1012.7885 1165.6163 1120.5514 [,8] [,9] [,10] [,11] [,12] [1,] 769.1835 776.4319 606.7195 832.9319 747.1875 [2,] 829.8165 901.5681 1027.2805 958.0681 847.8125 $out [1] 679 699 $group [1] 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(726, 789, 864, 1021, 1104, 766, 784, 855.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5a37q1445103512.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,] -77 -119 -218.0 -248.0 -219.0 -255.0 -277.0 -94.0 -72 -213.0 -264.0 [2,] -41 -29 -188.0 -191.0 -139.0 -102.0 -265.0 -6.0 -39 -125.0 -223.0 [3,] -31 70 -77.5 -14.5 -134.5 68.5 -166.5 34.5 33 -12.5 -84.5 [4,] 22 185 -51.0 158.0 265.0 196.0 65.0 120.0 202 104.0 23.0 [5,] 58 274 -51.0 197.0 387.0 213.0 96.0 132.0 254 223.0 63.0 [,12] [1,] -47 [2,] -5 [3,] 79 [4,] 263 [5,] 271 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -71.637035 -68.03691 -165.86942 -239.6163 -395.093 -123.7196 -379.36066 [2,] 9.637035 208.03691 10.86942 210.6163 126.093 260.7196 46.36066 [,8] [,9] [,10] [,11] [,12] [1,] -46.77407 -122.4528 -160.2124 -243.17795 -110.3681 [2,] 115.77407 188.4528 135.2124 74.17795 268.3681 $out [1] 259 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-77, -41, -31, 22, 58, -119, -29, 70, 185, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6imb31445103512.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,] 758.0 603.0 674.0 822.0 878.0 653.0 NA [2,] 782.5 720.5 714.5 877.0 931.5 729.5 NA [3,] 853.5 783.5 788.5 929.5 1055.0 786.5 NA [4,] 935.0 840.5 841.5 1021.5 1118.5 883.0 NA [5,] 1040.0 996.0 1022.0 1092.0 1185.0 1040.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 783.9437 728.7672 730.5744 863.5926 969.708 716.4876 NA [2,] 923.0563 838.2328 846.4256 995.4074 1140.292 856.5124 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(758, 782.5, 853.5, 935, 1040, 603, 720.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ex2a1445103512.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,] 792.1667 797.50 797.1250 [2,] 852.2500 828.00 851.3750 [3,] 885.5833 859.75 886.4375 [4,] 896.0833 901.00 907.3125 [5,] 953.1667 955.50 960.3750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 865.5907 826.4542 860.924 [2,] 905.5760 893.0458 911.951 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(792.166666666667, 852.25, 885.583333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16uly1445103512.ps tmp/16uly1445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/22fbe1445103512.ps tmp/22fbe1445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/389p61445103512.ps tmp/389p61445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/4s9rh1445103512.ps tmp/4s9rh1445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/5a37q1445103512.ps tmp/5a37q1445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/6imb31445103512.ps tmp/6imb31445103512.png",intern=TRUE)) character(0) > try(system("convert tmp/7ex2a1445103512.ps tmp/7ex2a1445103512.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.422 0.419 2.875