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(93166,93517,94547,95299,95121,95583,96138,96647,97311,97644,100299,101130,102239,103667,104494,105944,106956,109156,109528,109813,110939,112182,113137,114506,115197,116142,117478,118678,119808,121210,122372,123266,124020,124922,125863,126898,127522,128062,129630,130919,131175,133387,134512,135423,136395,137384,138344,139342,139885,140560,141457,144577,145505,146767,147602,148490,149516,150688,151012,151614,151779,152062,152432,153634,153989,155114,155448,155514,156552,157472,158928,154948,155178,155396,156479,157562,158255,159138,160067,161112,162009,162941,163463,165473,165805,166524,167426,168593,169452,170386,171281,171950,172842,173644,174380,175639,176169,176642,177225,178180,178771,180337,180740,181299,181768,182304,182670,183241,183106,183039,183447,184915,185144,185787,186243,186518,187156,186083,186350,187010,187057,187019,187487,188280,188756,189574,189996,190251,190925,191499,192172,191639) > 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] 132 > (np <- floor(n / par1)) [1] 11 > 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] 11 11 11 11 11 11 11 11 11 11 11 11 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 93166 102239 115197 127522 139885 151779 155178 165805 176169 183106 [2,] 93517 103667 116142 128062 140560 152062 155396 166524 176642 183039 [3,] 94547 104494 117478 129630 141457 152432 156479 167426 177225 183447 [4,] 95299 105944 118678 130919 144577 153634 157562 168593 178180 184915 [5,] 95121 106956 119808 131175 145505 153989 158255 169452 178771 185144 [6,] 95583 109156 121210 133387 146767 155114 159138 170386 180337 185787 [7,] 96138 109528 122372 134512 147602 155448 160067 171281 180740 186243 [8,] 96647 109813 123266 135423 148490 155514 161112 171950 181299 186518 [9,] 97311 110939 124020 136395 149516 156552 162009 172842 181768 187156 [10,] 97644 112182 124922 137384 150688 157472 162941 173644 182304 186083 [11,] 100299 113137 125863 138344 151012 158928 163463 174380 182670 186350 [12,] 101130 114506 126898 139342 151614 154948 165473 175639 183241 187010 [,11] [,12] [1,] 187057 NA [2,] 187019 NA [3,] 187487 NA [4,] 188280 NA [5,] 188756 NA [6,] 189574 NA [7,] 189996 NA [8,] 190251 NA [9,] 190925 NA [10,] 191499 NA [11,] 192172 NA [12,] 191639 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 351 1428 945 540 675 283 218 719 473 -67 -38 NA [2,] 1030 827 1336 1568 897 370 1083 902 583 408 468 NA [3,] 752 1450 1200 1289 3120 1202 1083 1167 955 1468 793 NA [4,] -178 1012 1130 256 928 355 693 859 591 229 476 NA [5,] 462 2200 1402 2212 1262 1125 883 934 1566 643 818 NA [6,] 555 372 1162 1125 835 334 929 895 403 456 422 NA [7,] 509 285 894 911 888 66 1045 669 559 275 255 NA [8,] 664 1126 754 972 1026 1038 897 892 469 638 674 NA [9,] 333 1243 902 989 1172 920 932 802 536 -1073 574 NA [10,] 2655 955 941 960 324 1456 522 736 366 267 673 NA [11,] 831 1369 1035 998 602 -3980 2010 1259 571 660 -533 NA [12,] 1109 691 624 543 165 230 332 530 -135 47 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/188mj1457856920.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/297r81457856920.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/3aoho1457856920.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/4k5k81457856920.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,] 93166.0 93517 94547.0 95299.0 95121.0 95583.0 96138.0 96647.0 [2,] 121359.5 122102 123554.0 124798.5 125491.5 127298.5 128442.0 129344.5 [3,] 151779.0 152062 152432.0 153634.0 153989.0 155114.0 155448.0 155514.0 [4,] 170987.0 171583 172325.5 173386.5 174111.5 175361.5 176010.5 176624.5 [5,] 187057.0 187019 187487.0 188280.0 188756.0 189574.0 189996.0 190251.0 [,9] [,10] [,11] [,12] [1,] 97311.0 97644 100299.0 101130 [2,] 130207.5 131153 132103.5 133120 [3,] 156552.0 157472 158928.0 154948 [4,] 177305.0 177974 178525.0 179440 [5,] 190925.0 191499 192172.0 191639 $n [1] 11 11 11 11 11 11 11 11 11 11 11 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 128137.1 128489.8 129197.8 130487.3 130827 132217.4 132786.9 132990.4 [2,] 175420.9 175634.2 175666.2 176780.7 177151 178010.6 178109.1 178037.6 [,9] [,10] [,11] [,12] [1,] 134115.3 135167 136813.4 132881.7 [2,] 178988.7 179777 181042.6 177014.3 $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(93166, 121359.5, 151779, 170987, 187057, 93517, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5o9td1457856920.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,] -67.0 370.0 752.0 -178.0 462.0 334.0 66 469 333.0 267.0 571.0 [2,] 250.5 525.5 1019.0 305.5 850.5 412.5 280 669 555.0 444.0 586.5 [3,] 473.0 897.0 1200.0 591.0 1125.0 555.0 559 892 902.0 736.0 831.0 [4,] 697.0 1056.5 1369.5 893.5 1484.0 912.0 891 999 960.5 957.5 1147.0 [5,] 945.0 1568.0 1468.0 1130.0 2212.0 1162.0 1045 1126 1243.0 1456.0 1369.0 [,12] [1,] -135 [2,] 165 [3,] 431 [4,] 624 [5,] 1109 $n [1] 11 11 11 11 11 11 11 11 11 11 11 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 260.2928 644.038 1033.026 310.8839 823.2082 317.0442 267.927 734.792 [2,] 685.7072 1149.962 1366.974 871.1161 1426.7918 792.9558 850.073 1049.208 [,9] [,10] [,11] [,12] [1,] 708.8247 491.3748 563.9846 201.6653 [2,] 1095.1753 980.6252 1098.0154 660.3347 $out [1] 1428 3120 -1073 2655 -3980 2010 -533 $group [1] 1 3 9 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(-67, 250.5, 473, 697, 945, 370, 525.5, 897, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6qess1457856920.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,] 93166.0 102239.0 115197 127522.0 139885.0 151779 155178.0 165805.0 [2,] 94834.0 105219.0 118078 130274.5 143017.0 153033 157020.5 168009.5 [3,] 95860.5 109342.0 121791 133949.5 147184.5 155031 159602.5 170833.5 [4,] 97477.5 111560.5 124471 136889.5 150102.0 156033 162475.0 173243.0 [5,] 101130.0 114506.0 126898 139342.0 151614.0 158928 165473.0 175639.0 [,9] [,10] [,11] [,12] [1,] 176169.0 183039 187019.0 NA [2,] 177702.5 184181 187883.5 NA [3,] 180538.5 185935 189785.0 NA [4,] 182036.0 186434 191212.0 NA [5,] 183241.0 187156 192172.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 94654.78 106449.6 118875.1 130932.4 143953 153662.7 157114.7 168446.5 [2,] 97066.22 112234.4 124706.9 136966.6 150416 156399.3 162090.3 173220.5 [,9] [,10] [,11] [,12] [1,] 178562 184907.4 188266.8 NA [2,] 182515 186962.6 191303.2 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" NA Warning message: In bxp(list(stats = c(93166, 94834, 95860.5, 97477.5, 101130, 102239, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7sqnw1457856920.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,] 145191.2 151779 146173.2 [2,] 147212.9 153033 148516.1 [3,] 150016.6 155031 151778.1 [4,] 152099.8 156033 154159.9 [5,] 153767.3 158928 156280.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 147787.7 153662.7 149204.0 [2,] 152245.6 156399.3 154352.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(145191.181818182, 147212.863636364, 150016.636363636, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/188mj1457856920.ps tmp/188mj1457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/297r81457856920.ps tmp/297r81457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/3aoho1457856920.ps tmp/3aoho1457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/4k5k81457856920.ps tmp/4k5k81457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/5o9td1457856920.ps tmp/5o9td1457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/6qess1457856920.ps tmp/6qess1457856920.png",intern=TRUE)) character(0) > try(system("convert tmp/7sqnw1457856920.ps tmp/7sqnw1457856920.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.469 0.395 2.894