R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-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(1155168,1144638,1133976,1111920,1330188,1318626,1155168,1046484,1056978,1056978,1068672,1089696,1155168,1133976,1166694,1220472,1526400,1526400,1461096,1395624,1449402,1514838,1526400,1559118,1657302,1591836,1591836,1690020,1962198,1984254,1929480,1798572,1896726,1896726,1907256,1962198,2005446,2027502,2027502,2092938,2344086,2409390,2419884,2256426,2344086,2311368,2245902,2387334,2419884,2365110,2376672,2452638,2736510,2877744,2877744,2812440,2910492,2812440,2757528,2965434,2997984,2920992,3117198,3194196,3423126,3575052,3554034,3542334,3629994,3619332,3488592,3684768,3750240,3684768,3956946,4087854,4392612,4512858,4480272,4414800,4469610,4535046,4316646,4490766,4600518,4556238,4839942,4937958,5352606,5428566,5330544,5385324,5418042,5450760,5242854,5439066,5547744,5439066,5755650,5853708,6278808,6344280,6365304,6475020,6475020,6518268,6322056,6420246,6485550,6365304,6714474,6779916,7215582,7292580,7401258,7499448,7509942,7521504,7325298,7521504) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1155168 1155168 1657302 2005446 2419884 2997984 3750240 4600518 5547744 [2,] 1144638 1133976 1591836 2027502 2365110 2920992 3684768 4556238 5439066 [3,] 1133976 1166694 1591836 2027502 2376672 3117198 3956946 4839942 5755650 [4,] 1111920 1220472 1690020 2092938 2452638 3194196 4087854 4937958 5853708 [5,] 1330188 1526400 1962198 2344086 2736510 3423126 4392612 5352606 6278808 [6,] 1318626 1526400 1984254 2409390 2877744 3575052 4512858 5428566 6344280 [7,] 1155168 1461096 1929480 2419884 2877744 3554034 4480272 5330544 6365304 [8,] 1046484 1395624 1798572 2256426 2812440 3542334 4414800 5385324 6475020 [9,] 1056978 1449402 1896726 2344086 2910492 3629994 4469610 5418042 6475020 [10,] 1056978 1514838 1896726 2311368 2812440 3619332 4535046 5450760 6518268 [11,] 1068672 1526400 1907256 2245902 2757528 3488592 4316646 5242854 6322056 [12,] 1089696 1559118 1962198 2387334 2965434 3684768 4490766 5439066 6420246 [,10] [,11] [1,] 6485550 NA [2,] 6365304 NA [3,] 6714474 NA [4,] 6779916 NA [5,] 7215582 NA [6,] 7292580 NA [7,] 7401258 NA [8,] 7499448 NA [9,] 7509942 NA [10,] 7521504 NA [11,] 7325298 NA [12,] 7521504 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -10530 -21192 -65466 22056 -54774 -76992 -65472 -44280 -108678 [2,] -10662 32718 0 0 11562 196206 272178 283704 316584 [3,] -22056 53778 98184 65436 75966 76998 130908 98016 98058 [4,] 218268 305928 272178 251148 283872 228930 304758 414648 425100 [5,] -11562 0 22056 65304 141234 151926 120246 75960 65472 [6,] -163458 -65304 -54774 10494 0 -21018 -32586 -98022 21024 [7,] -108684 -65472 -130908 -163458 -65304 -11700 -65472 54780 109716 [8,] 10494 53778 98154 87660 98052 87660 54810 32718 0 [9,] 0 65436 0 -32718 -98052 -10662 65436 32718 43248 [10,] 11694 11562 10530 -65466 -54912 -130740 -218400 -207906 -196212 [11,] 21024 32718 54942 141432 207906 196176 174120 196212 98190 [12,] 65472 98184 43248 32550 32550 65472 109752 108678 65304 [,10] [,11] [1,] -120246 NA [2,] 349170 NA [3,] 65442 NA [4,] 435666 NA [5,] 76998 NA [6,] 108678 NA [7,] 98190 NA [8,] 10494 NA [9,] 11562 NA [10,] -196206 NA [11,] 196206 NA [12,] 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/1u1w01373023391.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/23jf81373023391.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/3ea6m1373023391.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/4emzc1373023391.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] [1,] 1155168 1133976 1133976 1111920 1330188 1318626 1155168 1046484 1056978 [2,] 1657302 1591836 1591836 1690020 1962198 1984254 1929480 1798572 1896726 [3,] 2708934 2643051 2746935 2823417 3079818 3226398 3215889 3177387 3270243 [4,] 4600518 4556238 4839942 4937958 5352606 5428566 5330544 5385324 5418042 [5,] 6485550 6365304 6714474 6779916 7215582 7292580 7401258 7499448 7509942 [,10] [,11] [,12] [1,] 1056978 1068672 1089696 [2,] 1896726 1907256 1962198 [3,] 3215886 3123060 3325101 [4,] 5450760 5242854 5439066 [5,] 7521504 7325298 7521504 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1238386 1161918 1124052 1200618 1385835 1505482 1516582 1385303 1510853 [2,] 4179482 4124184 4369818 4446216 4773801 4947314 4915196 4969471 5029633 [,10] [,11] [,12] [1,] 1440149 1456462 1587919 [2,] 4991623 4789658 5062283 $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(1155168, 1657302, 2708934, 4600518, 6485550, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5hp3a1373023391.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] [1,] -120246 -10662 53778 218268 -11562 -163458 -163458 0 -32718 -218400 [2,] -76992 0 65436 251148 22056 -65304 -108684 10494 -10662 -196212 [3,] -60120 114462 76482 294315 70716 -26802 -65388 54294 5781 -98103 [4,] -21192 283704 98058 414648 120246 10494 54780 87660 43248 10530 [5,] 22056 349170 130908 435666 151926 108678 109716 98154 65436 11694 [,11] [,12] [1,] 21024 32550 [2,] 54942 43248 [3,] 157776 65472 [4,] 196206 98184 [5,] 207906 109752 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -87999.9 -27287.83 60182.75 212623.9 21656.36 -64673.7 -147061.13 [2,] -32240.1 256211.83 92781.25 376006.1 119775.64 11069.7 16285.13 [,8] [,9] [,10] [,11] [,12] [1,] 15738.79 -21154.59 -201399.546 87194.87 36539.04 [2,] 92849.21 32716.59 5193.546 228357.13 94404.96 $out [1] -22056 -98052 $group [1] 3 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-120246, -76992, -60120, -21192, 22056, -10662, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/61h8g1373023391.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,] 1046484 1133976 1591836 2005446 2365110 2920992 3684768 4556238 5439066 [2,] 1062825 1193583 1673661 2060220 2436261 3155697 4022400 4888950 5804679 [3,] 1122948 1455249 1896726 2283897 2784984 3515463 4403706 5341575 6333168 [4,] 1155168 1526400 1945839 2365710 2877744 3597192 4485519 5423304 6447633 [5,] 1155168 1559118 1984254 2419884 2965434 3684768 4535046 5450760 6518268 [,10] [,11] [1,] 6365304 NA [2,] 6747195 NA [3,] 7308939 NA [4,] 7504695 NA [5,] 7521504 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1080830 1303449 1772584 2144561 2583621 3314094 4192474 5097853 6039912 [2,] 1165066 1607049 2020868 2423233 2986347 3716832 4614938 5585297 6626424 [,10] [,11] [1,] 6963438 NA [2,] 7654440 NA $out [1] 1330188 1318626 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(1046484, 1062825, 1122948, 1155168, 1155168, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/79qg01373023391.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,] 3122943 2643051 3019562 [2,] 3305126 2785176 3209032 [3,] 3659429 3150224 3556446 [4,] 3719878 3221144 3602930 [5,] 3752013 3325101 3645088 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 3470258 2951376 3376787 [2,] 3848601 3349071 3736106 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3122943, 3305125.5, 3659429.4, 3719877.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u1w01373023391.ps tmp/1u1w01373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/23jf81373023391.ps tmp/23jf81373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/3ea6m1373023391.ps tmp/3ea6m1373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/4emzc1373023391.ps tmp/4emzc1373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/5hp3a1373023391.ps tmp/5hp3a1373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/61h8g1373023391.ps tmp/61h8g1373023391.png",intern=TRUE)) character(0) > try(system("convert tmp/79qg01373023391.ps tmp/79qg01373023391.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.421 1.070 6.639