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(145756,145472,145160,144588,150460,150172,145756,142820,143108,143108,143392,143992,143992,141340,140172,141340,145472,144872,139288,134560,133676,131908,133104,134560,133988,132792,130456,132792,134872,134272,127492,124556,121620,119256,118972,120736,118372,117488,116604,121620,122192,119256,111304,107772,102188,99820,100988,102756,102756,101304,100988,105720,109540,107772,101872,98940,92756,88936,91872,94808,94808,90988,90704,95688,98940,97768,91872,88052,79788,76568,77736,82752,83036,75684,78336,84804,87740,85972,78024,72436,65968,60952,63004,67420,66252,59784,61836,68304,71840,69788,61836,58304,53004,47416,48300,52716,53288,47988,48872,56252,58016,55056,44168,38584,31204,23852,26216,29436,28868,23252,26500,34452,37984,36220,29152,23568,17668,10884,12084,14136) > 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] [,10] [,11] [1,] 145756 143992 133988 118372 102756 94808 83036 66252 53288 28868 NA [2,] 145472 141340 132792 117488 101304 90988 75684 59784 47988 23252 NA [3,] 145160 140172 130456 116604 100988 90704 78336 61836 48872 26500 NA [4,] 144588 141340 132792 121620 105720 95688 84804 68304 56252 34452 NA [5,] 150460 145472 134872 122192 109540 98940 87740 71840 58016 37984 NA [6,] 150172 144872 134272 119256 107772 97768 85972 69788 55056 36220 NA [7,] 145756 139288 127492 111304 101872 91872 78024 61836 44168 29152 NA [8,] 142820 134560 124556 107772 98940 88052 72436 58304 38584 23568 NA [9,] 143108 133676 121620 102188 92756 79788 65968 53004 31204 17668 NA [10,] 143108 131908 119256 99820 88936 76568 60952 47416 23852 10884 NA [11,] 143392 133104 118972 100988 91872 77736 63004 48300 26216 12084 NA [12,] 143992 134560 120736 102756 94808 82752 67420 52716 29436 14136 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -284 -2652 -1196 -884 -1452 -3820 -7352 -6468 -5300 -5616 NA [2,] -312 -1168 -2336 -884 -316 -284 2652 2052 884 3248 NA [3,] -572 1168 2336 5016 4732 4984 6468 6468 7380 7952 NA [4,] 5872 4132 2080 572 3820 3252 2936 3536 1764 3532 NA [5,] -288 -600 -600 -2936 -1768 -1172 -1768 -2052 -2960 -1764 NA [6,] -4416 -5584 -6780 -7952 -5900 -5896 -7948 -7952 -10888 -7068 NA [7,] -2936 -4728 -2936 -3532 -2932 -3820 -5588 -3532 -5584 -5584 NA [8,] 288 -884 -2936 -5584 -6184 -8264 -6468 -5300 -7380 -5900 NA [9,] 0 -1768 -2364 -2368 -3820 -3220 -5016 -5588 -7352 -6784 NA [10,] 284 1196 -284 1168 2936 1168 2052 884 2364 1200 NA [11,] 600 1456 1764 1768 2936 5016 4416 4416 3220 2052 NA [12,] 0 -572 -2364 0 0 284 -1168 572 -568 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/fisher/rcomp/tmp/1k1qt1376733781.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/fisher/rcomp/tmp/2kldv1376733781.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/fisher/rcomp/tmp/3ygg81376733781.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/fisher/rcomp/tmp/4e70i1376733782.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,] 28868 23252 26500 34452 37984 36220 29152 23568 17668 10884 [2,] 66252 59784 61836 68304 71840 69788 61836 58304 53004 47416 [3,] 98782 96146 95846 100704 104240 102770 96872 93496 86272 82752 [4,] 133988 132792 130456 132792 134872 134272 127492 124556 121620 119256 [5,] 145756 145472 145160 144588 150460 150172 145756 142820 143108 143108 [,11] [,12] [1,] 12084 14136 [2,] 48300 52716 [3,] 84804 88780 [4,] 118972 120736 [5,] 143392 143992 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 64938.39 59668.29 61560.71 68483.22 72746.7 70551.22 64067.64 [2,] 132625.61 132623.71 130131.29 132924.78 135733.3 134988.78 129676.36 [,8] [,9] [,10] [,11] [,12] [1,] 60393.86 51988.71 46857.87 49493.45 54794.5 [2,] 126598.14 120555.29 118646.13 120114.55 122765.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(28868, 66252, 98782, 133988, 145756, 23252, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5zs6h1376733782.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,] -7352 -2336 -572 572 -2960 -10888 -5588 -8264 -7352 -284 600 -1168 [2,] -5616 -884 2336 2080 -2052 -7952 -5584 -6468 -5588 884 1764 -572 [3,] -3236 -298 5000 3392 -1766 -6924 -3676 -5742 -3520 1182 2494 0 [4,] -1196 2052 6468 3820 -600 -5896 -2936 -2936 -2364 2052 4416 0 [5,] -284 3248 7952 5872 -288 -4416 -2932 288 0 2936 5016 572 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -5444.408 -1764.943 2935.488 2522.627 -2491.477 -7951.26 -4999.046 [2,] -1027.592 1168.943 7064.512 4261.373 -1040.523 -5896.74 -2352.954 [,8] [,9] [,10] [,11] [,12] [1,] -7506.728 -5130.839 598.4206 1168.955 -301.2533 [2,] -3977.272 -1909.161 1765.5794 3819.045 301.2533 $out [1] -2364 $group [1] 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-7352, -5616, -3236, -1196, -284, -2336, -884, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ehxe1376733782.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] [,11] [1,] 142820 131908 118972 99820 88936 76568 60952 47416 23852 10884 NA [2,] 143250 134118 121178 102472 93782 81270 66694 52860 30320 15902 NA [3,] 144874 139730 128974 113954 101146 90846 76854 60810 46078 25034 NA [4,] 145756 142666 133390 118814 104238 95248 83920 67278 54172 31802 NA [5,] 145756 145472 134872 122192 109540 98940 87740 71840 58016 37984 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 143731 135831.2 123404 106500.3 96376.95 84470.54 68997.11 54233.85 [2,] 146017 143628.8 134544 121407.7 105915.05 97221.46 84710.89 67386.15 [,9] [,10] [,11] [1,] 35198.94 17781.9 NA [2,] 56957.06 32286.1 NA $out [1] 150460 150172 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(142820, 143250, 144874, 145756, 145756, 131908, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/7sdw51376733782.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,] 80270.0 82752 82598.50 [2,] 84214.6 87526 86410.00 [3,] 93342.8 95996 95513.25 [4,] 97833.8 99743 100740.00 [5,] 101705.6 104240 103758.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 87130.99 90423.74 88977.24 [2,] 99554.61 101568.26 102049.26 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(80270, 84214.6, 93342.8, 97833.8, 101705.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1k1qt1376733781.ps tmp/1k1qt1376733781.png",intern=TRUE)) character(0) > try(system("convert tmp/2kldv1376733781.ps tmp/2kldv1376733781.png",intern=TRUE)) character(0) > try(system("convert tmp/3ygg81376733781.ps tmp/3ygg81376733781.png",intern=TRUE)) character(0) > try(system("convert tmp/4e70i1376733782.ps tmp/4e70i1376733782.png",intern=TRUE)) character(0) > try(system("convert tmp/5zs6h1376733782.ps tmp/5zs6h1376733782.png",intern=TRUE)) character(0) > try(system("convert tmp/6ehxe1376733782.ps tmp/6ehxe1376733782.png",intern=TRUE)) character(0) > try(system("convert tmp/7sdw51376733782.ps tmp/7sdw51376733782.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.179 0.740 3.911