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(209.704,208.923,208.131,206.492,222.706,221.848,209.704,201.630,202.411,202.411,203.280,204.842,207.273,207.273,205.711,201.630,222.706,225.918,221.067,209.704,214.566,207.273,210.562,212.135,213.774,209.704,210.562,204.842,222.706,228.349,223.498,214.566,224.279,213.774,223.498,222.706,225.137,216.205,225.918,225.137,239.712,236.423,223.498,216.986,225.918,213.774,222.706,224.279,227.568,220.286,224.279,226.710,235.642,228.349,218.636,208.131,217.855,191.125,204.061,211.343,218.636,208.131,208.131,208.131,213.774,205.711,195.129,186.274,192.698,167.618,182.985,191.917,193.556,184.624,185.405,182.985,191.125,185.405,174.130,165.979,179.762,149.831,169.268,178.123,178.123,167.618,157.905,157.124,165.979,157.905,142.549,131.967,143.330,116.611,140.899,153.824,157.905,148.973,137.687,145.761,148.973,146.542,122.243,110.968,119.031,94.743,119.823,128.755,136.037,123.893,112.530,119.031,122.243,115.819,91.531,80.949,90.662,63.943,93.093,110.968) > 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,] 209.704 207.273 213.774 225.137 227.568 218.636 193.556 178.123 157.905 [2,] 208.923 207.273 209.704 216.205 220.286 208.131 184.624 167.618 148.973 [3,] 208.131 205.711 210.562 225.918 224.279 208.131 185.405 157.905 137.687 [4,] 206.492 201.630 204.842 225.137 226.710 208.131 182.985 157.124 145.761 [5,] 222.706 222.706 222.706 239.712 235.642 213.774 191.125 165.979 148.973 [6,] 221.848 225.918 228.349 236.423 228.349 205.711 185.405 157.905 146.542 [7,] 209.704 221.067 223.498 223.498 218.636 195.129 174.130 142.549 122.243 [8,] 201.630 209.704 214.566 216.986 208.131 186.274 165.979 131.967 110.968 [9,] 202.411 214.566 224.279 225.918 217.855 192.698 179.762 143.330 119.031 [10,] 202.411 207.273 213.774 213.774 191.125 167.618 149.831 116.611 94.743 [11,] 203.280 210.562 223.498 222.706 204.061 182.985 169.268 140.899 119.823 [12,] 204.842 212.135 222.706 224.279 211.343 191.917 178.123 153.824 128.755 [,10] [,11] [1,] 136.037 NA [2,] 123.893 NA [3,] 112.530 NA [4,] 119.031 NA [5,] 122.243 NA [6,] 115.819 NA [7,] 91.531 NA [8,] 80.949 NA [9,] 90.662 NA [10,] 63.943 NA [11,] 93.093 NA [12,] 110.968 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.781 0.000 -4.070 -8.932 -7.282 -10.505 -8.932 -10.505 -8.932 [2,] -0.792 -1.562 0.858 9.713 3.993 0.000 0.781 -9.713 -11.286 [3,] -1.639 -4.081 -5.720 -0.781 2.431 0.000 -2.420 -0.781 8.074 [4,] 16.214 21.076 17.864 14.575 8.932 5.643 8.140 8.855 3.212 [5,] -0.858 3.212 5.643 -3.289 -7.293 -8.063 -5.720 -8.074 -2.431 [6,] -12.144 -4.851 -4.851 -12.925 -9.713 -10.582 -11.275 -15.356 -24.299 [7,] -8.074 -11.363 -8.932 -6.512 -10.505 -8.855 -8.151 -10.582 -11.275 [8,] 0.781 4.862 9.713 8.932 9.724 6.424 13.783 11.363 8.063 [9,] 0.000 -7.293 -10.505 -12.144 -26.730 -25.080 -29.931 -26.719 -24.288 [10,] 0.869 3.289 9.724 8.932 12.936 15.367 19.437 24.288 25.080 [11,] 1.562 1.573 -0.792 1.573 7.282 8.932 8.855 12.925 8.932 [12,] 2.431 1.639 2.431 3.289 7.293 1.639 0.000 4.081 7.282 [,10] [,11] [1,] -12.144 NA [2,] -11.363 NA [3,] 6.501 NA [4,] 3.212 NA [5,] -6.424 NA [6,] -24.288 NA [7,] -10.582 NA [8,] 9.713 NA [9,] -26.719 NA [10,] 29.150 NA [11,] 17.875 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/1amb11437380863.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/2myad1437380863.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/39ijj1437380863.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/450lx1437380863.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,] 136.0370 123.893 112.530 119.031 122.243 115.8190 91.5310 80.949 [2,] 178.1230 167.618 157.905 157.124 165.979 157.9050 142.5490 131.967 [3,] 208.4885 207.702 206.921 203.236 218.240 213.7795 202.4165 193.952 [4,] 218.6360 209.704 210.562 208.131 222.706 228.3490 221.0670 209.704 [5,] 227.5680 220.286 225.918 226.710 239.712 236.4230 223.4980 216.986 [,9] [,10] [,11] [,12] [1,] 90.6620 63.9430 93.0930 110.9680 [2,] 143.3300 116.6110 140.8990 153.8240 [3,] 197.5545 179.3715 193.1325 198.3795 [4,] 217.8550 207.2730 210.5620 212.1350 [5,] 225.9180 213.7740 223.4980 224.2790 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 188.2466 186.6742 180.6115 177.7509 189.8969 178.5829 163.1858 155.1115 [2,] 228.7304 228.7298 233.2305 228.7211 246.5831 248.9761 241.6472 232.7925 [,9] [,10] [,11] [,12] [1,] 160.3188 134.0732 158.3261 169.245 [2,] 234.7902 224.6698 227.9389 227.514 $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(136.037, 178.123, 208.4885, 218.636, 227.568, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5l0c81437380863.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] [1,] -12.144 -11.363 -5.720 3.2120 -8.0740 -15.3560 -11.3630 4.8620 -29.931 [2,] -10.505 -9.713 -2.420 5.6430 -7.2930 -15.3560 -10.5820 6.4240 -26.719 [3,] -8.932 -0.396 -0.781 8.8935 -4.5045 -11.7095 -9.7185 9.3225 -24.684 [4,] -4.070 0.858 2.431 16.2140 -0.8580 -9.7130 -8.1510 9.7240 -10.505 [5,] 0.000 9.713 8.074 21.0760 5.6430 -4.8510 -6.5120 13.7830 0.000 [,10] [,11] [,12] [1,] 0.8690 -0.7920 0.000 [2,] 8.9320 1.5730 1.639 [3,] 14.1515 8.0685 2.431 [4,] 24.2880 8.9320 4.081 [5,] 29.1500 17.8750 7.293 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -12.147183 -5.677693 -3.204753 3.611807 -7.719683 -14.528968 -10.933125 [2,] -5.716817 4.885693 1.642753 14.175193 -1.289317 -8.890032 -8.503875 [,8] [,9] [,10] [,11] [,12] [1,] 7.673688 -32.78516 6.47903 4.39165 1.14488 [2,] 10.971312 -16.58284 21.82397 11.74535 3.71712 $out [1] -24.299 -24.288 0.781 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-12.144, -10.505, -8.93199999999999, -4.06999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67li41437380863.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,] 201.6300 201.6300 204.842 213.774 191.125 167.6180 165.9790 116.611 [2,] 202.8455 207.2730 212.168 219.846 209.737 189.0955 171.6990 141.724 [3,] 207.3115 210.1330 218.636 224.708 219.461 200.4200 181.3735 155.474 [4,] 209.7040 217.8165 223.498 225.918 227.139 208.1310 185.4050 161.942 [5,] 209.7040 225.9180 228.349 225.918 235.642 218.6360 193.5560 178.123 [,9] [,10] [,11] [1,] 94.7430 63.9430 NA [2,] 119.4270 91.0965 NA [3,] 133.2210 111.7490 NA [4,] 147.7575 120.6370 NA [5,] 157.9050 136.0370 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 204.1833 205.324 213.4683 221.9385 211.5238 191.7378 175.1221 146.2524 [2,] 210.4397 214.942 223.8037 227.4775 227.3982 209.1022 187.6249 164.6956 [,9] [,10] [,11] [1,] 120.2993 98.27538 NA [2,] 146.1427 125.22262 NA $out [1] 222.706 221.848 239.712 236.423 149.831 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(201.63, 202.8455, 207.3115, 209.704, 209.704, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7lr8v1437380863.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,] 162.1103 179.3715 165.4868 [2,] 179.0344 195.7533 181.5997 [3,] 185.7575 202.8262 185.7866 [4,] 192.3949 208.0952 193.4749 [5,] 198.5566 218.2400 199.7009 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 179.6637 197.1970 180.3702 [2,] 191.8514 208.4555 191.2029 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(162.1103, 179.03435, 185.75755, 192.39495, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1amb11437380863.ps tmp/1amb11437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/2myad1437380863.ps tmp/2myad1437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/39ijj1437380863.ps tmp/39ijj1437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/450lx1437380863.ps tmp/450lx1437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/5l0c81437380863.ps tmp/5l0c81437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/67li41437380863.ps tmp/67li41437380863.png",intern=TRUE)) character(0) > try(system("convert tmp/7lr8v1437380863.ps tmp/7lr8v1437380863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.402 0.478 2.910