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(239050,238600,236980,236050,234870,233060,231370,230300,228340,226760,223550,221460,220560,220350,219500,218800,218130,217150,216430,215310,213780,213040,211940,212270,212540,213790,214400,215520,216690,217630,218710,219360,219800,221110,221320,225230,227340,228930,230340,231270,231830,232450,233220,233520,234520,234860,236560,238310,239690,240700,241330,241580,241670,241970,241690,241410,242130,242130,243320,242030,242740,243050,243360,243940,244270,244350,244260,244230,245130,246740,247910,249590,251610,253430,255290,256710,257190,257820,257460,257970,259520,261340,263150) > 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] 83 > (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] 7 7 7 7 7 7 7 7 7 7 7 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 239050 220560 212540 227340 239690 242740 251610 [2,] 238600 220350 213790 228930 240700 243050 253430 [3,] 236980 219500 214400 230340 241330 243360 255290 [4,] 236050 218800 215520 231270 241580 243940 256710 [5,] 234870 218130 216690 231830 241670 244270 257190 [6,] 233060 217150 217630 232450 241970 244350 257820 [7,] 231370 216430 218710 233220 241690 244260 257460 [8,] 230300 215310 219360 233520 241410 244230 257970 [9,] 228340 213780 219800 234520 242130 245130 259520 [10,] 226760 213040 221110 234860 242130 246740 261340 [11,] 223550 211940 221320 236560 243320 247910 263150 [12,] 221460 212270 225230 238310 242030 249590 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -450 -210 1250 1590 1010 310 1820 [2,] -1620 -850 610 1410 630 310 1860 [3,] -930 -700 1120 930 250 580 1420 [4,] -1180 -670 1170 560 90 330 480 [5,] -1810 -980 940 620 300 80 630 [6,] -1690 -720 1080 770 -280 -90 -360 [7,] -1070 -1120 650 300 -280 -30 510 [8,] -1960 -1530 440 1000 720 900 1550 [9,] -1580 -740 1310 340 0 1610 1820 [10,] -3210 -1100 210 1700 1190 1170 1810 [11,] -2090 330 3910 1750 -1290 1680 NA [12,] -900 270 2110 1380 710 2020 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/149cj1413462847.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/2q7hj1413462847.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/3qsfp1413462847.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/4otb51413462847.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,] 212540 213790 214400 215520 216690 217150 216430 215310 213780 213040 [2,] 223950 224640 224920 225035 224980 225040 225040 224830 224070 223935 [3,] 239050 238600 236980 236050 234870 233060 233220 233520 234520 234860 [4,] 241215 241875 242345 242760 242970 243160 242975 242820 243630 244435 [5,] 251610 253430 255290 256710 257190 257820 257460 257970 259520 261340 [,11] [,12] [1,] 211940 212270 [2,] 222435 221460 [3,] 236560 231770 [4,] 245615 242030 [5,] 263150 249590 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 228739.6 228307.5 226574.1 225464.9 224126.7 222239 222509.5 222776.7 [2,] 249360.4 248892.5 247385.9 246635.1 245613.3 243881 243930.5 244263.3 [,9] [,10] [,11] [,12] [1,] 222839.1 222617.7 222717.3 218501.7 [2,] 246200.9 247102.3 250402.7 245038.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(212540, 223950, 239050, 241215, 251610, 213790, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rp1y1413462847.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,] -450 -1620 -930 -1180 -1810 -1690 -1120 -1960 -1580 -3210 -2090 -900 [2,] 50 -270 -225 -290 -450 -540 -675 -545 -370 -445 -1290 270 [3,] 1010 610 580 330 300 -280 -30 720 340 1170 1005 1045 [4,] 1420 1020 1025 520 625 340 405 950 1460 1445 1750 2020 [5,] 1820 1860 1420 1170 940 1080 650 1550 1820 1810 3910 2110 $n [1] 7 7 7 7 7 7 7 7 7 7 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 191.8581 -160.3672 -166.4798 -153.7189 -341.9727 -805.5218 -674.9586 [2,] 1828.1419 1380.3672 1326.4798 813.7189 941.9727 245.5218 614.9586 [,8] [,9] [,10] [,11] [,12] [1,] -172.7899 -752.8465 41.32249 -955.8982 -83.80652 [2,] 1612.7899 1432.8465 2298.67751 2965.8982 2173.80652 $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(-450, 50, 1010, 1420, 1820, -1620, -270, 610, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ox7w1413462847.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,] 221460 211940 212540 227340 240700 242740 253430 [2,] 227550 213410 214960 230805 241370 243650 256000 [3,] 232215 216790 218170 232835 241680 244265 257460 [4,] 236515 219150 220455 234690 242080 245935 258745 [5,] 239050 220560 225230 238310 242130 247910 261340 $n [1] 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 228126 214171.9 215663.7 231063 241356.2 243222.8 256152.3 [2,] 236304 219408.1 220676.3 234607 242003.8 245307.2 258767.7 $out [1] 239690 243320 249590 251610 263150 $group [1] 5 5 6 7 7 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(221460, 227550, 232215, 236515, 239050, 211940, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73hh41413462847.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,] 233361.4 231770 233257.5 [2,] 234289.3 233370 233445.0 [3,] 234740.0 234865 233873.8 [4,] 234934.3 236770 234016.2 [5,] 235392.9 239050 234185.0 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 234445.8 233314.2 233613.2 [2,] 235034.2 236415.8 234134.3 $out [1] 231481.7 232582.5 231751.2 $group [1] 1 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(233361.428571429, 234289.285714286, 234740, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/149cj1413462847.ps tmp/149cj1413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/2q7hj1413462847.ps tmp/2q7hj1413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/3qsfp1413462847.ps tmp/3qsfp1413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/4otb51413462847.ps tmp/4otb51413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/5rp1y1413462847.ps tmp/5rp1y1413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/6ox7w1413462847.ps tmp/6ox7w1413462847.png",intern=TRUE)) character(0) > try(system("convert tmp/73hh41413462847.ps tmp/73hh41413462847.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.519 0.455 2.990