R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 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(350840 + ,354950 + ,342750 + ,318610 + ,303890 + ,293480 + ,286820 + ,283650 + ,276190 + ,268670 + ,275960 + ,287040 + ,291500 + ,287540 + ,272340 + ,256570 + ,246190 + ,237340 + ,235890 + ,232790 + ,226100 + ,221110 + ,221950 + ,222990 + ,232840 + ,231380 + ,221690 + ,210190 + ,202210 + ,195210 + ,194050 + ,192360 + ,187170 + ,185930 + ,188840 + ,189350 + ,194320 + ,195850 + ,188840 + ,182380 + ,177200 + ,169140 + ,171900 + ,167320 + ,164130 + ,162550 + ,166260 + ,166010 + ,177070 + ,180800 + ,179570 + ,178130 + ,178180 + ,179430 + ,179130 + ,182220 + ,183650 + ,187110 + ,197780 + ,204000 + ,221330 + ,232500 + ,237570 + ,241100 + ,244420 + ,247240 + ,254300 + ,258970 + ,262230 + ,268880 + ,277950 + ,286630 + ,299830 + ,308090 + ,311400 + ,313520 + ,310980 + ,314910 + ,310950 + ,310720 + ,310380 + ,310570 + ,314790 + ,323400 + ,335010 + ,341630 + ,340820 + ,336280 + ,325490 + ,323750 + ,317510 + ,313890 + ,308610 + ,303720 + ,303090 + ,305140 + ,304040 + ,307100 + ,304330 + ,294710 + ,286890 + ,279050 + ,271860 + ,266710 + ,259590 + ,253830 + ,250640 + ,249140 + ,250840 + ,247590 + ,237830 + ,226380 + ,217230 + ,211420 + ,207620 + ,204310 + ,197490 + ,193580 + ,192330 + ,191970 + ,196070 + ,191940 + ,185620 + ,179410 + ,173920 + ,169190 + ,166840 + ,165170 + ,161450 + ,160830 + ,163670 + ,170830 + ,182690 + ,190940 + ,197770 + ,205090 + ,210720 + ,220210 + ,229730 + ,237070 + ,241620 + ,250370 + ,258570 + ,269860 + ,283220 + ,289610 + ,281770 + ,274700 + ,267650 + ,261380 + ,260500 + ,260730 + ,254200 + ,250450 + ,253380 + ,263740 + ,276240 + ,273820 + ,265890 + ,258400 + ,253520 + ,250710 + ,252850 + ,255260 + ,251170 + ,252500 + ,257780 + ,269900 + ,291590 + ,298870 + ,295570 + ,292100 + ,290870 + ,290580 + ,297970 + ,304010 + ,304340 + ,309850 + ,322320 + ,340170 + ,369280 + ,376690 + ,379700 + ,379520 + ,377770 + ,381560 + ,394580 + ,399320 + ,400370 + ,408200 + ,419070 + ,437730) > 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] 192 > (np <- floor(n / par1)) [1] 16 > 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] 16 16 16 16 16 16 16 16 16 16 16 16 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 350840 291500 232840 194320 177070 221330 299830 335010 304040 250840 [2,] 354950 287540 231380 195850 180800 232500 308090 341630 307100 247590 [3,] 342750 272340 221690 188840 179570 237570 311400 340820 304330 237830 [4,] 318610 256570 210190 182380 178130 241100 313520 336280 294710 226380 [5,] 303890 246190 202210 177200 178180 244420 310980 325490 286890 217230 [6,] 293480 237340 195210 169140 179430 247240 314910 323750 279050 211420 [7,] 286820 235890 194050 171900 179130 254300 310950 317510 271860 207620 [8,] 283650 232790 192360 167320 182220 258970 310720 313890 266710 204310 [9,] 276190 226100 187170 164130 183650 262230 310380 308610 259590 197490 [10,] 268670 221110 185930 162550 187110 268880 310570 303720 253830 193580 [11,] 275960 221950 188840 166260 197780 277950 314790 303090 250640 192330 [12,] 287040 222990 189350 166010 204000 286630 323400 305140 249140 191970 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,] 196070 182690 283220 276240 291590 369280 NA [2,] 191940 190940 289610 273820 298870 376690 NA [3,] 185620 197770 281770 265890 295570 379700 NA [4,] 179410 205090 274700 258400 292100 379520 NA [5,] 173920 210720 267650 253520 290870 377770 NA [6,] 169190 220210 261380 250710 290580 381560 NA [7,] 166840 229730 260500 252850 297970 394580 NA [8,] 165170 237070 260730 255260 304010 399320 NA [9,] 161450 241620 254200 251170 304340 400370 NA [10,] 160830 250370 250450 252500 309850 408200 NA [11,] 163670 258570 253380 257780 322320 419070 NA [12,] 170830 269860 263740 269900 340170 437730 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 4110 -3960 -1460 1530 3730 11170 8260 6620 3060 -3250 -4130 [2,] -12200 -15200 -9690 -7010 -1230 5070 3310 -810 -2770 -9760 -6320 [3,] -24140 -15770 -11500 -6460 -1440 3530 2120 -4540 -9620 -11450 -6210 [4,] -14720 -10380 -7980 -5180 50 3320 -2540 -10790 -7820 -9150 -5490 [5,] -10410 -8850 -7000 -8060 1250 2820 3930 -1740 -7840 -5810 -4730 [6,] -6660 -1450 -1160 2760 -300 7060 -3960 -6240 -7190 -3800 -2350 [7,] -3170 -3100 -1690 -4580 3090 4670 -230 -3620 -5150 -3310 -1670 [8,] -7460 -6690 -5190 -3190 1430 3260 -340 -5280 -7120 -6820 -3720 [9,] -7520 -4990 -1240 -1580 3460 6650 190 -4890 -5760 -3910 -620 [10,] 7290 840 2910 3710 10670 9070 4220 -630 -3190 -1250 2840 [11,] 11080 1040 510 -250 6220 8680 8610 2050 -1500 -360 7160 [12,] 4460 9850 4970 11060 17330 13200 11610 -1100 1700 4100 11860 [,12] [,13] [,14] [,15] [,16] [,17] [1,] 8250 6390 -2420 7280 7410 NA [2,] 6830 -7840 -7930 -3300 3010 NA [3,] 7320 -7070 -7490 -3470 -180 NA [4,] 5630 -7050 -4880 -1230 -1750 NA [5,] 9490 -6270 -2810 -290 3790 NA [6,] 9520 -880 2140 7390 13020 NA [7,] 7340 230 2410 6040 4740 NA [8,] 4550 -6530 -4090 330 1050 NA [9,] 8750 -3750 1330 5510 7830 NA [10,] 8200 2930 5280 12470 10870 NA [11,] 11290 10360 12120 17850 18660 NA [12,] 13360 12500 21690 29110 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/1k1hr1414064057.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/2at061414064057.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/3utyp1414064057.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/4lejy1414064057.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] [1,] 177070 180800 179570 178130 173920 169140 166840 165170 161450 160830 [2,] 208700 213615 209730 207640 206465 203315 200835 198335 192330 190345 [3,] 279730 280680 269115 257485 249855 248975 253575 257115 252685 251475 [4,] 301935 307595 307865 304115 297380 292030 292395 293830 290265 286300 [5,] 369280 376690 379700 379520 377770 381560 394580 399320 400370 408200 [,11] [,12] [1,] 163670 166010 [2,] 195055 197985 [3,] 255580 266800 [4,] 290520 296090 [5,] 419070 437730 $n [1] 16 16 16 16 16 16 16 16 16 16 16 16 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 242902.2 243557.9 230351.7 219377.4 213943.6 213932.6 217408.8 219394.5 [2,] 316557.8 317802.1 307878.3 295592.6 285766.4 284017.4 289741.2 294835.5 [,9] [,10] [,11] [,12] [1,] 214000.7 213572.8 217871.3 228048.5 [2,] 291369.3 289377.2 293288.7 305551.5 $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(177070, 208700, 279730, 301935, 369280, 180800, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5bs0z1414064057.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,] -4130 -15200 -24140 -14720 -10410 -7190 -5150 -7460 -7520 -3190 -1500 [2,] -1940 -8810 -10535 -8565 -7420 -3880 -3240 -6610 -4400 1840 775 [3,] 3920 -4810 -6335 -5335 -3770 -1020 -950 -3905 -930 3965 7885 [4,] 7345 1100 -810 -1490 2035 4910 3880 690 4485 8635 11185 [5,] 11170 6830 7320 5630 9490 13020 7340 4550 8750 12470 18660 [,12] [1,] -1100 [2,] 4715 [3,] 11610 [4,] 13280 [5,] 21690 $n [1] 16 16 16 16 16 16 16 16 16 16 16 15 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 252.425 -8724.45 -10176.375 -8129.625 -7504.725 -4492.05 -3762.4 -6788.5 [2,] 7587.575 -895.55 -2493.625 -2540.375 -35.275 2452.05 1862.4 -1021.5 [,9] [,10] [,11] [,12] [1,] -4439.575 1280.975 3773.05 8115.872 [2,] 2579.575 6649.025 11996.95 15104.128 $out [1] 29110 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-4130, -1940, 3920, 7345, 11170, -15200, -8810, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t96t1414064057.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] [,10] [1,] 268670 221110 185930 162550 177070 221330 308090 303090 249140 191970 [2,] 279920 224545 189095 166135 178655 239335 310475 306875 256710 195535 [3,] 290260 236615 194630 170520 180185 250770 310965 320630 275455 209520 [4,] 330680 264455 215940 185610 185380 265555 314155 335645 299375 232105 [5,] 354950 291500 232840 195850 187110 286630 314910 341630 307100 250840 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,] 160830 182690 250450 250710 290580 369280 NA [2,] 164420 201430 257350 252675 291845 378645 NA [3,] 170010 224970 262560 256520 298420 388070 NA [4,] 182515 245995 278235 267895 307095 404285 NA [5,] 196070 269860 289610 276240 322320 437730 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 267108 218411.8 182385.8 161637.3 177117.7 238810.9 309286.5 307507.8 [2,] 313412 254818.2 206874.2 179402.7 183252.3 262729.1 312643.5 333752.2 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 255995.2 192840.2 161756.7 204643.6 253034.2 249578.1 291464.4 376375.4 [2,] 294914.8 226199.8 178263.3 245296.4 272085.8 263461.9 305375.6 399764.6 [,17] [1,] NA [2,] NA $out [1] 197780 204000 299830 323400 340170 $group [1] 5 5 7 7 15 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" NA Warning message: In bxp(list(stats = c(268670, 279920, 290260, 330680, 354950, 221110, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7hc471414064057.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,] 249259.4 248975.0 234776.2 [2,] 251784.4 252080.0 242678.8 [3,] 254109.7 256347.5 248126.9 [4,] 263167.5 267957.5 256056.2 [5,] 269331.2 280680.0 264922.5 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 248917.8 249105.7 242025.3 [2,] 259301.6 263589.3 254228.4 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(249259.375, 251784.375, 254109.6875, 263167.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1k1hr1414064057.ps tmp/1k1hr1414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/2at061414064057.ps tmp/2at061414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/3utyp1414064057.ps tmp/3utyp1414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/4lejy1414064057.ps tmp/4lejy1414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/5bs0z1414064057.ps tmp/5bs0z1414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/6t96t1414064057.ps tmp/6t96t1414064057.png",intern=TRUE)) character(0) > try(system("convert tmp/7hc471414064057.ps tmp/7hc471414064057.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.549 0.388 2.967